cdm

cdm

Description

The cdm action simulates a compound distribution model, which is a common approach for modeling the aggregate losses or the total amount of losses that occur over a certain period. This action is part of the Aggregate Loss Modeling action set. It can handle various types of models, including collective risk, pure premium, and custom models, allowing for flexible and detailed analysis of loss distributions.

cdm.cdm <result=results> <status=rc> / <adjustedSeverity={adjParm}>, <aggLossModelType="COLLECTIVERISK" | "CUSTOM" | "PUREPREMIUM">, <countDistributions={{countDist-1} <, {countDist-2}, ...>}>, <countStore={castable}>, <countVariable="variable-name">, <display={displayTables}>, <idVariable="variable-name">, <ignoreParmCovariance=TRUE | FALSE>, <maxCountDraw=integer>, <nPerturbedSamples=integer>, <nReplicates=64-bit-integer>, <outDraw={casouttable}>, <output={outsampleParm}>, <outputTables={outputTables}>, <outsum={outsumParm}>, <percentileMethod=integer>, <perturbMode="AUTO" | "DIST">, <plotTable={plotTable}>, <seed=integer>, <severityDefinitions={castable}>, <severityDistributions={"string-1" <, "string-2", ...>}>, <severityEst={castable}>, <severityStore={castable}>, <severityTruncationLeft=double>, <severityTruncationRight=double>, <simulatedSymbols={{simSymbol-1} <, {simSymbol-2}, ...>}>, <table={castable}>, <truncateZeros=TRUE | FALSE>, <varianceDivisor="DF" | "N">;
Settings
ParameterDescription
adjustedSeveritySpecifies the adjusted severity symbols and a SAS program to compute them. An aggregate distribution is estimated for each adjusted severity symbol.
aggLossModelTypeSpecifies the type of model to use for the aggregate loss. Options are COLLECTIVERISK, CUSTOM, or PUREPREMIUM.
countDistributionsSpecifies count distributions and their parameter values directly.
countStoreSpecifies an item-store table to read count model estimates from, created by the countregFitModel action.
countVariableSpecifies the count variable when using an input data table for simulation.
displaySpecifies a list of results tables to be displayed.
idVariableSpecifies the name of the replication ID variable.
ignoreParmCovarianceIf true, ignores the covariance estimates of parameters and uses only their standard errors for perturbation.
maxCountDrawSpecifies an upper limit on the number of loss events for simulating one aggregate loss sample point.
nPerturbedSamplesSpecifies the number of perturbed samples for parameter perturbation analysis.
nReplicatesControls the size of the compound distribution sample to be simulated.
outDrawSpecifies the output table to write severity draws to.
outputSpecifies the output table for the final aggregate loss samples.
outputTablesLists the names of results tables to save as CAS tables on the server.
outsumSpecifies the output table for summary statistics of the aggregate loss sample.
percentileMethodSpecifies the method for computing percentiles of the compound distribution (0-5).
perturbModeSpecifies how to organize perturbed samples across worker nodes (AUTO or DIST).
plotTableControls the creation and content of the PlotData results table for generating plots.
seedSpecifies the seed for the random number generator. A value of 0 selects a random seed.
severityDefinitionsSpecifies the CAS table that contains the severity distribution definitions.
severityDistributionsSpecifies the list of severity distribution names to analyze.
severityEstSpecifies a table to read severity model estimates from, created by the severity action.
severityStoreSpecifies an item-store table to read severity model estimates from, created by the severity action.
severityTruncationLeftSpecifies the left truncation threshold to apply to each severity value.
severityTruncationRightSpecifies the right truncation limit to apply to each severity value.
simulatedSymbolsSpecifies external, user-defined random variables (symbols) and their probability distributions to be used in custom simulations.
tableSpecifies the input data table for simulation.
truncateZerosIf true, removes zero-valued aggregate losses from the final sample.
varianceDivisorSpecifies the divisor (DF for N-1, N for N) to use in calculating variance and related statistics.
Data Preparation View data prep sheet
Data Creation for Simulation

The cdm action requires pre-existing CAS tables for severity and count model definitions or estimates. The following code shows how to create a simple severity definition table `mycas.sevdeff` which defines two severity distributions, Log-Normal (Logn) and Burr.

Copied!
1DATA mycas.sevdeff;
2 LENGTH model $ 8;
3 INFILE DATALINES truncover;
4 INPUT model$ @@;
5 IF (model = 'Logn') THEN DO;
6 dist='LOGN';
7 INPUT mu sigma;
8 END;
9 ELSE IF (model = 'Burr') THEN DO;
10 dist='BURR';
11 INPUT alpha theta;
12 END;
13 DATALINES;
14Logn 3 0.5
15Burr 2 1500
16;
17RUN;

Examples

This example simulates an aggregate loss sample using a predefined Poisson distribution for frequency (count) and a Log-Normal distribution for severity. It's a self-contained example that doesn't require prior model fitting.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 cdm.cdm /
3 nReplicates=10000,
4 seed=1234,
5 countDistributions={{name='POISSON', parmValues={{value=2}}}},
6 severityDefinitions={name='mycas.sevdeff', where='model="Logn"'},
7 OUTPUT={outSample={name='mycas.aggloss', replace=true}, sampleVariable='AggLoss'},
8 outsum={outSummary={name='mycas.aggloss_summary', replace=true}};
9RUN;
10QUIT;
Result :
This code generates two tables: `mycas.aggloss` containing 10,000 simulated aggregate loss values, and `mycas.aggloss_summary` containing descriptive statistics (mean, standard deviation, percentiles, etc.) of the simulated sample.

This example demonstrates a more advanced scenario where both count and severity models are specified via pre-estimated item stores (`mycas.cntest` and `mycas.sevest`). It performs a parameter perturbation analysis by generating 50 perturbed samples (`nPerturbedSamples=50`) to assess the impact of parameter uncertainty on the aggregate loss distribution.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 cdm.cdm /
3 nReplicates=10000,
4 seed=1234,
5 countStore={name='mycas.cntest'},
6 severityStore={name='mycas.sevest'},
7 nPerturbedSamples=50,
8 OUTPUT={outSample={name='mycas.aggloss_pert', replace=true}, perturbOut=true},
9 outsum={outSummary={name='mycas.aggloss_pert_summary', replace=true}};
10RUN;
11QUIT;
Result :
This creates two tables. `mycas.aggloss_pert` contains the simulated aggregate loss sample for each of the 50 perturbed parameter sets, identified by the `_PerturbID_` variable. `mycas.aggloss_pert_summary` provides summary statistics for the aggregate loss distribution of each perturbed sample, allowing for an analysis of the variability of the results.

Associated Scenarios

Use Case
Standard Aggregate Loss Simulation for Auto Insurance

An insurance company wants to estimate the total payout for its auto insurance portfolio for the upcoming year. They model the frequency of claims using a Poisson distribution a...

Use Case
High-Volume Operational Risk Stress Test with Perturbation

A banking institution needs to perform a stress test on its operational risk models. They require a high volume of simulations (100,000 replicates) to ensure tail accuracy and w...

Use Case
Inflation Adjustment Using Custom Severity Calculation

An actuary needs to project future liabilities where the claim amounts are expected to grow due to economic inflation. Instead of changing the base model parameters, they want t...