HPCDM Procedure

Scenario Analysis

The distributions of loss frequency and loss severity often depend on exogenous variables (regressors). For example, the number of losses and the severity of each loss that an automobile insurance policyholder incurs might depend on the characteristics of the policyholder and the characteristics of the vehicle. When you fit frequency and severity models, you need to account for the effects of such regressors on the probability distributions of the counts and severity. The COUNTREG procedure enables you to model regression effects on the mean of the count distribution, and the SEVERITY procedure enables you to model regression effects on the scale parameter of the severity distribution. When you use these models to estimate the compound distribution model of the aggregate loss, you need to specify a set of values for all the regressors, which represents the state of the world for which the simulation is conducted. This is referred to as the what-if or scenario analysis.

Consider that you, as an automobile insurance company, have postulated that the distribution of the loss event frequency depends on five regressors (external factors): age of the policyholder, gender, type of car, annual miles driven, and policyholder’s education level. Further, the distribution of the severity of each loss depends on three regressors: type of car, safety rating of the car, and annual household income of the policyholder (which can be thought of as a proxy for the luxury level of the car). Note that the frequency model regressors and severity model regressors can be different, as illustrated in this example.

Let these regressors be recorded in the variables Age (scaled by a factor of 1/50), Gender (1: female, 2: male), CarType (1: sedan, 2: sport utility vehicle), AnnualMiles (scaled by a factor of 1/5,000), Education (1: high school graduate, 2: college graduate, 3: advanced degree holder), CarSafety (scaled to be between 0 and 1, the safest being 1), and Income (scaled by a factor of 1/100,000), respectively. Let the historical data about the number of losses that various policyholders incur in a year be recorded in the NumLoss variable of the Work.LossCounts data set, and let the severity of each loss be recorded in the LossAmount variable of the Work.Losses data set.

The following PROC COUNTREG step fits the count regression model and stores the fitted model information in the Work.CountregModel item store:

/* Fit negative binomial frequency model for the number of losses */
proc countreg data=losscounts;
   model numloss = age gender carType annualMiles education / dist=negbin;
   store work.countregmodel;
run;

You can examine the parameter estimates of the count model that are stored in the Work.CountregModel item store by submitting the following statements:

/* Examine the parameter estimates for the model in the item store */
proc countreg restore=work.countregmodel;
   show parameters;
run;

The "Parameter Estimates" table that is displayed by the SHOW statement is shown in Figure 5.

Figure 5: Parameter Estimates of the Count Regression Model

ITEM STORE CONTENTS: WORK.COUNTREGMODEL

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
Intercept10.9104790.09051510.06<.0001
age1-0.6268030.058547-10.71<.0001
gender11.0250340.03209931.93<.0001
carType10.6151650.03115319.75<.0001
annualMiles1-1.0102760.017512-57.69<.0001
education1-0.2802460.021677-12.93<.0001
_Alpha10.3184030.02009015.85<.0001


The following PROC SEVERITY step fits the severity scale regression models for all the common distributions that are predefined in PROC SEVERITY:

/* Fit severity models for the magnitude of losses */
proc severity data=losses plots=none outest=work.sevregest print=all;
   loss lossamount;
   scalemodel carType carSafety income;
   dist _predef_;
   nloptions maxiter=100;
run;

The comparison of fit statistics of various scale regression models is shown in Figure 6. The scale regression model that is based on the lognormal distribution is deemed the best-fitting model according to the likelihood-based statistics, whereas the scale regression model that is based on the generalized Pareto distribution (GPD) is deemed the best-fitting model according to the EDF-based statistics.

Figure 6: Severity Model Comparison

The SEVERITY Procedure

All Fit Statistics
Distribution-2 Log
Likelihood
AICAICCBICKSADCvM
Burr127231 127243 127243 127286 7.75407 224.47578 27.41346 
Exp128431 128439 128439 128467 6.13537 181.75649 12.33919 
Gamma128324 128334 128334 128370 7.54562 275.83377 24.59515 
Igauss127434 127444 127444 127480 6.15855 211.51200 17.70942 
Logn127062*127072*127072*127107*6.77687 212.70400 21.47945 
Pareto128166 128176 128176 128211 5.37453 110.53673 7.07119 
Gpd128166 128176 128176 128211 5.37453*110.53660*7.07116*
Weibull128429 128439 128439 128475 6.21268 190.73733 13.45425 
Note: The asterisk (*) marks the best model according to each column's criterion.


Now, you are ready to analyze the distribution of the aggregate loss that can be expected from a specific policyholder—for example, a 59-year-old male policyholder with an advanced degree who earns 159,870 and drives a sedan that has a very high safety rating about 11,474 miles annually. First, you need to encode and scale this information into the appropriate regressor variables of a data set. Let that data set be named Work.SinglePolicy, with an observation as shown in Figure 7.

Figure 7: Scenario Analysis Data for One Policyholder

agegendercarTypeannualMileseducationcarSafetyincome
1.18212.294830.995321.5987


Now, you can submit the following PROC HPCDM step to analyze the compound distribution of the aggregate loss that is incurred by the policyholder in the Work.SinglePolicy data set in a given year by using the frequency model from the Work.CountregModel item store and the two best severity models, lognormal and GPD, from the Work.SevRegEst data set:

/* Simulate the aggregate loss distribution for the scenario
   with single policyholder */
proc hpcdm data=singlePolicy nreplicates=10000 seed=13579 print=all
           countstore=work.countregmodel severityest=work.sevregest;
   severitymodel logn gpd;
   outsum out=onepolicysum mean stddev skew kurtosis median
         pctlpts=97.5 to 99.5 by 1;
run;

The displayed results from the preceding PROC HPCDM step are shown in Figure 8.

When you use a severity scale regression model, it is recommended that you verify the severity scale regressors that are used by PROC HPCDM by examining the Scale Model Regressors row of the "Compound Distribution Information" table. PROC HPCDM detects the severity regressors automatically by examining the variables in the SEVERITYEST= and DATA= data sets. If those data sets contain variables that you did not include in the SCALEMODEL statement in PROC SEVERITY, then such variables can be treated as severity regressors. One common mistake that can lead to this situation is to fit a severity model by using the BY statement and forget to specify the identical BY statement in the PROC HPCDM step; this can cause PROC HPCDM to treat BY variables as scale model regressors. In this example, Figure 8 confirms that the correct set of scale model regressors is detected.

Figure 8: Scenario Analysis Results for One Policyholder with Lognormal Severity Model

The HPCDM Procedure
Severity Model: Logn
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelLognormal Distribution
Scale Model RegressorscarType carSafety income
Count ModelNegBin(p=2) Model in Item Store WORK.COUNTREGMODEL

Sample Summary Statistics
Mean214.05031Median0
Standard Deviation436.27333Interquartile Range264.68948
Variance190334.4Minimum0
Skewness5.15057Maximum9005.2
Kurtosis50.23372Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75264.68948
95950.03355
97.51340.0
98.51682.8
991979.5
99.52664.5
Percentile Method = 5


The "Sample Summary Statistics" and "Sample Percentiles" tables in Figure 8 show estimates of the aggregate loss distribution for the lognormal severity model. The average expected loss is about 214, and the worst-case loss, if approximated by the 97.5th percentile, is about 1,340. The percentiles table shows that the distribution is highly skewed to the right; this is also confirmed by the skewness estimate. The median estimate of 0 can be interpreted in two ways. One way is to conclude that the policyholder will not incur any loss in 50% of the years during which he or she is insured. The other way is to conclude that 50% of policyholders who have the characteristics of this policyholder will not incur any loss in a given year. However, there is a 2.5% chance that the policyholder will incur a loss that exceeds 1,340 in any given year and a 0.5% chance that the policyholder will incur a loss that exceeds 2,665 in any given year.

If the aggregate loss sample is simulated by using the GPD severity model, then the results are as shown in Figure 9. The average and worst-case losses are 213 and 1,337, respectively. These estimates are very close to the values that are predicted by the lognormal severity model.

Figure 9: Scenario Analysis Results for One Policyholder with GPD Severity Model

The HPCDM Procedure
Severity Model: Gpd
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelGeneralized Pareto Distribution
Scale Model RegressorscarType carSafety income
Count ModelNegBin(p=2) Model in Item Store WORK.COUNTREGMODEL

Sample Summary Statistics
Mean212.54792Median0
Standard Deviation401.95332Interquartile Range275.99091
Variance161566.5Minimum0
Skewness3.46433Maximum5360.2
Kurtosis18.55938Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75275.99091
95977.06997
97.51337.4
98.51622.2
991867.4
99.52303.2
Percentile Method = 5


The scenario that you just analyzed contains only one policyholder. You can extend the scenario to include multiple policyholders. Let the Work.GroupOfPolicies data set record information about five different policyholders, as shown in Figure 10.

Figure 10: Scenario Analysis Data for Multiple Policyholders

policyholderIdagegendercarTypeannualMileseducationcarSafetyincome
11.18212.294830.995321.59870
20.66212.671820.864120.84459
30.64221.952810.864780.50177
40.46122.640220.270621.18870
50.62111.729410.328300.37694


The following PROC HPCDM step conducts a scenario analysis for the aggregate loss that is incurred by all five policyholders in the Work.GroupOfPolicies data set together in one year:

/* Simulate the aggregate loss distribution for the scenario
   with multiple policyholders */
proc hpcdm data=groupOfPolicies nreplicates=10000 seed=13579 print=all
           countstore=work.countregmodel severityest=work.sevregest
           plots=(conditionaldensity(rightq=0.95)) nperturbedSamples=50;
   severitymodel logn gpd;
   outsum out=multipolicysum mean stddev skew kurtosis median
         pctlpts=97.5 to 99.5 by 1;
run;

The preceding PROC HPCDM step conducts perturbation analysis by simulating 50 perturbed samples. The perturbation summary results for the lognormal severity model are shown in Figure 11, and the results for the GPD severity model are shown in Figure 12. If the severity of each loss follows the fitted lognormal distribution, then you can expect that the group of policyholders together incurs an average loss of 5,300 plus-or-minus 328 and a worst-case loss of 15,734 plus-or-minus 960 when you define the worst-case loss as the 97.5th percentile.

Figure 11: Perturbation Analysis of Losses from Multiple Policyholders with Lognormal Severity Model

The HPCDM Procedure
Severity Model: Logn
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelLognormal Distribution
Scale Model RegressorscarType carSafety income
Count ModelNegBin(p=2) Model in Item Store WORK.COUNTREGMODEL

Sample Perturbation Analysis
StatisticEstimateStandard
Error
Mean5299.8327.70569
Standard Deviation4151.9269.78790
Variance173112742254196.7
Skewness2.144141.24620
Kurtosis16.6529058.38318
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1194.2018728.77686
5742.0438159.84686
252379.0154.80380
504324.3272.87497
757113.4438.24370
9513101.5805.58237
97.515734.1960.35241
98.517746.71098.9
9919384.71189.9
99.522409.71433.0
Number of Perturbed Samples = 50
Size of Each Sample = 10000


If the severity of each loss follows the fitted GPD distribution, then you can expect an average loss of 5,236 plus-or-minus 365 and a worst-case loss of 14,992 plus-or-minus 1,014.

If you decide to use the 99.5th percentile to define the worst-case loss, then the worst-case loss is 22,410 plus-or-minus 1,433 for the lognormal severity model and 20,246 plus-or-minus 1,400 for the GPD severity model. The numbers for lognormal and GPD are well within two standard errors of each other, which indicates that the aggregate loss distribution is less sensitive to the choice of these two severity distributions in this particular example; you can use the results from either of them.

Figure 12: Perturbation Analysis of Losses from Multiple Policyholders with GPD Severity Model

The HPCDM Procedure
Severity Model: Gpd
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelGeneralized Pareto Distribution
Scale Model RegressorscarType carSafety income
Count ModelNegBin(p=2) Model in Item Store WORK.COUNTREGMODEL

Sample Perturbation Analysis
StatisticEstimateStandard
Error
Mean5235.5364.77905
Standard Deviation3894.0270.62630
Variance152365202107602.2
Skewness1.488250.24040
Kurtosis4.339156.27802
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1155.2955725.93762
5699.3726862.80951
252381.4173.33561
504367.2308.51028
757136.8498.42048
9512717.7883.48043
97.514991.81014.0
98.516657.11148.8
9917993.51235.1
99.520246.21399.7
Number of Perturbed Samples = 50
Size of Each Sample = 10000


The PLOTS=CONDITIONALDENSITY option that is used in the preceding PROC HPCDM step prepares the conditional density plots for the body and right-tail regions of the density function of the aggregate loss. The plots for the aggregate loss sample that is generated by using the lognormal severity model are shown in Figure 13. The plot on the left side is the plot of probability left-parenthesis upper Y vertical-bar upper Y less-than-or-equal-to 13,122 right-parenthesis, where the limit 13,122 is the 95th percentile as specified by the RIGHTQ=0.95 option. The plot on the right side is the plot of probability left-parenthesis upper Y vertical-bar upper Y greater-than 13,122 right-parenthesis, which helps you visualize the right-tail region of the density function. You can also request the plot of the left tail by specifying the LEFTQ= suboption of the CONDITIONALDENSITY option if you want to explore the details of the left tail region. Note that the conditional density plots are always produced by using the unperturbed sample.

Figure 13: Conditional Density Plots for the Aggregate Loss of Multiple Policyholders

Conditional Density Plots for the Aggregate Loss of Multiple Policyholders


Last updated: June 19, 2025