Choosing a Family for a Positive Response
Costs and durations are often strictly positive, and their variability may increase as their expected value increases. A model for a small medical cost, for example, need not have the same spread as a model for a large one. Family choice should therefore reflect both the response’s support and how its conditional variability and shape change across predictor values.
This tutorial compares three familiar continuous families. A Gaussian response can be a reasonable approximation when its spread is modest relative to its mean and residuals are approximately symmetric. The gamma and inverse-Gaussian families are defined on positive values and allow variance to grow with the conditional mean. Neither positivity nor right skew alone identifies the best family: diagnostics should be judged alongside the scientific purpose of the fitted mean and the observed residual patterns.
For clarity, the gamma parameterization used here has shape \(1/\phi\) and scale \(\phi\mu\). Its mean is \(\mu\) and variance is \(\phi\mu^2\). The inverse-Gaussian parameterization has mean \(\mu\) and shape parameter \(\lambda=\mu^2/\phi\); its variance is \(\mu^3/\lambda=\phi\mu^3\). The dispersion parameters have different units in these families, so their numerical values should not be compared directly across families.
What the Variance Functions Imply
A useful first comparison is the conditional coefficient of variation, defined as the conditional standard deviation divided by the conditional mean. This scale-free quantity describes how large the typical variation is relative to the expected response.
To verify the result, take the square root of the variance and divide by \(\mu\):
Substituting \(p=2\) gives \(\sqrt{\phi}\) for the gamma family, while \(p=3\) gives \(\sqrt{\phi\mu}\) for the inverse-Gaussian family. For a Gaussian response, \(\operatorname{Var}(Y\mid x)=\phi\), which corresponds to \(p=0\) and gives \(\sqrt{\phi}/\mu\). These are implications of the variance functions, not guarantees that any particular data set follows them.
The Gaussian support issue can also be stated exactly. If \(Y\mid x\sim N(\mu,\sigma^2)\), with \(\sigma>0\), then
where \(\Phi\) is the standard normal distribution function. The strict inequality follows because the standard normal density is positive everywhere and \(-\mu/\sigma\) is finite. Thus a Gaussian model assigns positive probability to negative responses at every finite positive mean and nonzero variance. Whether that probability is consequential depends on its size and on how predictions will be used.
Worked Example: Assessing Negative Gaussian Predictions
Suppose a fitted Gaussian model for a strictly positive duration gives conditional mean \(5\) hours and residual standard deviation \(4\) hours. Its probability of a negative duration is
\(\displaystyle P(Y\leq 0\mid x)=\Phi(-5/4)=\Phi(-1.25)\approx 0.1056.\)
About 10.6% of the model’s conditional distribution lies at or below zero, which is difficult to defend if predictions are meant to describe individual durations. A gamma model with the same mean and variance would require \(\phi=16/25=0.64\), since \(\phi\mu^2=16\). An inverse-Gaussian model with the same mean and variance would require \(\phi=16/125=0.128\), since \(\phi\mu^3=16\). Both alternatives have positive support, but matching the first two moments does not establish that either has the right residual shape or tail behavior.
Use Replicated Data to Examine Mean–Variance Growth
The variance function concerns variability around the conditional mean, not variation among individual fitted means. To assess it empirically, look for groups of observations with similar predictors, or use an appropriate diagnostic plot of residual variation against fitted means. When there are few or no replicates at comparable predictor values, the observed spread is harder to separate from changes in the mean structure.
Worked Example: A Gamma-Like Pattern in Repeated Costs
Suppose three comparable service groups each contain three positive costs, measured in the same units. Their observations are \((5,10,15)\), \((10,20,30)\), and \((20,40,60)\). For each group, calculate the sample mean and the usual sample variance, which divides the sum of squared deviations by \(3-1=2\).
For the first group, the mean is \(10\), and the sample variance is \(\{(5-10)^2+(10-10)^2+(15-10)^2\}/2=25\). For the second, the mean is \(20\), and the variance is \(\{(-10)^2+0^2+10^2\}/2=100\). For the third, the mean is \(40\), and the variance is \(\{(-20)^2+0^2+20^2\}/2=400\).
The ratios of sample variance to squared sample mean are \(25/100=0.25\), \(100/400=0.25\), and \(400/1600=0.25\). This pattern is consistent with the gamma variance relationship \(\operatorname{Var}(Y\mid x)=\phi\mu^2\) at \(\phi=0.25\). A constant-variance Gaussian model does not describe this pattern. The inverse-Gaussian ratios of variance to cubed mean are \(25/1000=0.025\), \(100/8000=0.0125\), and \(400/64000=0.00625\), so they are not constant as the inverse-Gaussian variance relationship would suggest. With only three observations per group, these calculations are suggestive rather than conclusive evidence about a family.
A family choice should also be checked against residual shape. For example, standardized Pearson residuals use the fitted variance function:
Here \(y_i\) is an observed response, \(\hat{\mu}_i\) is its fitted conditional mean, and \(\hat{\phi}\) is the estimated dispersion. Residuals can be examined against fitted means and predictors, and their skewness and tails compared with what the candidate family implies. A fan-shaped residual plot may indicate that the assumed variance growth is unsuitable; persistent asymmetry or tail discrepancies can point to a distributional mismatch. But residual patterns can also result from an inadequate mean structure or unmodeled structure in the data, so changing the family alone is not always the correction.
Worked Example: Comparing Residual Scales Across Means
Suppose a log-link model gives fitted mean durations of \(10\), \(20\), and \(40\) hours, and the corresponding observed durations are \(12\), \(30\), and \(35\) hours. Consider a gamma fit with \(\hat{\phi}=0.25\). Its fitted standard deviations are \(\sqrt{0.25(10^2)}=5\), \(\sqrt{0.25(20^2)}=10\), and \(\sqrt{0.25(40^2)}=20\) hours. The Pearson residuals are therefore \(2/5=0.4\), \(10/10=1\), and \(-5/20=-0.25\).
For an inverse-Gaussian fit with \(\hat{\phi}=0.025\) in the corresponding units, the fitted variances are \(0.025(10^3)=25\), \(0.025(20^3)=200\), and \(0.025(40^3)=1600\). The standard deviations are \(5\), \(\sqrt{200}\approx14.14\), and \(40\), giving residuals \(0.4\), \(10/\sqrt{200}\approx0.71\), and \(-5/40=-0.125\). The same observations thus have different standardized residuals because the families encode different variance growth. These three residuals alone cannot establish a winner; the full residual patterns and predictive behavior matter.
Keep the Mean Interpretation in View
For a log-link model, the conditional mean is \(\mu_i=\exp(x_i^\mathsf{T}\beta)\), so it is positive. Under either gamma or inverse-Gaussian sampling, this fitted value is the conditional arithmetic mean of the response. It is not the conditional mean of the log response. This distinction matters for cost and duration decisions that are stated in currency or time units: a predicted mean cost of \(2{,}000\) dollars refers to the expected cost on the original scale.
A useful family comparison holds the scientific mean structure as comparable as possible and then asks whether the candidate distributions describe support, conditional spread, residual shape, and predictive uncertainty plausibly. The earlier material on separating family choice from link choice is important here: an unsuitable link or mean structure should not be mistaken automatically for a wrong response family. A log link can produce positive fitted means for different families, while those families still make distinct assumptions about conditional variation and shape.
Worked Example: Interpreting Fitted Mean Costs
Let \(Y\) be a positive cost measured in thousands of dollars, and suppose a log-link model has \(\log(\mu_i)=\log(10)+x_i\log(2)\). For \(x_i=0,1,2\), the fitted means are
\(\displaystyle \hat{\mu}_i=\exp\{\log(10)+x_i\log(2)\}=10(2^{x_i}),\)
so they are \(10\), \(20\), and \(40\) thousand dollars. The coefficient on \(x_i\) says the modeled mean doubles for each one-unit increase in \(x_i\). If the response family is gamma, the variance at these means is \(\phi(10^2)\), \(\phi(20^2)\), and \(\phi(40^2)\). If it is inverse-Gaussian, it is \(\phi(10^3)\), \(\phi(20^3)\), and \(\phi(40^3)\), with its own dispersion parameter and units. The fitted means have the same arithmetic-mean interpretation in both models, but their implied uncertainty differs.
Common Mistakes and Practical Decisions
- Choosing a family from positivity alone. Positive support rules out neither family automatically. Examine variance growth, residual shape, and the prediction task as well.
- Assuming a Gaussian model is invalid whenever the response is positive. It assigns some probability to negative values, but that probability can be negligible relative to the application. Calculate or assess its practical size.
- Comparing dispersion estimates across families as though they had the same meaning. The gamma and inverse-Gaussian variance functions have different powers of \(\mu\), and their dispersion parameters have different units.
- Reading a log-link prediction as an average on the log scale. In a GLM with a log link, \(\exp(x_i^\mathsf{T}\beta)\) is the modeled conditional arithmetic mean on the response scale.
- Treating a few unusual residuals as decisive. Inspect the overall residual and predictive patterns, and consider whether the mean structure or unmodeled structure could be responsible.
Check Your Understanding
Use the variance functions and support properties to answer these questions.
- For a gamma model with mean \(\mu\) and dispersion \(\phi\), how does its conditional coefficient of variation change as \(\mu\) increases?
- A Gaussian duration model has conditional mean \(8\) and standard deviation \(2\). Write the probability it assigns to a nonpositive duration in terms of \(\Phi\).
- Repeated cost groups have sample variances that are roughly proportional to the square of their means. Which of the three variance functions is most consistent with that pattern, and why?
- Why can standardized Pearson residuals for the same observation differ under gamma and inverse-Gaussian fits?
- What is the response-scale interpretation of a fitted value from a log-link gamma GLM for cost?