Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Profiling The Gamma Shape Parameter

Exam ASTAM · Likelihood for Complete Data · Tutorial 315 of 979

Profiling The Gamma Shape Parameter

Learn to remove the gamma rate from the likelihood and estimate the shape from the resulting profile equation.

Beginner 12 min read

What You'll Learn

  • Write the complete-data gamma log-likelihood using shape and rate parameters.
  • Substitute the score-equation estimate of the rate into the log-likelihood.
  • Derive the one-dimensional equation for the gamma shape estimate.
  • Understand when the shape equation has a unique finite solution.
  • Calculate profiled estimates and check the corresponding rate estimate.
  • Distinguish the maximum likelihood estimate from a method-of-moments estimate.

Why Profile the Gamma Likelihood?

A gamma severity model has two parameters: a shape and a rate. When both are unknown, the likelihood score equations are coupled. For complete positive observations, the rate can be estimated directly once the shape is specified. Substituting that rate estimate into the likelihood leaves just one equation in the shape. This reduction is called profiling.

This tutorial uses the shape-rate parameterization. In particular, the rate is not the scale: the mean is shape divided by rate. Assume \(X_1,\ldots,X_n\) are independent observations from the same gamma distribution, with no censoring or truncation.

Definition: For shape \(\alpha>0\) and rate \(\beta>0\), the gamma density is $$ f_X(x;\alpha,\beta)=\frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\beta x},\qquad x>0. $$ Here \(\Gamma(\alpha)\) is the gamma function. Under this parameterization, \(E[X]=\alpha/\beta\) and \(\operatorname{Var}(X)=\alpha/\beta^2\). The rate \(\beta\) has units reciprocal to those of the observations.

Deriving the Profile Equation

For complete observations \(x_1,\ldots,x_n>0\), define the arithmetic sample mean \(\bar{x}=\sum_i x_i/n\). Taking logarithms of the product of the densities gives the log-likelihood

$$ \ell(\alpha,\beta) =n\alpha\log\beta-n\log\Gamma(\alpha) +(\alpha-1)\sum_{i=1}^n\log x_i-\beta\sum_{i=1}^n x_i. $$

For a fixed \(\alpha\), differentiate with respect to \(\beta\) and set the score to zero:

$$ \frac{\partial\ell}{\partial\beta} =\frac{n\alpha}{\beta}-\sum_{i=1}^n x_i=0 \quad\Longrightarrow\quad \widehat{\beta}(\alpha)=\frac{n\alpha}{\sum_i x_i} =\frac{\alpha}{\bar{x}}. $$

This is the rate estimate conditional on a specified shape. Substituting it into the log-likelihood gives the profile log-likelihood, a function of \(\alpha\) alone:

$$ \ell_p(\alpha) =n\alpha\log\!\left(\frac{\alpha}{\bar{x}}\right) -n\log\Gamma(\alpha) +(\alpha-1)\sum_{i=1}^n\log x_i-n\alpha. $$

Let \(\psi(\alpha)=\frac{d}{d\alpha}\log\Gamma(\alpha)\), the digamma function. Differentiating the profile log-likelihood and setting its derivative to zero yields the shape equation.

Theorem: For a nonconstant complete sample from a gamma distribution, the maximum likelihood estimate \(\widehat{\alpha}\) is the positive solution of $$ \log\widehat{\alpha}-\psi(\widehat{\alpha}) =\log\bar{x}-\frac{1}{n}\sum_{i=1}^n\log x_i. $$ After finding \(\widehat{\alpha}\), estimate the rate by \(\widehat{\beta}=\widehat{\alpha}/\bar{x}\).

The right side measures the gap between the logarithm of the arithmetic mean and the mean of the logarithms. It is nonnegative: by the arithmetic-geometric mean inequality, \(\bar{x}\geq(\prod_i x_i)^{1/n}\), so taking logarithms gives the result. The gap is zero exactly when all observations are equal.

Why the Shape Solution Is Unique

The shape equation is generally solved with a numerical root finder. Its structure explains when a solution exists and why there is only one. Define \(g(\alpha)=\log\alpha-\psi(\alpha)\). Its derivative is

$$ g'(\alpha)=\frac{1}{\alpha}-\psi_1(\alpha), \qquad \psi_1(\alpha)=\sum_{k=0}^{\infty}\frac{1}{(\alpha+k)^2}. $$

The summand is positive and decreasing in \(k\), so its sum is greater than the integral of the same function from zero to infinity:

$$ \psi_1(\alpha)> \int_0^\infty\frac{dt}{(\alpha+t)^2} =\frac{1}{\alpha}. $$

Therefore \(g'(\alpha)<0\): the left side of the shape equation is strictly decreasing. It tends to infinity as \(\alpha\) tends to zero and to zero as \(\alpha\) tends to infinity. Consequently, each positive right side has exactly one positive root. This establishes a unique finite shape estimate for any nonconstant sample.

If all observations are identical, the right side is zero and there is no finite root. In this case, taking \(\beta=\alpha/\bar{x}\) while letting \(\alpha\) increase makes the fitted gamma distribution concentrate around the common observation. The likelihood increases without bound; the data do not produce a finite joint maximum likelihood estimate.

Profiling in Practice

The calculation has three main stages: summarize the observations, form the right side of the shape equation, and solve for its positive root. The rate is then recovered from the sample mean. The following examples show the full calculation and how to check the result.

1
Summarize the data.
Compute \(\bar{x}\) and the average of the logarithms, \(\frac{1}{n}\sum_i\log x_i\).
2
Form the shape target.
Calculate \(s=\log\bar{x}-\frac{1}{n}\sum_i\log x_i\).
3
Find the shape and rate.
Solve \(\log\alpha-\psi(\alpha)=s\), then use \(\widehat{\beta}=\widehat{\alpha}/\bar{x}\).
4
Check the fit calculation.
Substitute the estimated shape into the left side and confirm it agrees with \(s\), subject to numerical rounding.

Worked Example: Profiling a Gamma Severity Model

A hypothetical portfolio has three complete severity observations, measured in thousands of dollars: \(1,2,4\). Assume the observations are independent and identically distributed gamma losses with unknown shape \(\alpha\) and rate \(\beta\), where \(\beta\) is measured per thousand dollars. Find the maximum likelihood estimates. Method: profile out the rate. This avoids treating the two parameters as unrelated score equations.

Step 1: Calculate the sample summaries. The sum is \(1+2+4=7\), so \(\bar{x}=7/3\). The sum of logarithms is \(\log 1+\log 2+\log 4=\log 8\), and the average log is \((\log 8)/3=\log 2\).

Step 2: Form the shape target.

$$ s=\log(7/3)-\log 2 =\log(7/6) \approx 0.1541507. $$

Step 3: Solve for the shape. The equation is \(\log\alpha-\psi(\alpha)=0.1541507\). A numerical root finder gives \(\widehat{\alpha}\approx3.401\). For a check, the left side at \(\alpha=3.401\) is approximately \(0.1542\), agreeing with the target to the displayed precision.

Step 4: Recover the rate.

$$ \widehat{\beta} =\frac{3.401}{7/3} \approx 1.458 \quad\text{per thousand dollars}. $$

The fitted mean is \(\widehat{\alpha}/\widehat{\beta}\approx3.401/1.458\approx2.333\) thousand dollars, which agrees with the sample mean \(7/3\). The estimates are \(\widehat{\alpha}=3.401\) and \(\widehat{\beta}=1.458\) per thousand dollars, rounded to three decimal places.

Worked Example: A More Uneven Sample

A hypothetical review records three complete loss amounts, in thousands of dollars: \(1,1,4\). Assume an independent gamma model with unknown shape and rate. Estimate both parameters. Method: use the profile equation and then recover the rate. The trap to avoid is using a moment estimate for shape as though it were the maximum likelihood estimate.

Step 1: Calculate the summaries. The sample mean is \(\bar{x}=(1+1+4)/3=2\). The sum of logarithms is \(\log 1+\log 1+\log 4=\log4\), so the average log is \((\log4)/3\).

Step 2: Calculate the target.

$$ s=\log2-\frac{\log4}{3} \approx0.6931472-0.4620981 =0.2310491. $$

Step 3: Solve for shape and check. Solving \(\log\alpha-\psi(\alpha)=0.2310491\) gives \(\widehat{\alpha}\approx2.317\). Substitution gives \(\log(2.317)-\psi(2.317)\approx0.2310\), confirming the root to the displayed precision.

Step 4: Estimate rate.

$$ \widehat{\beta}=\frac{2.317}{2}=1.1585 \quad\text{per thousand dollars}. $$

Rounded to three decimal places, the estimates are \(\widehat{\alpha}=2.317\) and \(\widehat{\beta}=1.159\) per thousand dollars. The fitted mean \(2.317/1.1585=2.000\) thousand dollars matches the sample mean.

Worked Example: Effect of Changing Measurement Units

A hypothetical set of complete losses is \(2,4,8,16\) thousand dollars. Assume a common gamma distribution with unknown shape and rate. Estimate the parameters, and state what changes if the amounts are recorded in dollars instead. Method: profile using the thousand-dollar values first. The unit conversion trap is to leave the rate unchanged after changing the units.

Step 1: Find the summaries in thousands. The sample mean is \(\bar{x}=(2+4+8+16)/4=7.5\). The product is \(2\cdot4\cdot8\cdot16=1024=2^{10}\), so the average log is \((\log1024)/4=2.5\log2\approx1.7328680\).

Step 2: Calculate the target and solve.

$$ s=\log(7.5)-2.5\log2 \approx2.0149030-1.7328680 =0.2820351. $$

The positive root of \(\log\alpha-\psi(\alpha)=0.2820351\) is \(\widehat{\alpha}\approx1.923\). Substitution gives a left side of approximately \(0.2820\), a check against the target.

Step 3: Estimate the rate.

$$ \widehat{\beta}=\frac{1.923}{7.5} \approx0.2564 \quad\text{per thousand dollars}. $$

If all observations are instead expressed in dollars, the sample mean is \(7{,}500\), while the average log increases by \(\log 1000\). The difference \(s\) is unchanged, so the shape estimate remains \(1.923\). The rate becomes \(1.923/7{,}500\approx0.0002564\) per dollar, or \(0.2564\) per thousand dollars. Thus the shape is dimensionless, while the rate changes inversely with the measurement unit. Rounded to four significant figures, the thousand-dollar rate is \(0.2564\).

Common Mistake and Practical Interpretation

A tempting shortcut is to use the gamma moment relationship \(\alpha=E[X]^2/\operatorname{Var}(X)\) with sample summaries and call the result the maximum likelihood estimate. That relationship motivates a method-of-moments estimate; it is not the profiled likelihood equation. For the first example, the mean is \(7/3\). The variance calculated with divisor \(n\) is

$$ \frac{(1-7/3)^2+(2-7/3)^2+(4-7/3)^2}{3} =\frac{14/3}{3} =\frac{14}{9}. $$

Using the moment ratio would give \((7/3)^2/(14/9)=3.5\), not the profile maximum likelihood estimate \(3.401\). The correction is to use the gamma score equation for likelihood estimation. A moment estimate may be useful for initialization, but it is a different estimation method.

Another essential check is that the rate estimate is \(\widehat{\alpha}/\bar{x}\), not \(\bar{x}/\widehat{\alpha}\). The latter has the units of the observation, whereas a rate must have reciprocal units. Profiling is useful because it reduces a two-parameter likelihood problem to one scalar equation without discarding the rate: once shape is estimated, the rate follows directly.

Key takeaway: For nonconstant, complete, independent gamma observations, compute \(s=\log\bar{x}-\frac{1}{n}\sum_i\log x_i\), solve \(\log\alpha-\psi(\alpha)=s\) for the unique positive shape estimate, and then set \(\widehat{\beta}=\widehat{\alpha}/\bar{x}\). If all observations are identical, there is no finite joint gamma maximum likelihood estimate.

Check Your Understanding

For each problem, state the shape equation and use it as far as requested. Monetary measurements are hypothetical.

  1. A complete sample of losses, in thousands of dollars, is \(3,6,12\), modeled as independent gamma observations with unknown shape and rate. Use the profile equation to estimate shape and rate. (Answer: \(\widehat{\alpha}\approx3.401\), \(\widehat{\beta}\approx0.486\) per thousand dollars.)
  2. For complete observations \(2,4,8,16\), calculate the right side of the shape equation, then give the shape and rate estimates in the original thousand-dollar units. (Answer: \(s\approx0.2820\), \(\widehat{\alpha}\approx1.923\), and \(\widehat{\beta}\approx0.2564\) per thousand dollars.)
  3. A sample has \(n=3\), \(\bar{x}=5\), and \(\frac{1}{n}\sum_i\log x_i=\log 4\). Write its shape equation and the rate estimate in terms of the shape root. (Answer: \(\log\widehat{\alpha}-\psi(\widehat{\alpha})=\log(5/4)\approx0.2231\); \(\widehat{\beta}=\widehat{\alpha}/5\).)
  4. Four complete observations are all \(9\). What does the profile equation imply about the existence of finite maximum likelihood estimates? (Answer: \(s=0\), so there is no finite positive shape root; the likelihood is unbounded as \(\alpha\) increases with \(\beta=\alpha/9\).)
Clinical Biostats