The Tweedie distribution is often used in the insurance industry to explain the effect of independent variables (regressors) on the distribution of losses. PROC HPSEVERITY provides a predefined scaled Tweedie distribution (STWEEDIE) that enables you to model the regression effects on the scale parameter. The scale regression model has its own advantages such as the ability to easily account for inflation effects. This example illustrates how that model can be used to evaluate the effect of regressors on the mean of the Tweedie distribution, which is useful in problems such rate-making and pure premium modeling.
Assume a Tweedie process, whose mean is affected by regressors , as follows:
where represents the base value of the mean (you can think of as , where is the intercept). This model for the mean is identical to the popular generalized linear model for the mean with a logarithmic link function.
More interestingly, it parallels the model used by PROC HPSEVERITY for the scale parameter ,
where represents the base value of the scale parameter. As described in the section Tweedie Distributions, for the parameter range , the mean of the Tweedie distribution is given by
where is the Poisson mean parameter of the scaled Tweedie distribution. This relationship enables you to use the scale regression model to infer the effect of regressors on the mean of the distribution.
Let the data set Work.Test_Sevtw
contain a sample generated from a Tweedie distribution with dispersion parameter , index parameter , and the mean parameter that is affected by three regression variables x1
, x2
, and x3
as follows:
Thus, the population values of regression parameters are , , , and . You can find the code used to generate the sample in the PROC HPSEVERITY sample program hpseve04.sas
.
The following PROC HPSEVERITY step uses the sample in Work.Test_Sevtw
data set to estimate the parameters of the scale regression model for the predefined scaled Tweedie distribution (STWEEDIE)
with the dual quasi-Newton (QUANEW) optimization technique:
proc hpseverity data=test_sevtw outest=estw covout print=all; loss y; scalemodel x1-x3; dist stweedie; nloptions tech=quanew; run;
The dual quasi-Newton technique is used because it requires only the first-order derivatives of the objective function, and it is harder to compute reasonably accurate estimates of the second-order derivatives of Tweedie distribution’s PDF with respect to the parameters.
Some of the key results prepared by PROC HPSEVERITY are shown in Output 5.4.1 and Output 5.4.2. The distribution information and the convergence results are shown in Output 5.4.1.
Output 5.4.1: Convergence Results for the STWEEDIE Model with Regressors
Distribution Information | |
---|---|
Name | stweedie |
Description | Tweedie Distribution with Scale Parameter |
Distribution Parameters | 3 |
Regression Parameters | 3 |
Convergence Status |
---|
Convergence criterion (FCONV=2.220446E-16) satisfied. |
Optimization Summary | |
---|---|
Optimization Technique | Dual Quasi-Newton |
Iterations | 42 |
Function Calls | 218 |
Log Likelihood | -1044.3 |
The final parameter estimates of the STWEEDIE regression model are shown in Output 5.4.2. The estimate that is reported for the parameter Theta
is the estimate of the base value . The estimates of regression coefficients , , and are indicated by the rows of x1
, x2
, and x3
, respectively.
Output 5.4.2: Parameter Estimates for the STWEEDIE Model with Regressors
Parameter Estimates | ||||
---|---|---|---|---|
Parameter | Estimate | Standard Error |
t Value | Approx Pr > |t| |
Theta | 0.82888 | 0.26657 | 3.11 | 0.0021 |
Lambda | 16.57174 | 13.12083 | 1.26 | 0.2076 |
P | 1.75440 | 0.20187 | 8.69 | <.0001 |
x1 | 0.27970 | 0.09876 | 2.83 | 0.0049 |
x2 | -0.76715 | 0.10313 | -7.44 | <.0001 |
x3 | 3.03225 | 0.10142 | 29.90 | <.0001 |
If your goal is to explain the effect of regressors on the scale parameter, then the output displayed in Output 5.4.2 is sufficient. But, if you want to compute the effect of regressors on the mean of the distribution, then you need to do some postprocessing. Using the relationship between and , can be written in terms of the parameters of the STWEEDIE model as
This shows that the parameters are identical for the mean and the scale model, and the base value of the mean model is
The estimate of and the standard error associated with it can be computed by using the property of the functions of maximum likelihood estimators (MLE). If represents a totally differentiable function of parameters , then the MLE of has an asymptotic normal distribution with mean and covariance , where is the MLE of , is the estimate of covariance matrix of , and is the gradient vector of with respect to evaluated at . For , the function is . The gradient vector is
|
|
|
|
You can write a DATA step that implements these computations by using the parameter and covariance estimates prepared by PROC
HPSEVERITY step. The DATA step program is available in the sample program sevex04.sas
. The estimates of prepared by that program are shown in Output 5.4.3. These estimates and the estimates of as shown in Output 5.4.2 are reasonably close (that is, within one or two standard errors) to the parameters of the population from which the sample
in Work.Test_Sevtw
data set was drawn.
Output 5.4.3: Estimate of the Base Value Mu0 of the Mean Parameter
Parameter | Estimate | Standard Error |
t Value | Approx Pr > |t| |
---|---|---|---|---|
Mu0 | 4.47179 | 0.42225 | 10.5904 | 0 |
Another effect of using the scaled Tweedie distribution to model the regression effects is that the regressors also affect the variance of the Tweedie distribution. The variance is related to the mean as , where is the dispersion parameter. Using the relationship between the parameters TWEEDIE and STWEEDIE distributions as described in the section Tweedie Distributions, the regression model for the dispersion parameter is
|
|
|
|
Subsequently, the regression model for the variance is
|
|
|
|
In summary, PROC HPSEVERITY enables you to estimate regression effects on various parameters and statistics of the Tweedie model.