Tutorials › Generalized Linear Models › Gamma Identity-Link Regression

Gamma Response Models · Tutorial 578 of 981

Gamma Identity-Link Regression

Learn how identity-link gamma regression models the mean, how its coefficient score follows from the likelihood, and how to check the model’s positive-mean requirement.

Intermediate 10 min read

What You'll Learn

  • Specify the gamma identity-link mean using a linear predictor
  • State the parameter and data conditions required for positive fitted means
  • Derive the coefficient score from the gamma log-likelihood
  • Explain why the score equations are not ordinary least squares equations
  • Check proposed coefficients over finite and continuous covariate ranges

Identity-Link Gamma Regression

A gamma response is positive and often has variability that grows with its mean. Gamma regression models that relationship through a mean and variance structure; the link determines how the mean depends on the covariates. With an identity link, the mean itself is linear in the covariates. This gives a direct mean model, but also imposes an essential restriction: every fitted mean must be positive.

We derive the mean specification and coefficient score from the gamma likelihood, then use numerical examples to check the score and the positive-mean condition. The latter check must cover the covariate values where the model is intended to apply, not just the observations used to fit it.

Model Specification and Parameter Space

Definition: For independent responses \(Y_1,\ldots,Y_n\), a gamma identity-link regression model has \(Y_i\sim\operatorname{Gamma}(1/\phi,\phi\mu_i)\), where the arguments denote shape and scale, \(\phi>0\) is the dispersion parameter, and \(\mu_i=E[Y_i\mid \mathbf{x}_i]=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}>0\). Here \(\mathbf{x}_i\) is the \(p\)-component design vector, including an intercept when specified, and \(\boldsymbol{\beta}\) is the coefficient vector. Consequently, \(\operatorname{Var}(Y_i\mid\mathbf{x}_i)=\phi\mu_i^2\).

The density is defined for \(y_i>0\) and \(\mu_i>0\). In this parameterization its shape is \(1/\phi\) and its scale is \(\phi\mu_i\); hence its mean is \((1/\phi)(\phi\mu_i)=\mu_i\), and its variance is \((1/\phi)(\phi\mu_i)^2=\phi\mu_i^2\). The identity link is \(g(\mu)=\mu\), so the linear predictor equals the mean: \(\eta_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}=\mu_i\).

For observed design vectors, the allowable coefficient set is \(\mathcal{B}=\{\boldsymbol{\beta}:\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}>0\text{ for every }i\}\). If predictions are required over a covariate set \(\mathcal{C}\), the relevant condition is instead \(\mathbf{x}^\mathsf{T}\boldsymbol{\beta}>0\) for every \(\mathbf{x}\in\mathcal{C}\). A coefficient vector can satisfy the observed-data condition while failing over a wider prediction range.

Worked Example: Specifying a Gamma Mean Model

Suppose \(Y_i\) is a positive clinical measurement, \(x_i\) is a dose, and the proposed model is \(Y_i\mid x_i\sim\operatorname{Gamma}(1/\phi,\phi\mu_i)\), with \(\phi=0.25\) and \(\mu_i=\beta_0+\beta_1x_i\). Take \(\beta_0=2\), \(\beta_1=0.3\), and doses in the range \(0\leq x\leq10\).

The fitted mean is \(\mu(x)=2+0.3x\). Since the slope is positive, its minimum on the stated range is at \(x=0\), where \(\mu(0)=2\); its maximum is at \(x=10\), where \(\mu(10)=5\). Thus all means on the range are positive.

At \(x=4\), \(\mu(4)=2+0.3(4)=3.2\). The gamma shape is \(1/\phi=4\), and the scale is \(\phi\mu=0.25(3.2)=0.8\). The conditional variance is \(\phi\mu^2=0.25(3.2)^2=2.56\). The identity link specifies the mean, not a normal response: the response remains gamma distributed.

Deriving the Coefficient Score

For fixed \(\phi\), the gamma density for observation \(i\) is \[ f(y_i\mid\mu_i,\phi)= \frac{y_i^{1/\phi-1}\exp\{-y_i/(\phi\mu_i)\}} {\Gamma(1/\phi)(\phi\mu_i)^{1/\phi}}, \qquad y_i>0,\ \mu_i>0. \] Independence makes the log-likelihood the sum of the individual log-densities. The terms that depend on \(\boldsymbol{\beta}\), with \(\mu_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\), are \[ \ell(\boldsymbol{\beta}) =\text{constant}-\frac{1}{\phi}\sum_{i=1}^n \left(\log\mu_i+\frac{y_i}{\mu_i}\right). \] The constant here may depend on the observed \(y_i\) and on fixed \(\phi\), but not on \(\boldsymbol{\beta}\).

Result: At any coefficient vector in the interior of the allowable parameter set, the coefficient score for fixed \(\phi\) is \[ \mathbf{U}(\boldsymbol{\beta}) =\frac{\partial\ell}{\partial\boldsymbol{\beta}} =\sum_{i=1}^n \mathbf{x}_i\frac{y_i-\mu_i}{\phi\mu_i^2}. \]

To derive it, differentiate one summand with respect to its mean: \[ \frac{\partial}{\partial\mu_i} \left[-\frac{1}{\phi}\left(\log\mu_i+\frac{y_i}{\mu_i}\right)\right] =-\frac{1}{\phi}\left(\frac{1}{\mu_i}-\frac{y_i}{\mu_i^2}\right) =\frac{y_i-\mu_i}{\phi\mu_i^2}. \] Since \(\partial\mu_i/\partial\boldsymbol{\beta}=\mathbf{x}_i\), the chain rule gives the stated contribution for observation \(i\); adding the contributions gives the score. An interior maximum of the likelihood must satisfy \(\mathbf{U}(\boldsymbol{\beta})=\mathbf{0}\). This is a necessary score equation, not a guarantee that a finite maximum exists or that a particular solution is a maximum. \(\square\)

The factor \(1/\mu_i^2\) matters: the score equations are not the ordinary least squares normal equations. Observations with different fitted means contribute differently, even if their residuals \(y_i-\mu_i\) are equal.

Worked Example: Evaluating the Coefficient Score

Consider three independent responses with \(Y_i\mid x_i\sim\operatorname{Gamma}(1/\phi,\phi\mu_i)\), \(\phi=0.5\), design vectors \(\mathbf{x}_i=(1,x_i)^\mathsf{T}\), doses \(x=(0,1,2)\), and observed values \(y=(2,3,5)\). Evaluate the score at the proposed coefficients \(\boldsymbol{\beta}=(1.5,1)^\mathsf{T}\).

The proposed means are \(\mu_i=1.5+x_i\), namely \(1.5,2.5,3.5\). All are positive, so the score is defined. The scalar multiplier of \(\mathbf{x}_i\) in each score contribution is \((y_i-\mu_i)/(0.5\mu_i^2)\). For \(i=1\), this is \((2-1.5)/(0.5(1.5)^2)=0.5/1.125=4/9\), giving contribution \((4/9,0)^\mathsf{T}\).

For \(i=2\), the multiplier is \((3-2.5)/(0.5(2.5)^2)=0.5/3.125=0.16\), giving contribution \((0.16,0.16)^\mathsf{T}\). For \(i=3\), it is \((5-3.5)/(0.5(3.5)^2)=1.5/6.125=12/49\), giving contribution \((12/49,24/49)^\mathsf{T}\).

Adding the contributions, \[ \mathbf{U}(\boldsymbol{\beta}) =\begin{pmatrix}4/9\\0\end{pmatrix} +\begin{pmatrix}0.16\\0.16\end{pmatrix} +\begin{pmatrix}12/49\\24/49\end{pmatrix} \approx \begin{pmatrix}0.8493\\0.6498\end{pmatrix}. \] The score is not zero, so these coefficients do not solve the interior likelihood score equations for this data set. This calculation alone does not identify the maximum; it checks the score at the proposed point.

Properties of the Score

The score’s conditional expectation is zero when the specified conditional mean is correct. This follows directly from the model mean and does not require the responses to be normally distributed.

Result: If the observations are independent, \(E[Y_i\mid\mathbf{x}_i]=\mu_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\), and \(\phi>0\), then, at any admissible fixed \(\boldsymbol{\beta}\), \(E[\mathbf{U}(\boldsymbol{\beta})\mid\mathbf{x}_1,\ldots,\mathbf{x}_n]=\mathbf{0}\).

Conditioning on the design vectors makes each \(\mathbf{x}_i\), \(\mu_i\), and \(\phi\) fixed. By linearity of conditional expectation, \[ E[\mathbf{U}(\boldsymbol{\beta})\mid\mathbf{x}_1,\ldots,\mathbf{x}_n] =\sum_{i=1}^n\mathbf{x}_i \frac{E[Y_i\mid\mathbf{x}_i]-\mu_i}{\phi\mu_i^2} =\sum_{i=1}^n\mathbf{x}_i\frac{\mu_i-\mu_i}{\phi\mu_i^2} =\mathbf{0}. \] Each denominator is defined because \(\phi>0\) and the model requires \(\mu_i>0\). \(\square\)

The conditional covariance matrix of the score also follows from the gamma variance. Independence makes the covariance of the sum equal to the sum of the individual covariance matrices. For each term, the covariance is \[ \operatorname{Cov}\left( \mathbf{x}_i\frac{Y_i-\mu_i}{\phi\mu_i^2} \middle|\mathbf{x}_i\right) =\frac{\mathbf{x}_i\mathbf{x}_i^\mathsf{T}}{\phi^2\mu_i^4} \operatorname{Var}(Y_i\mid\mathbf{x}_i) =\frac{\mathbf{x}_i\mathbf{x}_i^\mathsf{T}}{\phi\mu_i^2}. \] Therefore, the conditional score covariance is \(\sum_i\mathbf{x}_i\mathbf{x}_i^\mathsf{T}/(\phi\mu_i^2)\). This expression shows again that the score’s contributions depend on the fitted means as well as the residuals.

Checking Positivity Over a Covariate Range

For a single scalar covariate on a closed interval, the identity-link mean is linear, so its minimum occurs at an endpoint. Checking both endpoints is therefore enough to establish positivity throughout that interval. For multiple covariates, a range or set of combinations must be specified; checking each variable’s separate minimum and maximum without considering which combinations are possible may be insufficient. With a finite set of observed design rows, evaluate \(\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\) at every row.

Worked Example: Rejecting Coefficients That Fail on the Stated Range

Suppose \(Y\mid x\sim\operatorname{Gamma}(1/\phi,\phi\mu(x))\), \(\phi=0.4\), and \(\mu(x)=\beta_0+\beta_1x\) is intended for every dose \(0\leq x\leq8\). Consider the proposed coefficients \(\beta_0=4\), \(\beta_1=-0.6\).

The mean is \(\mu(x)=4-0.6x\). Because the slope is negative, the minimum on the interval is at \(x=8\): \(\mu(8)=4-0.6(8)=4-4.8=-0.8\). In fact, the mean reaches zero when \(4-0.6x=0\), or \(x=4/0.6=20/3\). Thus the proposed model has nonpositive means for \(x\geq20/3\), including part of the intended range. It is not a valid gamma mean model on that range.

For comparison, change the coefficients to \(\beta_0=5\), \(\beta_1=-0.5\). Now \(\mu(x)=5-0.5x\) decreases from \(5\) at \(x=0\) to \(1\) at \(x=8\). Both endpoint values are positive, so every mean on the interval is positive. Under these revised coefficients, the conditional variance at \(x=8\) is \(0.4(1)^2=0.4\). Checking only the intercept would not have detected the invalid original model; checking the full range does.

Common Pitfall

  • Assuming any linear predictor is an admissible gamma mean. A linear expression can be zero or negative. Check every observed fitted mean and, for predictions, the entire intended covariate range.
  • Treating the response as Gaussian because the link is identity. The link specifies how the conditional mean depends on covariates. The response distribution here is gamma, with variance \(\phi\mu_i^2\).
  • Using ordinary least squares score equations. The gamma coefficient score weights each residual by \(1/(\phi\mu_i^2)\). The ordinary least squares equations do not generally solve this score equation.
Key takeaway: Gamma identity-link regression sets \(\mu_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\), requires \(\mu_i>0\), and has coefficient score \(\sum_i\mathbf{x}_i(y_i-\mu_i)/(\phi\mu_i^2)\). A proposed model must satisfy the positivity condition over the covariate values where it will be used.

Check Your Understanding

Use the model definitions and score derived above to answer these questions.

  1. For a gamma identity-link model, state the conditional mean and variance in terms of \(\mu_i\) and \(\phi\).
  2. With \(\mu(x)=3+0.4x\) on \(0\leq x\leq5\), what are the endpoint means, and are all means on the interval positive?
  3. Why does a nonzero coefficient score at an admissible coefficient vector show that it is not an interior likelihood maximum?
  4. For a one-covariate model on a closed interval, why are endpoint checks sufficient for positivity of the fitted mean?
  5. Explain why the gamma identity-link coefficient score is not generally the ordinary least squares score.
Clinical Biostats