Why Use a Log Link for a Gamma Mean?
Many actuarial outcomes are positive and right-skewed: a repair cost, a claim severity, or a positive payment amount. A Gamma regression model can describe such outcomes while relating their conditional mean to predictors. With a log link, the model first forms a linear predictor and then converts it to a positive fitted mean. The conversion is simple, but interpreting the response units and specifying the modeled quantity correctly require care.
This tutorial focuses on that conversion: how to move from the predictor to a fitted conditional mean, and how to check that the result makes sense. The treatment is aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.
The Gamma model is for positive continuous responses. Under the stated parameterization, its shape is \(1/\phi\) and its scale is \(\phi\mu_i\), giving mean \((1/\phi)(\phi\mu_i)=\mu_i\) and variance \((1/\phi)(\phi\mu_i)^2=\phi\mu_i^2\). Thus the variance is proportional to the square of the mean. A response that can be zero or negative does not meet the positive-response condition for this model as stated.
The coefficients \(\boldsymbol{\beta}\) are estimated from the data using a Gamma regression fit. For a new predictor vector, the fitted linear predictor is \(\widehat{\eta}=\mathbf{x}^{\mathsf T}\widehat{\boldsymbol{\beta}}\). The fitted conditional mean is obtained by applying the inverse link to that predictor. The particular fitting procedure for the coefficients is not needed to perform this prediction.
From the Linear Predictor to the Fitted Mean
The log link is \(g(\mu)=\log(\mu)\), so its inverse link is the exponential function. Applying that inverse to both sides of the model equation gives the fitted mean:
This calculation has two immediate checks. First, \(\exp(\widehat{\eta})\) is strictly positive for every finite predictor, as a Gamma mean must be. Second, the result is in the units in which the response was modeled. If the response was recorded in thousands of dollars, the fitted mean is in thousands of dollars until it is converted.
A crucial distinction is that the model specifies \(\log\{E[Y\mid\mathbf{x}]\}\) as a linear predictor. It does not specify that the conditional mean of \(\log(Y)\) is the same predictor. In general, \(E[\log(Y)\mid\mathbf{x}]\ne\log\{E[Y\mid\mathbf{x}]\}\). Therefore, fitting a Gamma model with a log link is not the same operation as taking logarithms of the observed responses and fitting an ordinary linear regression.
Worked Example: Predicting a Positive Amount in Thousands
A hypothetical insurer models positive repair costs in thousands of dollars. Its fitted Gamma log-link model is \(\log(\mu)=\log(2)+0.25x\), where \(x\) is a vehicle-age score. Find the fitted mean repair cost for a vehicle with \(x=2\), in dollars.
Method. Evaluate the linear predictor first, apply the inverse link, and then convert from thousands of dollars to dollars.
At \(x=2\), the fitted predictor is \(\widehat{\eta}=\log(2)+0.25(2)=\log(2)+0.50\).
The fitted mean in thousands of dollars is \(\widehat{\mu}=\exp\{\log(2)+0.50\}=2\exp(0.50)\). Using \(\exp(0.50)\approx1.6487212707\), this is approximately \(3.2974425414\) thousand dollars.
Convert units: \(3.2974425414(1{,}000)=\$3{,}297.4425414\). Rounded only at the final step to the nearest cent, the fitted mean is \$3,297.44.
Check and common mistake avoided. The model’s response unit is thousands of dollars, so the result must be multiplied by 1,000 before it is reported in dollars. The positive fitted amount is consistent with the Gamma mean requirement.
Using Several Predictors
A linear predictor can contain continuous predictors, indicator variables, or both. The calculation is the same: substitute the specified predictor values into the fitted linear expression, add all terms to obtain \(\widehat{\eta}\), and exponentiate once. For a categorical predictor represented by an indicator, use the indicator value defined by the model; do not substitute the category label itself.
For instance, if \(I=1\) denotes a particular category and \(I=0\) denotes the reference category, the fitted predictor includes the term \(\widehat{\beta}_I I\). A prediction for the reference category sets this term to zero. This is a matter of correctly constructing the predictor before applying the link.
Worked Example: Substituting a Continuous Predictor and an Indicator
A hypothetical model predicts positive claim severities measured in thousands of dollars. The fitted predictor is \(\widehat{\eta}=0.40+0.12x-0.25I\), where \(x\) is a risk score and \(I=1\) indicates a specified coverage category (with \(I=0\) as the reference category). Find the fitted mean in dollars when \(x=5\) and \(I=1\).
Method. Substitute each predictor value, evaluate the complete linear predictor, and exponentiate it.
The predictor is \(\widehat{\eta}=0.40+0.12(5)-0.25(1)=0.40+0.60-0.25=0.75\).
The fitted mean is \(\widehat{\mu}=\exp(0.75)\approx2.1170000166\) thousand dollars. In dollars, this is \(2.1170000166(1{,}000)=\$2{,}117.0000166\), which rounds to \$2,117.00 to the nearest cent.
Check and common mistake avoided. The indicator is 1 for the stated category, so its contribution is \(-0.25\), not zero. The computed fitted mean is positive and is reported in dollars only after converting from the model’s thousands-of-dollars scale.
Response Units and Coefficient Units
The logarithm in a log-link model is applied to a positive mean represented on a chosen response scale. In practical modeling, the response is recorded in a stated unit, such as dollars or thousands of dollars; prediction must respect that scale. A fitted mean of \(4.4755\) when the response is in thousands of dollars means about \(\$4{,}475.47\), not \(\$4.48\).
The linear predictor is dimensionless in the model’s numerical representation. Changing the response unit changes the numerical mean and therefore changes the intercept needed to describe the same amounts. Always establish the response unit from the model statement before presenting a prediction.
Worked Example: Converting a Fitted Mean Without Premature Rounding
A hypothetical model for positive equipment-repair costs uses thousands of dollars as its response unit. For a particular equipment profile, its fitted predictor is \(\widehat{\eta}=\log(3)+0.40\). Calculate the fitted mean in dollars to the nearest cent.
Method. Use the inverse link on the full predictor, retain precision through the unit conversion, and round the final dollar amount.
In thousands of dollars, \(\widehat{\mu}=\exp\{\log(3)+0.40\}=3\exp(0.40)\). Since \(\exp(0.40)\approx1.4918246976\), the fitted mean is approximately \(3(1.4918246976)=4.4754740928\) thousand dollars.
Converting before rounding gives \(4.4754740928(1{,}000)=\$4{,}475.4740928\). Rounded to the nearest cent, the fitted mean is \$4,475.47.
Check and common mistake avoided. The result is about \$4,475, which is consistent with a fitted mean of about 4.48 thousand dollars. Rounding \(\exp(0.40)\) to 1.4918 too early gives \(3(1.4918)=4.4754\) thousand, a less accurate intermediate result; multiplying the unrounded expression and rounding only the final dollar amount avoids that discrepancy.
What the Fitted Mean Does—and Does Not—Represent
The output \(\widehat{\mu}\) is a fitted conditional mean of the response for the specified predictor values. It is not an individual future observation, which can vary around that mean under the Gamma model. It is also not obtained by exponentiating an observed response or by exponentiating a regression prediction for \(\log(Y)\).
The model’s positive mean is guaranteed by the log link, but that does not by itself establish that the Gamma distribution is appropriate. The response should be positive and continuous, and the Gamma mean-variance structure and other modeling assumptions should be reasonable for the application. A positive fitted value cannot repair an unsuitable response distribution or an incorrectly specified predictor.
A common exam trap is to treat the link as a transformation of the observed data rather than as a relationship between the mean and predictors. For a Gamma log-link model, the operation is \(\widehat{\mu}=\exp(\widehat{\eta})\), where \(\widehat{\eta}\) comes from the fitted predictor. A second common trap is to report that result in the wrong response unit. Check both the model statement and the requested units before finalizing a prediction.
Check Your Understanding
For each problem, calculate the fitted conditional mean using the log link and respect the response unit stated.
- A Gamma model for a positive amount in dollars has fitted predictor \(\widehat{\eta}=0.30\). Find the fitted mean to the nearest cent. (Answer: \(\$1.35\))
- A model for positive costs in thousands of dollars has \(\widehat{\eta}=\log(1.5)+0.20x\). Find the fitted mean in dollars for \(x=3\), rounded to the nearest cent. (Answer: \(\$2,733.18\))
- A model for positive benefits in thousands of dollars has \(\widehat{\eta}=0.25+0.10a-0.05b\). Find the fitted mean in dollars when \(a=4\) and \(b=2\), rounded to the nearest cent. (Answer: \(\$1,733.25\))
- A model for positive settlement amounts in thousands of dollars has \(\widehat{\eta}=0.20+0.08x+0.15I\), where \(I\) is an indicator. Find the fitted mean in dollars for \(x=4\), \(I=1\), rounded to the nearest cent. (Answer: \(\$1,954.24\))
- A model for positive payments in thousands of dollars has \(\widehat{\eta}=0.10+0.20x\). For \(x=2\), state the fitted conditional mean in thousands of dollars and in dollars, both rounded appropriately. (Answer: \(1.6487\) thousand dollars, or \(\$1,648.72\))