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 mylib.LossCounts, and the severity of each loss in the variable LossAmount of the data table mylib.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 the data */
data mylib.losses;
  set losses;
run;
data mylib.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 mylib.LossCounts and mylib.Losses, respectively, in your CAS session that is associated with the mylib CAS engine libref.

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

/* Fit negative binomial frequency model for the number of losses */
proc cntselect data=mylib.losscounts store=mylib.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 mylib.CountregModel by submitting the following statements:

/* Examine the parameter estimates for the model in the item store */
proc cntselect data=mylib.losscounts;
   viewstore / instore=mylib.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=mylib.losses outest=mylib.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 mylib.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 the data */
data mylib.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 mylib.SinglePolicy incurs in a year by using the frequency model from the item store mylib.CountregModel and the two best severity models, lognormal and Pareto, from the data table mylib.SevRegEst:

/* Simulate the aggregate loss distribution for the scenario
   with single policyholder */
proc ccdm data=mylib.singlePolicy nreplicates=10000 seed=13579 print=all
          countstore=mylib.countregmodel severityest=mylib.sevregest;
   severitymodel logn pareto;
   outsum out=mylib.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
Mean208.61064Median0
Standard Deviation417.46735Interquartile Range249.36197
Variance174279.0Minimum0
Skewness4.33531Maximum6395.5
Kurtosis30.68677Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75249.36197
95971.66336
97.51358.9
98.51675.7
991964.1
99.52396.1
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 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 the 97.5th percentile in any given year and a 0.5% chance that the policyholder will incur a loss that exceeds the 99.5th percentile 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. 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
Mean206.71313Median0
Standard Deviation390.78039Interquartile Range260.70822
Variance152709.3Minimum0
Skewness3.24907Maximum4625.0
Kurtosis15.26508Sample Size10000

Sample Percentiles
PercentileValue
10
50
250
500
75260.70822
95999.56196
97.51360.5
98.51604.1
991777.6
99.52195.9
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 mylib.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 the data */
data mylib.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 mylib.GroupOfPolicies together in one year:

/* Simulate the aggregate loss distribution for the scenario
   of multiple policyholders */
proc ccdm data=mylib.groupOfPolicies nreplicates=10000 seed=13579 print=all
          countstore=mylib.countregmodel severityest=mylib.sevregest
          plots=(conditionaldensity(rightq=0.95)) nperturbedSamples=50;
   severitymodel logn pareto;
   outsum out=mylib.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.

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
Mean5318.6175.49858
Standard Deviation4179.3141.45815
Variance174866791178659.7
Skewness2.090370.32112
Kurtosis10.922947.21369
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1199.3489927.70726
5745.7763153.38547
252385.1104.32994
504321.0160.79384
757149.7238.12755
9513146.5422.60230
9513146.5422.60230
97.515820.5517.56323
98.517880.0660.76788
9919623.3740.16275
99.522674.11032.8
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 and a worst-case loss as shown in Figure 11.

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.4169.35598
Standard Deviation3915.5121.76718
Variance15346184945964.3
Skewness1.491890.08940
Kurtosis3.792660.85099
Number of Perturbed Samples = 50
Size of Each Sample = 10000

Sample Percentile Perturbation Analysis
PercentileEstimateStandard
Error
1162.5200226.88218
5700.8852652.09737
252386.3102.12837
504365.2158.73203
757166.9229.30068
9512752.8385.34531
9512752.8385.34531
97.515052.7512.07368
98.516745.5585.49172
9918118.1656.42766
99.520512.6819.42806
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 , where the limit is as specified by the RIGHTQ=0.95 suboption of the PLOTS=CONDITIONALDENSITY option. The plot on the right side is the plot of , 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: July 09, 2026