SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_model_mip_preexec_creditRiskPlus.sas
1/*Pre-execution program to evaluate the risk exposure based on the Credit Risk+ methodology.
2 The main idea is to obtain the the compound distribution of losses through convolution.
3 The convolution is obtain by using the the Fast Fourier Transform and the Characteristic function associated with the probability distribution.
4 The Post-Execution program has been created based on the material presented in
5 "CreditRisk+ by Fast Fourier Transform", July 2004. YieldCurve, August 2004.
6 Available at SSRN: https://ssrn.com/abstract=1122844 or https://dx.doi.org/10.2139/ssrn.1122844
7 It is executed before the User Defined Logic (UDL): ST_CreditRisk_Plus_Exposure
8 and, therefore, before the Post-Execution program: ST_CreditRiskPlus_PostExec*/
9
10
11
12proc risk;
13 env new=mipenv.risk_env inherit=(mimp_env.base_risk_env);
14 setoptions NOBACKSAVE;
15 env save;
16
17run;
18
19
20%let sectors_cnt =4; /*Number of active sectors in CrediRisk+ - including specific sector */
21%let exposureHistogram_max =${params.EXPOSUREMAX}; /*Maximum value of the exposure domain to be investigated*/
22%let exposureHistogram_cellCnt =${params.EXPOSURECELLCOUNT}; /*SUGGESTION: exposureHistogram_cellCnt=2^k.
23 It is the number of cells used to approximate the histogram of the losses.
24 For computational reasons it is best to set it to 2^k where k is positive integer.
25 The approximation and the computational complexity grows with k.
26 In particular, this code requires the evaluation of Discrete Fourier transform.
27 If exposureHistogram_cellCnt=2^k then the evaluation of the Discrete Fourier transform
28 can per performed significantly faster.*/
29%let exposureHistogram_width =%eval(&exposureHistogram_max./&exposureHistogram_cellCnt.); /* Discretization interval for creditrisk+:
30 Base units of exposures *//**/
31%let ValueAtRisk_Level =${params.VARLEVEL}; /*It determines the level of the the value at risk.*/
32%let debug_flg =${params.DEBUGFLG}; /*It allows to store temporary data sets.*/
33
34
35
36/*Change the definition of the macro variable "detailed_output" in order to choose which output variables should be displayed. */
37%let Read_WEIGHT_EXPOSURES_VEC = %bquote(
38 WEIGHT_EXPOSURES_VEC[1]=WEIGHT_EXPOSURE_SPECIFIC;
39 WEIGHT_EXPOSURES_VEC[2]=WEIGHT_EXPOSURE_SECTOR_1;
40 WEIGHT_EXPOSURES_VEC[3]=WEIGHT_EXPOSURE_SECTOR_2;
41 WEIGHT_EXPOSURES_VEC[4]=WEIGHT_EXPOSURE_SECTOR_3;
42 );
43%let Read_PD_Volatility_VEC = %bquote(
44 PD_Volatility_Sector[1]=PD_SD_SPECIFIC;
45 PD_Volatility_Sector[2]=PD_SD_SECTOR_1;
46 PD_Volatility_Sector[3]=PD_SD_SECTOR_2;
47 PD_Volatility_Sector[4]=PD_SD_SECTOR_3;
48 );
49