Skip to content

Gamma and Tweedie regression

Model positive severity or zero-inclusive aggregate costs with Gamma and Tweedie GLMs; distinguish variance power, log-link means and exposure weighting.

Gamma and Tweedie regression are generalised linear models for outcomes whose variability grows with their conditional mean. Gamma regression models strictly positive continuous responses, such as claim severity conditional on a claim occurring. Tweedie regression with power between one and two can model aggregate claim cost, including periods with no claims. Choosing between them changes which outcomes the model can explain, even when both use the same positive mean prediction.

For a response YiY_i, predictors xi\mathbf{x}_i and unit observation weights, write

μi=E[Yi∣xi],log⁡μi=β0+xi⊤β,Var(Yi∣xi)=ϕμip.\mu_i=\mathbb{E}[Y_i\mid\mathbf{x}_i],\qquad \log\mu_i=\beta_0+\mathbf{x}_i^\top\boldsymbol\beta,\qquad \text{Var}(Y_i\mid\mathbf{x}_i)=\phi\mu_i^p.
Here ϕ>0\phi>0 is dispersion. The log link makes μi\mu_i positive and gives multiplicative effects: a one-unit increase in predictor xjx_j multiplies the mean by eβje^{\beta_j}, holding everything else fixed. It links the mean, rather than fitting a regression to observed log⁡Yi\log Y_i. The log link is a choice; it is not the canonical link for Gamma regression. Software defaults differ: statsmodels' Gamma documentation specifies an inverse default and explicitly permits log.
Response familyPowerPossible realised responsesTypical cost target
Gamma distributionp=2p=2Strictly positive continuous valuesSeverity among positive claims
Compound Poisson–Gamma Tweedie1<p<21<p<2Zero plus positive continuous valuesTotal cost including no-claim observations
Tweedie is a wider family; this article focuses on the cost-modelling range 1<p<21<p<2, with Gamma at p=2p=2. A positive fitted mean does not prevent the first model from rejecting exact zeros or the second from assigning them probability. Neither row is a model for negative net P&L; the second is not a count-only distribution. R's official Tweedie documentation describes this support distinction.

The zero comes from a random number of costs

At fixed predictors, a Tweedie response in this range has a compound Poisson representation:
Y=∑k=1NZk,N∼Poisson(λ),Zk∼Gamma⁡(a,b).Y=\sum_{k=1}^{N}Z_k,\qquad N\sim\text{Poisson}(\lambda),\qquad Z_k\sim\operatorname{Gamma}(a,b).
The severities are independent and identically distributed, independent of NN; bb is scale, not rate. An empty sum is zero. Because each severity is positive, Y=0Y=0 exactly when N=0N=0, giving P(Y=0)=e−λ\mathbb{P}(Y=0)=e^{-\lambda}. Conditional on a positive count, the sum is continuous and positive. The SAS/STAT derivation connects this construction to the mean–dispersion parameters.

This differs from arbitrarily adding a separate zero-inflation probability: the Tweedie zero probability is tied to its distributional parameters. A dataset's zero frequency and positive-cost shape therefore both matter when checking the model. A Gamma severity regression alone also leaves claim frequency unresolved.

One mean, two variance specifications

Consider a fictional cost model at one unit of exposure, with mean 1010 currency units. Specify numerical dispersion 0.20.2 separately in each family. Then
Gamma:Var(Y)=0.2(10)2=20,Tweedie, p=1.5:Var(Y)=0.2(10)1.5≈6.3245553203.\begin{aligned} \text{Gamma:}\quad &\text{Var}(Y)=0.2(10)^2=20,\\ \text{Tweedie, }p=1.5:\quad &\text{Var}(Y)=0.2(10)^{1.5}\approx6.3245553203. \end{aligned}
Both variances have units of currency squared. These stipulated values illustrate the variance powers, not a model ranking. If the response has currency units, ϕ\phi has units of currency to the power 2−p2-p: dimensionless for Gamma and square-root currency for p=1.5p=1.5. Equal numerical dispersions are not equal physical quantities across these powers. Each model's dispersion must be estimated under its own specification.
As an independent check, the Gamma example has shape 1/ϕ=51/\phi=5 and scale ϕμ=2\phi\mu=2, yielding variance 5(2)2=205(2)^2=20. These are the usual shape–scale Gamma moments. The Tweedie example can instead be built with λ=1010\lambda=10\sqrt{10}, a=1a=1 and b=10/10b=\sqrt{10}/10. Its random-sum variance is λE[Z2]=λ 2b2=210\lambda\mathbb{E}[Z^2]=\lambda\,2b^2=2\sqrt{10}, agreeing with 6.32455532036.3245553203.

Exposure changes the total, and needs a variance convention

Let ei>0e_i>0 denote exposure relative to a chosen unit, and mim_i the expected cost per unit exposure. For an aggregate response SiS_i, a proportional mean model is

log⁡E[Si∣xi,ei]=log⁡ei+β0+xi⊤β,E[Si∣xi,ei]=eimi.\log\mathbb{E}[S_i\mid\mathbf{x}_i,e_i] =\log e_i+\beta_0+\mathbf{x}_i^\top\boldsymbol\beta, \qquad \mathbb{E}[S_i\mid\mathbf{x}_i,e_i]=e_i m_i.
The known log⁡ei\log e_i is an offset, whose coefficient is fixed at one. At the same predictors, mi=10m_i=10 gives expected totals of 1010 at exposure one and 2020 at exposure two. This assumes the modelled cost rate persists across the longer exposure. The official GLM documentation states how log exposure enters the predictor.
Fictional mean model: aggregate expected cost is 10 at exposure one and 20 at exposure two. Support schematic: Gamma permits positive continuous responses only; a Tweedie with power between one and two adds a probability mass at zero.
Fictional mean model: aggregate expected cost is 10 at exposure one and 20 at exposure two. Support schematic: Gamma permits positive continuous responses only; a Tweedie with power between one and two adds a probability mass at zero.
Original specified mean model and support schematic. The support lines show possible responses, not probability densities or the size of the zero mass.
The offset alone says nothing about how variance aggregates. Under independent, homogeneous additive exposure increments with unit-exposure variance ϕmip\phi m_i^p,
Var(Si∣xi,ei)=eiϕmip,Var(Si/ei∣xi,ei)=ϕmipei.\text{Var}(S_i\mid\mathbf{x}_i,e_i)=e_i\phi m_i^p, \qquad \text{Var}(S_i/e_i\mid\mathbf{x}_i,e_i)=\frac{\phi m_i^p}{e_i}.
Thus a rate response Si/eiS_i/e_i has mean mim_i and inverse-exposure dispersion. An implementation using the convention Var(Yi)=ϕV(μi)/wi\text{Var}(Y_i)=\phi V(\mu_i)/w_i represents this with variance weight wi=eiw_i=e_i, rather than merely repeating the row. Equivalently, for an aggregate response with mean eimie_i m_i, effective dispersion is ϕei1−p\phi e_i^{1-p}. Holding aggregate dispersion constant while adding an offset specifies a different variance model. Smyth and Jørgensen (2002), §2, formulate costs per unit risk with exposure in the variance denominator. This convention requires its independence and homogeneity assumptions; it is not a universal law for pooled portfolios with shared shocks or changing risk mix.
For the underlying GLM construction, The Exponential Family and Generalized Linear Models develops canonical-link Bernoulli and Gaussian examples. A public preview is available; the full lesson requires membership. The log-linked Gamma model here illustrates the broader choice of a noncanonical link.

Sources

Last updated
  • generalised linear models
  • gamma regression
  • tweedie regression
  • aggregate cost
  • exposure offset
  • dispersion
← Back to the glossaryBack to top ↑