Why Gamma Moment Matching Is Useful
A gamma model can represent positive, right-skewed quantities, such as hypothetical claim amounts or waiting times. In applications, its shape controls how the distribution is skewed, while its scale determines the unit and overall spread. The method of moments gives a direct way to estimate both parameters from sample information about the mean and variability.
The key is to state the parameterization before calculating. This tutorial uses shape \(\alpha\) and scale \(\theta\), with both parameters positive. Some references use a rate parameter instead of a scale; the formulas for that convention differ. The method here is aligned with the SOA VEE Mathematical Statistics syllabus.
Gamma Moments and the Method-of-Moments Equations
Suppose \(X_1,\ldots,X_n\) are independent observations from the same gamma distribution. The method of moments equates sample moments to the corresponding population moments. For estimating two parameters, we use two equations. One convenient choice is to match the sample mean and the sample second central moment, where the latter has denominator \(n\):
The use of \(n\), rather than \(n-1\), is deliberate: \(m_2\) is the sample moment used for method-of-moments matching. It is not the usual unbiased sample variance. An equivalent approach matches the first two raw moments, \(n^{-1}\sum X_i\) and \(n^{-1}\sum X_i^2\).
Why the Formulas Hold
The gamma moment-generating function is \(M_X(t)=(1-\theta t)^{-\alpha}\) for \(t<1/\theta\). Differentiating gives the first two raw moments. In detail,
Evaluating at \(t=0\) yields \(E[X]=\alpha\theta\) and \(E[X^2]=\alpha(\alpha+1)\theta^2\). Therefore,
Now match \(\bar X\) to \(\alpha\theta\), and \(m_2\) to \(\alpha\theta^2\). Dividing the variance equation by the mean equation gives \(\theta=m_2/\bar X\). Substituting this into \(\bar X=\alpha\theta\) gives \(\alpha=\bar X/\theta=\bar X^2/m_2\). This derivation also shows why both sample moments are needed: the mean alone identifies only the product \(\alpha\theta\), not the two parameters separately.
Use shape \(\alpha\) and scale \(\theta\), so the model mean is \(\alpha\theta\) and its variance is \(\alpha\theta^2\).
Find \(\bar X\) and \(m_2=n^{-1}\sum(X_i-\bar X)^2\), or calculate the raw second moment and subtract \(\bar X^2\).
Use \(\hat{\alpha}=\bar X^2/m_2\) and \(\hat{\theta}=m_2/\bar X\). Confirm that both are positive and that the fitted mean and variance reproduce the matched sample moments.
Worked Calculations
Worked Example: Matching Moments From Individual Observations
A hypothetical portfolio has four observed positive claim amounts, recorded in thousands of dollars: \(2,4,4,6\). Assume the observations are independent and identically distributed as \(\operatorname{Gamma}(\alpha,\theta)\), with \(\theta\) measured in thousands of dollars. Find the method-of-moments estimates. Name the calculation method and identify a common mistake it avoids.
Method: match the sample mean and the sample second central moment. First calculate the mean:
The deviations from the mean are \(-2,0,0,2\), so the sum of squared deviations is \(4+0+0+4=8\). Thus,
Substitute these values into the moment estimates:
The fitted mean is \(8(0.5)=4\) thousand dollars, and the fitted variance is \(8(0.5)^2=8(0.25)=2\) thousand-dollars-squared. These equal the matched sample mean and \(m_2\), so the calculation checks. A common mistake is to use \(n-1\) in the variance calculation: that would give \(8/3\), which is not the sample central moment used in these method-of-moments equations.
Worked Example: Recovering the Moments From Raw-Moment Information
A hypothetical waiting-time sample, measured in hours, has sample mean \(3\) and sample raw second moment \(13.8\), calculated with denominator \(n\). Assume an independent and identically distributed gamma model with shape \(\alpha\) and scale \(\theta\) hours. Estimate both parameters, showing how the raw second moment is converted to a variance moment.
Method: convert the raw second moment to the central moment, then match. The sample raw second moment is the average of \(X_i^2\), not the variance. The corresponding sample central moment is
The shape estimate is
The scale estimate is
Check the fitted moments: the mean is \(1.875(1.6)=3\) hours, and the variance is \(1.875(1.6)^2=1.875(2.56)=4.8\) hours-squared. Both match. The mistake avoided here is treating the raw second moment \(13.8\) as the variance; the variance moment is \(13.8-3^2=4.8\).
Worked Example: Distinguishing the Method-of-Moments Denominator
For a hypothetical independent sample of \(n=10\) positive measurements, the sample mean is \(12\) and the usual unbiased sample variance, computed with denominator \(n-1\), is \(20\). Assume a gamma model with shape \(\alpha\) and scale \(\theta\) in the same measurement units. Find the method-of-moments estimates.
Method: convert the unbiased sample variance to the central moment with denominator \(n\). Since the reported variance is \(s^2=\sum(X_i-\bar X)^2/(n-1)\), the sum of squared deviations is
The central sample moment needed for matching is therefore
The two estimates are
The fitted mean is \(8(1.5)=12\), and the fitted variance is \(8(1.5)^2=8(2.25)=18\). These reproduce the sample mean and the denominator-\(n\) central moment. Using \(20\) directly in place of \(m_2\) would instead give \(144/20=7.2\) and \(20/12=1.6667\); those are not the requested method-of-moments estimates. The key is not that \(s^2\) is invalid, but that its denominator differs and it must be converted first.
Interpretation, Conditions, and Common Traps
The shape estimate is dimensionless because both \(\bar X^2\) and \(m_2\) have squared measurement units. The scale estimate has the same units as the observations. For example, if all observations are recorded in thousands of dollars, the estimated scale is also in thousands of dollars. Changing the measurement unit changes \(\hat{\theta}\) by the same conversion factor but leaves \(\hat{\alpha}\) unchanged.
These estimates require positive \(\bar X\) and positive \(m_2\). For a nonconstant sample of positive observations, both conditions hold. If all observations are identical, then \(m_2=0\); the displayed formulas do not give finite estimates for a gamma distribution with finite positive shape and scale. In that case the moment equations have no solution within the stated parameter space. Do not report an infinite shape estimate or a zero scale as an ordinary finite gamma fit.
- Scale is not rate. This tutorial uses scale \(\theta\), so the exponential term in the density is \(e^{-x/\theta}\). If a model is instead written with rate \(\lambda=1/\theta\), then the rate estimate corresponding to this fit is \(\hat{\lambda}=\bar X/m_2\), not \(m_2/\bar X\).
- Do not mix raw and central moments. If the raw second moment is supplied, subtract \(\bar X^2\) to obtain \(m_2\).
- Check the variance denominator. Method-of-moments matching uses \(m_2=\sum(X_i-\bar X)^2/n\). Convert a supplied unbiased sample variance before using the formulas.
- Check by substitution. The fitted mean should equal \(\bar X\), and the fitted variance should equal \(m_2\). A failure usually signals an algebra error, a parameterization mix-up, or a moment-calculation error.
Moment matching is useful because the estimates follow from two equations and can be calculated from compact sample summaries. It does not, by itself, establish that the gamma model is appropriate for a particular population. The model assumption and the estimates are separate parts of a statistical analysis.
Check Your Understanding
For each problem, use shape-scale parameterization and the method-of-moments convention explained above.
- A sample consists of \(2,2,4,4\). Find the shape and scale estimates. (Answer: \(\hat{\alpha}_{\mathrm{MOM}}=9,\ \hat{\theta}_{\mathrm{MOM}}=1/3\).)
- A sample has mean \(5\) and raw second moment \(31\), both calculated with denominator \(n\). Find the estimates. (Answer: \(m_2=6,\ \hat{\alpha}_{\mathrm{MOM}}=25/6,\ \hat{\theta}_{\mathrm{MOM}}=6/5\).)
- For \(n=8\), the sample mean is \(10\) and the sum of squared deviations from the mean is \(112\). Find the estimates. (Answer: \(m_2=14,\ \hat{\alpha}_{\mathrm{MOM}}=50/7,\ \hat{\theta}_{\mathrm{MOM}}=7/5\).)
- A sample of size \(6\) has mean \(4\) and unbiased sample variance \(6\). Convert to the moment with denominator \(n\), then estimate the parameters. (Answer: \(m_2=5,\ \hat{\alpha}_{\mathrm{MOM}}=16/5,\ \hat{\theta}_{\mathrm{MOM}}=5/4\).)
- Hypothetical claim amounts, recorded in thousands of dollars, have sample mean \(2\) and raw second moment \(6\). Find the estimates and state the unit of the scale estimate. (Answer: \(m_2=2,\ \hat{\alpha}_{\mathrm{MOM}}=2,\ \hat{\theta}_{\mathrm{MOM}}=1\) thousand dollars.)