The CCDM 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 both the policyholder and 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 CNTSELECT procedure enables you to model regression effects on the mean of the count distribution, and the SEVSELECT 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.

Suppose 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, miles driven annually, 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, respectively, 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).

To illustrate, the following DATA steps simulate and record the historical data about the number of losses that various policyholders incur in a year in the variable NumLoss of the data table mycas.LossCounts, and the severity of each loss in the variable LossAmount of the data table mycas.Losses:

/* Simulate data for losses that several policyholders incur in a year */
data losses(keep=policyholderId age gender carType annualMiles
                 education carSafety income noloss lossamount);
   call streaminit(12345);
   array cx{5} age gender carType annualMiles education;
   array cbeta{6} _TEMPORARY_ (1 -0.75 1 0.6 -1 -0.25);

   array sx{3} carType carSafety income;
   array sbeta{4} _TEMPORARY_ (3.5 1.5 -0.8 0.6);

   alpha = 1/3; theta = 1/alpha;
   Sigma = 1;
   do policyholderId=1 to 5000;
      /* simulate policyholder and vehicle attributes */
      age = MAX(int(rand('NORMAL', 35, 15)),16)/50;

      if (rand('UNIFORM') < 0.5) then gender = 1; * female;
      else gender = 2; * male;

      if (rand('UNIFORM') < 0.7) then carType = 1; * sedan;
      else carType = 2; * SUV;

      annualMiles = MAX(1000, int(rand('NORMAL', 12000, 5000)))/5000;

      educationLevel = rand('UNIFORM');
      if (educationLevel < 0.5) then education = 1; *high school graduate;
      else if (educationLevel < 0.85) then education = 2; *college graduate;
      else education = 3; *advanced degree;

      carSafety = rand('UNIFORM'); /* scaled to be between 0 & 1 */

      income = MAX(15000,int(rand('NORMAL', education*30000, 50000)))/100000;

      /* simulate number of losses incurred by this policyholder */
      cxbeta = cbeta(1);
      do i=1 to dim(cx);
         cxbeta = cxbeta + cx(i) * cbeta(i+1);
      end;
      Mu = exp(cxbeta);
      p = theta/(Mu+theta);
      numloss = rand('NEGB',p,theta);

      /* simulate severity of each loss */
      if (numloss > 0) then do;
         noloss = 0;
         do iloss=1 to numloss;
            Mu = sbeta(1);
            do i=1 to dim(sx);
               Mu = Mu + sx(i) * sbeta(i+1);
            end;
            lossamount = exp(Mu) * rand('LOGNORMAL')**Sigma;
            output;
         end;
      end;
      else do;
         noloss = 1;
         lossamount = .;
         output;
      end;
   end;
run;

/* Aggregate number of annual loss events for each policyholder */
data losscounts(keep=age gender carType annualMiles education numloss);
   set losses;
   by policyholderId;
   retain numloss 0;
   if (noloss ne 1) then
      numloss = numloss + 1;
   if (last.policyholderId) then do;
      output;
      numloss = 0;
   end;
run;

/* Load data into the CAS server */
data mycas.losses;
  set losses;
run;
data mycas.losscounts;
  set losscounts;
run;

Note that the last two DATA steps in the previous program load the local SAS data sets Work.LossCounts and Work.Losses into the data tables mycas.LossCounts and mycas.Losses, respectively, in your CAS session that is associated with the mycas CAS engine libref.

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

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

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

/* Examine the parameter estimates for the model in the item store */
proc cntselect data=mycas.losscounts;
   viewstore / instore=mycas.countregmodel finalestimates;
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

The CNTSELECT Procedure
 
Model fit results restored from item store 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 SEVSELECT step fits the severity scale regression models for all the common distributions that are predefined in the procedure:

/* Fit severity models for the magnitude of losses */
proc sevselect data=mycas.losses outest=mycas.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 based on the lognormal distribution is deemed the best-fitting model according to the likelihood-based statistics, whereas the scale regression model based on the Pareto distribution is deemed the best-fitting model according to the statistics based on the empirical distribution function (EDF).

Figure 6: Severity Model Comparison

The SEVSELECT Procedure

All Fit Statistics
Distribution-2 Log
Likelihood
AICAICCSBCKSADCvM
Burr1272311272431272431272864.6646275.263619.17877
Exp1284311284391284391284673.6120161.226734.17008
Gamma1283241283341283341283704.4475792.646088.25474
Igauss1274341274441274441274803.6551771.245035.95287
Logn127062*127072*127072*127107*4.1316771.455667.20527
Pareto1281661281761281761282113.24411*37.34514*2.41164*
Gpd1281661281761281761282113.2441137.345272.41165
Weibull1284291284391284391284753.6563964.229304.54181
Asterisk (*) denotes the best model in the column.


Now, you are ready to analyze the distribution of the aggregate loss that can be expected from a specific policyholder. First, you need to encode and scale the policyholder’s information into the appropriate regressor variables of a data table. This table is called the scenario data table. Note that you need to follow the same encoding and scaling method for the regressor variables in the scenario data table as you use for the regressor variables in the input data tables of the SEVSELECT and CNTSELECT procedures. The following DATA steps create the scenario data table mycas.SinglePolicy, which contains a scenario that consists of a 59-year-old male policyholder who has an advanced degree, earns 159,870, and drives a sedan that has a very high safety rating about 11,474 miles annually:

/* Generate the scenario data table for single policyholder */
data singlePolicy(keep=age gender carType annualMiles
                       education carSafety income);
   age = 59/50;              * age scaled by 50;
   gender = 2;               * male;
   carType = 1;              * sedan;
   annualMiles = 11474/5000; * miles scaled by 5,000;
   education = 3;            * advanced degree;
   carSafety = 0.99532;      * car safety in the range (0,1);
   income = 159870/100000;   * annual income scaled by 100,000;
   output;
run;

/* Load data into the CAS server */
data mycas.singlePolicy;
  set singlePolicy;
run;

The following PROC CCDM step to analyzes the compound distribution of the aggregate loss that the policyholder in the scenario data table mycas.SinglePolicy incurs in a year by using the frequency model from the item store mycas.CountregModel and the two best severity models, lognormal and Pareto, from the data table mycas.SevRegEst:

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

The results from the preceding PROC CCDM step are shown in Figure 7.

When you use a severity scale regression model, the "Compound Distribution Information" table displays the severity scale regression effects that PROC CCDM uses. PROC CCDM detects the severity regression effects automatically by examining the metadata that PROC SEVSELECT stores in the SEVERITYEST= data table and verifies the existence of the individual regressors in the DATA= data table.

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

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

Compound Distribution Information
Severity ModelLognormal Distribution
Scale Model EffectscarSafety carType income
Count ModelNegBin(p=2) Model in Item Store COUNTREGMODEL

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

Sample Summary Statistics
Mean206.68795Median0
Standard Deviation412.86689Interquartile Range245.15277
Variance170459.1Minimum0
Skewness4.14952Maximum6395.5
Kurtosis27.91648Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75245.15277
95979.49178
97.51355.4
98.51719.2
991993.0
99.52438.6
Percentile Method = 5


The "Sample Summary Statistics" and "Sample Percentiles" tables in Figure 7 show estimates of the aggregate loss distribution for the lognormal severity model. The average expected loss is about 206.7, and the worst-case loss, if approximated by the 97.5th percentile, is about 1,355.4. 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,355.4 in any given year and a 0.5% chance that the policyholder will incur a loss that exceeds 2,438.6 in any given year.

If the aggregate loss sample is simulated by using the Pareto severity model, then the results are as shown in Figure 8. The average and worst-case losses are 205.3 and 1,359.7, respectively. These estimates are very close to the values that the lognormal severity model predicts.

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

The CCDM Procedure
 
Severity Model: Pareto
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelPareto Distribution
Scale Model EffectscarSafety carType income
Count ModelNegBin(p=2) Model in Item Store COUNTREGMODEL

The CCDM Procedure
 
Severity Model: Pareto
Count Model: NegBin(p=2)

Sample Summary Statistics
Mean205.32253Median0
Standard Deviation390.38856Interquartile Range254.28294
Variance152403.2Minimum0
Skewness3.18983Maximum4625.0
Kurtosis14.22054Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75254.28294
95999.32562
97.51359.7
98.51658.4
991855.1
99.52215.6
Percentile Method = 5


The scenario that you just analyzed contains only one policyholder. You can expand the scenario to include multiple policyholders. The following DATA step simulates the data table mycas.GroupOfPolicies, which records information about five different policyholders, as shown in Figure 9:

/* Generate the scenario data table for multiple policyholders */
data groupOfPolicies(keep=policyholderId age gender carType annualMiles
                          education carSafety income);
   call streaminit(67897);

   do policyholderId=1 to 5;
      age = MAX(int(rand('NORMAL', 35, 15)),16)/50;

      if (rand('UNIFORM') < 0.5) then gender = 1; * female;
      else gender = 2; * male;

      if (rand('UNIFORM') < 0.7) then carType = 1; * sedan;
      else carType = 2; * SUV;

      annualMiles = MAX(1000, int(rand('NORMAL', 12000, 5000)))/5000;

      educationLevel = rand('UNIFORM');
      if (educationLevel < 0.5) then education = 1; *high school graduate;
      else if (educationLevel < 0.85) then education = 2; *college graduate;
      else education = 3; *advanced degree;

      carSafety = rand('UNIFORM'); /* scaled to be between 0 & 1 */

      income = MAX(15000,int(rand('NORMAL', education*30000, 50000)))/100000;

      output;
   end;
run;

/* Load data into the CAS server */
data mycas.groupOfPolicies;
  set groupOfPolicies;
run;

Figure 9: 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 CCDM step conducts a scenario analysis for the aggregate loss that is incurred by all five policyholders in the data table mycas.GroupOfPolicies together in one year:

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

The preceding PROC CCDM step conducts perturbation analysis by simulating 50 perturbed samples. The perturbation summary results for the lognormal severity model are shown in Figure 10, and the results for the Pareto severity model are shown in Figure 11. 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,319 plus-or-minus 175 and a worst-case loss of 15,841 plus-or-minus 501 when you define the worst-case loss as the 97.5th percentile.

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

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

Compound Distribution Information
Severity ModelLognormal Distribution
Scale Model EffectscarSafety carType income
Count ModelNegBin(p=2) Model in Item Store COUNTREGMODEL

Sample Perturbation Analysis
StatisticEstimateStandard
Error
Mean5319.4175.09159
Standard Deviation4190.8142.93553
Variance175833361197596.0
Skewness2.092040.29198
Kurtosis10.246915.01699
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1198.8585825.46560
5748.4099249.07759
252380.2103.20610
504326.2160.64004
757137.5238.65458
9513179.6377.35981
9513179.6377.35981
97.515841.4500.94984
98.517871.7544.29623
9919579.2639.20323
99.522728.4917.34826
Number of Perturbed Samples = 50
Size of Each Sample = 10000


If the severity of each loss follows the fitted Pareto distribution, then you can expect an average loss of 5,251 plus-or-minus 168 and a worst-case loss of 15,091 plus-or-minus 458.

If you decide to use the 99.5th percentile to define the worst-case loss, then the worst-case loss is 22,728 plus-or-minus 917 for the lognormal severity model and 20,497 plus-or-minus 747 for the Pareto severity model. The numbers for lognormal and Pareto are well within one or 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 11: Perturbation Analysis of Losses from Multiple Policyholders with Pareto Severity Model

The CCDM Procedure
 
Severity Model: Pareto
Count Model: NegBin(p=2)

Compound Distribution Information
Severity ModelPareto Distribution
Scale Model EffectscarSafety carType income
Count ModelNegBin(p=2) Model in Item Store COUNTREGMODEL

Sample Perturbation Analysis
StatisticEstimateStandard
Error
Mean5251.1167.69834
Standard Deviation3921.6118.27373
Variance15392672921516.4
Skewness1.500200.09646
Kurtosis3.820730.94306
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1160.4272325.50486
5704.4546846.67739
252382.6101.04928
504369.0155.02402
757161.0229.22691
9512773.4364.41086
9512773.4364.41086
97.515091.8458.00124
98.516779.3525.18704
9918119.6599.56740
99.520496.9747.39377
Number of Perturbed Samples = 50
Size of Each Sample = 10000


The PLOTS=CONDITIONALDENSITY option that is used in the preceding PROC CCDM step creates 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 12. 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,104 right-parenthesis, where the limit 13,104 is the 95th percentile as specified by the RIGHTQ=0.95 suboption of the PLOTS=CONDITIONALDENSITY option. The plot on the right side is the plot of probability left-parenthesis upper Y vertical-bar upper Y greater-than 13,104 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 if you want to explore the details of the left tail region. The conditional density plots are always produced by using the unperturbed sample.

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

Conditional Density Plots for the Aggregate Loss of Multiple Policyholders


Last updated: January 27, 2023