Tutorials › Exam PA - Predictive Analytics › Tweedie GLMs For Compound Claim Costs

Exam PA · GLM Families and Model Construction · Tutorial 307 of 966

Tweedie GLMs For Compound Claim Costs

Understand the compound Poisson–gamma structure behind Tweedie claim costs, calculate its key quantities, and fit and interpret a Tweedie GLM in R.

Intermediate 13 min read

What You'll Learn

  • Identify when a Tweedie response is appropriate for aggregate claim costs.
  • Relate the variance power and dispersion to the response mean and variance.
  • Derive the compound Poisson–gamma parameters and the probability of zero cost.
  • Specify a log-link Tweedie GLM in R with a fixed variance power.
  • Interpret fitted means and avoid common errors involving zero outcomes and Tweedie parameters.

Why Use a Tweedie Model for Aggregate Claim Costs?

An aggregate cost over a fixed period can be zero when no claims occur, but positive costs can vary continuously. A Gamma model accommodates positive, right-skewed values but does not assign probability to an exact zero. A Tweedie model with variance power between 1 and 2 can accommodate both features in one response distribution.

This tutorial focuses on the compound Poisson–gamma form of the Tweedie distribution used for nonnegative aggregate costs. The setting is hypothetical: imagine that each observation is the total cost for one policy over the same coverage period. The model is appropriate when zero costs are possible and positive costs are treated as continuous. It is aligned with the SOA Exam PA (Predictive Analytics) syllabus.

Definition: For a Tweedie response \(Y\) with mean \(\mu>0\), dispersion \(\phi>0\), and variance power \(p\), the mean–variance relationship is \(\operatorname{Var}(Y)=\phi\mu^p\). When \(1<p<2\), the distribution has a point mass at zero and a continuous distribution over positive values. In its compound Poisson–gamma representation, \(Y\) is the sum of a Poisson-distributed number of independent Gamma amounts.

The variance power \(p\) controls how quickly the variance grows as the mean increases. In a GLM, \(\mu\) depends on predictors through the linear predictor, while \(\phi\) and \(p\) determine the variance relationship. For the compound Poisson–gamma case, \(p\) must be strictly between 1 and 2. The model also requires a positive mean; a log link is a common choice because it gives a positive fitted mean.

The Compound Poisson–Gamma Representation

Suppose the number of claims \(N\) in a policy period has a Poisson distribution with mean \(\lambda>0\). Given \(N\), let the claim amounts \(Z_1,\ldots,Z_N\) be independent and identically distributed Gamma random variables with shape \(\alpha>0\) and scale \(\theta>0\), independent of \(N\). Define the aggregate cost as \(Y=\sum_{j=1}^{N} Z_j\), with \(Y=0\) when \(N=0\). Here the Gamma scale parameterization has \(E[Z_j]=\alpha\theta\) and \(\operatorname{Var}(Z_j)=\alpha\theta^2\).

For a Tweedie distribution with \(1<p<2\), the compound Poisson–gamma parameters corresponding to mean \(\mu\), dispersion \(\phi\), and variance power \(p\) are:

$$ \lambda=\frac{\mu^{2-p}}{\phi(2-p)},\qquad \alpha=\frac{2-p}{p-1},\qquad \theta=\phi(p-1)\mu^{p-1}. $$

These equations show that the model represents the aggregate response through an implied claim frequency and claim-amount distribution. A Tweedie GLM directly models the aggregate mean; the compound representation explains its distributional properties, but does not mean that the fitted model separately estimates a frequency model and a severity model.

Worked Example: Recovering the Compound Parameters

For a hypothetical policy period, suppose the aggregate cost has Tweedie mean \(\mu=4\), dispersion \(\phi=2\), and variance power \(p=1.5\). Find the implied Poisson mean, Gamma shape and scale, variance of aggregate cost, and probability of zero cost.

Method. Substitute the specified Tweedie parameters into the compound Poisson–gamma parameterization. This avoids treating the aggregate cost as a single Gamma observation, which would not allow an exact zero.

First calculate the Poisson mean:

$$ \lambda =\frac{4^{2-1.5}}{2(2-1.5)} =\frac{\sqrt{4}}{1} =2. $$

Next calculate the Gamma parameters:

$$ \alpha=\frac{2-1.5}{1.5-1}=1,\qquad \theta=2(1.5-1)4^{1.5-1}=1\cdot 2=2. $$

Each claim amount therefore has mean \(\alpha\theta=1\cdot2=2\) and variance \(\alpha\theta^2=1\cdot 2^2=4\). The aggregate mean is \(\lambda\alpha\theta=2\cdot1\cdot2=4\), matching the specified \(\mu\). The Tweedie variance is:

$$ \operatorname{Var}(Y)=\phi\mu^p=2(4^{1.5})=2(8)=16. $$

The probability of no claims, and hence zero aggregate cost, is \(P(N=0)=e^{-\lambda}=e^{-2}=0.1353\), to four decimal places. The mean and variance checks agree with the given Tweedie parameters.

Why the Mean–Variance Formula Holds

The compound representation gives a direct justification for the Tweedie variance. For a random sum of independent claim amounts with a Poisson count, condition on the number of claims. The conditional expected aggregate is \(E[Y\mid N]=N E[Z]\), and the conditional variance is \(\operatorname{Var}(Y\mid N)=N\operatorname{Var}(Z)\). Applying the law of total variance gives:

$$ \begin{aligned} \operatorname{Var}(Y) &=E[\operatorname{Var}(Y\mid N)] +\operatorname{Var}(E[Y\mid N])\\ &=\lambda\operatorname{Var}(Z)+\lambda(E[Z])^2\\ &=\lambda E[Z^2]\\ &=\lambda\alpha(\alpha+1)\theta^2. \end{aligned} $$

The last equality uses the Gamma second moment \(E[Z^2]=\alpha(\alpha+1)\theta^2\). Also, \(E[Y]=\lambda\alpha\theta\). Substituting the compound parameters into these expressions gives the Tweedie mean and variance:

$$ \begin{aligned} E[Y] &=\frac{\mu^{2-p}}{\phi(2-p)} \frac{2-p}{p-1} \phi(p-1)\mu^{p-1} =\mu,\\ \operatorname{Var}(Y) &=\frac{\mu^{2-p}}{\phi(2-p)} \frac{2-p}{p-1} \left(\frac{1}{p-1}\right) \phi^2(p-1)^2\mu^{2p-2}\\ &=\phi\mu^p. \end{aligned} $$

The simplification in the variance uses \(\alpha+1=1/(p-1)\). The zero probability follows separately from the Poisson count: because each Gamma amount is strictly positive, \(Y=0\) exactly when \(N=0\). Thus \(P(Y=0)=e^{-\lambda}\). This relationship applies to the compound Poisson–gamma case \(1<p<2\), not to every Tweedie variance power.

Fitting a Tweedie GLM in R

In a Tweedie GLM, the conditional mean for observation \(i\) is linked to its predictors. With a log link, the model is \(\log(\mu_i)=\eta_i=\beta_0+\beta_1x_{i1}+\cdots+\beta_kx_{ik}\), so \(\mu_i=\exp(\eta_i)>0\). The response should be the aggregate cost for the exposure period represented by each row, including rows with zero cost. For this tutorial’s simple setup, assume every row represents the same exposure period.

The following code uses the statmod package. The variance power is set to 1.5, and link.power = 0 requests a log link. The chosen power is fixed for this fit; it is not automatically estimated as a regression coefficient.

$$ \operatorname{Var}(Y_i\mid x_i)=\phi\mu_i^{1.5}. $$

Assume a data frame called claims contains a nonnegative numeric response aggregate_cost, a categorical predictor region, and a numeric predictor vehicle_age. A suitable fit is:

1
Load the family implementation.
Use the Tweedie family function from statmod, with a variance power strictly between 1 and 2.
2
Fit the mean model.
Include the zero-cost rows and specify predictors that describe the aggregate mean.
3
Interpret predictions on the response scale.
The fitted link-scale value is a log mean; exponentiating it returns the fitted aggregate cost mean.

$$ \texttt{library(statmod)}\\ \texttt{fit <- glm(aggregate\_cost \textasciitilde{} region + vehicle\_age,}\\ \texttt{ data = claims,}\\ \texttt{ family = statmod::tweedie(var.power = 1.5, link.power = 0))} $$

The estimated regression coefficients describe changes in the log of the conditional mean. The fitted mean is positive, while the observed response can be zero. In this model, the dispersion \(\phi\) controls the variance after accounting for the mean and chosen power; it is not the same quantity as the regression intercept or the Poisson mean \(\lambda\).

Choosing \(p\) is a modeling decision. A value such as 1.5 is often used to illustrate the family, but it is not a universal default justified for every dataset. In practice, the value should be supported by the analysis, and conclusions can be checked for sensitivity to plausible powers. The code above fits the GLM conditional on the specified value of \(p\).

Worked Example: Predicting Mean Aggregate Cost From a Fitted GLM

Suppose a Tweedie GLM with \(p=1.5\) and a log link has fitted coefficients \(\hat{\beta}_0=\log(600)\), \(\hat{\beta}_1=0.25\) for an indicator \(x_1\), and \(\hat{\beta}_2=-0.15\) for a numeric predictor \(x_2\). Find the predicted mean aggregate cost for a hypothetical policy with \(x_1=1\) and \(x_2=1\), then compare it with the baseline \(x_1=x_2=0\).

Method. Calculate the linear predictor, then apply the inverse log link. This distinguishes a fitted mean from an individual observed cost.

For the specified policy:

$$ \hat{\eta} =\log(600)+0.25(1)-0.15(1) =\log(600)+0.10. $$

Therefore the fitted conditional mean is:

$$ \hat{\mu}=\exp(\hat{\eta}) =600e^{0.10} =600(1.105170\ldots) =663.10. $$

The baseline has \(\hat{\eta}=\log(600)\), so its fitted mean is \(600\). The policy’s predicted mean is \(663.10-600=\$63.10\) higher, or \(e^{0.10}-1=0.10517\ldots\), approximately 10.52% higher. The calculation checks because the log-link predictor changes by exactly 0.10 and the mean is multiplied by \(e^{0.10}\). The common mistake is to report \(0.10\) as a dollar increase; it is a change on the log-mean scale.

How Predictors Affect the Implied Zero Probability

With fixed \(p\) and \(\phi\), changing the fitted mean changes the implied Poisson rate and Gamma scale. In particular, \(\lambda=\mu^{2-p}/\{\phi(2-p)\}\), so the probability of zero cost is determined by the fitted mean as well as the variance power and dispersion. A Tweedie GLM does not separately fit a zero-probability model: its compound representation ties the zero probability to the same parameters that determine the aggregate distribution.

Worked Example: Comparing Two Risk Levels

Consider two hypothetical policy groups with the same dispersion \(\phi=2\) and variance power \(p=1.5\), but fitted aggregate means of \(\mu=25\) and \(\mu=100\). For each group, calculate the implied Poisson mean, Gamma scale, aggregate variance, and probability of zero cost.

Method. Apply the compound parameterization to each mean. This avoids assuming that quadrupling the mean simply quadruples every component of the aggregate distribution.

For \(\mu=25\):

$$ \lambda=\frac{\sqrt{25}}{2(0.5)}=5,\qquad \alpha=1,\qquad \theta=2(0.5)\sqrt{25}=5. $$

The implied mean is \(5\cdot1\cdot5=25\). Its variance is \(\phi\mu^p=2(25^{1.5})=2(125)=250\), and its zero probability is \(e^{-5}=0.0067\) to four decimal places.

For \(\mu=100\):

$$ \lambda=\frac{\sqrt{100}}{2(0.5)}=10,\qquad \alpha=1,\qquad \theta=2(0.5)\sqrt{100}=10. $$

The implied mean is \(10\cdot1\cdot10=100\). Its variance is \(\phi\mu^p=2(100^{1.5})=2(1{,}000)=2{,}000\), and its zero probability is \(e^{-10}=0.0000454\), or 0.0000 to four decimal places. The higher-mean group has twice the implied Poisson rate and twice the Gamma scale; the shape remains 1. Both parameter sets reproduce their specified means and variances.

Common Mistakes and Model Boundaries

  • Dropping the zero observations. The zero values are part of the aggregate-cost response and contain information about the distribution. Removing them changes the modeled population and no longer fits the stated Tweedie response.
  • Using a Gamma response for costs that include exact zeros. A Gamma distribution has positive support and does not assign probability to zero. A Tweedie model with \(1<p<2\) can represent both zero and continuous positive outcomes.
  • Confusing \(\phi\) with \(\lambda\). The dispersion \(\phi\) helps determine the mean–variance relationship; \(\lambda\) is the implied Poisson mean in the compound representation. They are not interchangeable.
  • Using an invalid variance power for this representation. The compound Poisson–gamma form requires \(1<p<2\). A value outside this interval does not have the zero-plus-continuous-positive interpretation established here.
  • Ignoring the response’s measurement structure. The stated GLM treats each response as aggregate cost for a defined period. If rows represent different exposure amounts, the response and model specification must account for that difference rather than silently treating unlike periods as equivalent.

The model is not a universal description of every cost variable. It relies on nonnegative outcomes, an appropriate mean structure, and a variance that is reasonably represented by \(\phi\mu^p\). It may be unsuitable when positive costs are intrinsically discrete, when negative outcomes occur, or when the relationship between predictors and mean is misspecified. A good fit of the mean alone does not establish that every distributional assumption is appropriate.

Key takeaway: A Tweedie GLM with \(1<p<2\) models nonnegative aggregate costs through a mean–variance relationship and has a compound Poisson–gamma interpretation. Include zero outcomes, state the variance power used, and interpret log-link coefficients through their effect on the fitted mean.

Check Your Understanding

Work through each problem using the compound parameterization and log-link interpretation above.

  1. A hypothetical Tweedie cost has \(\mu=9\), \(\phi=1\), and \(p=1.5\). Find \(\lambda\), \(\alpha\), \(\theta\), and the probability of zero cost. (Answer: \(\lambda=6,\ \alpha=1,\ \theta=1.5,\ P(Y=0)=e^{-6}=0.0025\).)
  2. A cost response has \(\mu=16\), \(\phi=2\), and \(p=1.5\). Calculate its Tweedie variance and implied zero probability. (Answer: \(\operatorname{Var}(Y)=128,\ P(Y=0)=e^{-4}=0.0183\).)
  3. A fitted log-link Tweedie model has coefficients \(\hat{\beta}_0=\log(300)\), \(\hat{\beta}_1=0.20\), and \(\hat{\beta}_2=-0.10\). For a risk with \(x_1=1\) and \(x_2=2\), calculate the predicted mean. (Answer: \(\hat{\eta}=\log(300)\), so \(\hat{\mu}=300\).)
  4. For a hypothetical response with \(\mu=36\), \(\phi=0.5\), and \(p=1.5\), calculate the implied Poisson mean, Gamma shape and scale, and aggregate variance. (Answer: \(\lambda=24,\ \alpha=1,\ \theta=1.5,\ \operatorname{Var}(Y)=108\).)
  5. Write the R family specification for a Tweedie GLM with variance power 1.6 and a log link. State whether zero aggregate costs should be omitted. (Answer: statmod::tweedie(var.power = 1.6, link.power = 0); retain the zero-cost responses.)
Clinical Biostats