ecm

ecm

Description

The `ecm` action creates a sample of the enterprise-wide loss (aggregate loss) by combining a copula simulation with the marginal empirical distributions of losses in business lines. This action is essential for Economic Capital Modeling, allowing for the calculation of risk metrics such as Value-at-Risk (VaR) and Tail Value-at-Risk (TVaR) by simulating the joint distribution of risks based on a specified dependency structure (copula) and individual loss data (marginals).

Settings
ParameterDescription
copulaSampleSpecifies the name of the input table that contains the copula simulation in uniform margins. This table must be in a form that the outuniform parameter in the copulaSimulate action generates.
marginalsSpecifies the list of input tables that contain the empirical samples of the marginal distributions of business lines for which copula modeling is done. Each entry allows mapping specific columns.
outputSpecifies the details of the output table to which to write the sample of the enterprise-wide loss, including the optional 'outSample' sub-parameter.
outsumSpecifies the details of the output table to which to write estimates of summary statistics, percentiles, and tail values-at-risk (TVaR).
analysisVariablesSpecifies the names of the marginal variables that you want to analyze. These must be a subset of the marginal variables in the copula simulation table.
seedSpecifies the seed for the pseudorandom number generator. If 0 (default), a random seed is used.
tailStartSpecifies the empirical distribution function (EDF) value where the tail region starts. Default is 0.8.
Data Preparation View data prep sheet
Data Creation for ECM

Creates a simulated copula table (uniform distributions) and two marginal loss tables (Log-Normal and Gamma distributions) representing two business lines, 'Corp' and 'Retail'.

Copied!
1 
2DATA casuser.copula_sim;
3call streaminit(12345);
4DO i = 1 to 5000;
5u_corp = rand('UNIFORM');
6u_retail = rand('UNIFORM');
7OUTPUT;
8END;
9 
10RUN;
11 
12DATA casuser.marg_corp;
13call streaminit(12345);
14DO i = 1 to 5000;
15_DRAWID_=1;
16_AGGSEV_ = rand('LOGNORMAL', 5, 1);
17OUTPUT;
18END;
19 
20RUN;
21 
22DATA casuser.marg_retail;
23call streaminit(67890);
24DO i = 1 to 5000;
25_DRAWID_=1;
26_AGGSEV_ = rand('GAMMA', 3);
27OUTPUT;
28END;
29 
30RUN;
31 

Examples

Generates an enterprise-wide loss sample by combining the pre-generated copula simulation with the marginal distributions for 'Corp' and 'Retail'.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3ecm.ecm / copulaSample={name='copula_sim'} marginals={{name='marg_corp', sampleVarName='_AGGSEV_', idVarValue='u_corp'}, {name='marg_retail', sampleVarName='_AGGSEV_', idVarValue='u_retail'}} OUTPUT={outSample={name='ecm_output', replace=true}} seed=123;
4 
5RUN;
6 
Result :
An output table 'ecm_output' containing the simulated total loss values.

Performs ECM analysis requesting specific Tail Value-at-Risk (TVaR) levels (95%, 99%), additional percentiles (50th, 90th), and standard summary statistics, saving the results to a separate summary table.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3ecm.ecm / copulaSample={name='copula_sim'} marginals={{name='marg_corp', idVarValue='u_corp'}, {name='marg_retail', idVarValue='u_retail'}} analysisVariables={'u_corp', 'u_retail'} outsum={outSummary={name='ecm_stats', replace=true}, tVaRLevels={{percentileLevel=95}, {percentileLevel=99}}, percentiles={{percentile=50}, {percentile=90}}, summaryStatistics={{statistic='MEAN'}, {statistic='STDDEV'}}} OUTPUT={outSample={name='ecm_detailed', replace=true}, varName='Total_Loss'} seed=98765;
4 
5RUN;
6 
Result :
Two output tables: 'ecm_detailed' containing the sample data, and 'ecm_stats' containing Mean, StdDev, P50, P90, TVaR95, and TVaR99.

FAQ

What is the primary purpose of the ecm action?
Which parameter is required to specify the copula simulation input table?
How do you specify the input tables for marginal distributions?
What does the bodySampleFrac parameter control?
How can I define the accuracy for the EDF in the tail region?
Which parameter defines the empirical distribution function value where the tail region begins?
How can I save estimates of summary statistics and percentiles to an output table?
What does the shuffleData parameter do?

Associated Scenarios

Use Case
Operational Risk Aggregation for Banking

A retail bank needs to calculate its Economic Capital by aggregating operational risks from two main business lines: 'Internal Fraud' and 'IT System Failures'. The Risk Manageme...

Use Case
High-Volume Multi-Line Insurance Aggregation

A global insurance company is modeling aggregate losses across three distinct portfolios: Auto, Home, and Health. To ensure stability in the tail of the distribution, they requi...

Use Case
Extreme Tail Stress Test without Shuffling

A financial institution is performing a 'Stress Test' focusing exclusively on extreme catastrophic events (the top 1% of losses). For reproducibility and auditing purposes on a ...