SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_model_market_risk_allocation.sas
1/* ************************************************** */
2/* Aggregate Market Risk Allocation Model */
3/* ************************************************** */
4
5 /*This scripts has dual purpose:
6 1) It skips the instrument-level processing of the BEP before the loss exposure has been evaluated
7 2) It triggers the aggregate-level processing of the BEP after the loss exposure has been evaluated
8 */
9
10%macro stm_allocate(gen_type =) / minoperator;
11
12 %local
13 /* *************************** */
14 /* Allocation model parameters */
15 /* *************************** */
16 market_alloc_model_type
17 ;
18
19 %let market_alloc_model_type=instrument_level;
20 %if %SYMEXIST(post_run_flag)=1 %then %do;;
21 %if %sysevalf(%superq(post_run_flag)=TRUE, boolean) %then %do;
22 %let market_alloc_model_type=aggregate_level;
23 %end;
24 %end;
25
26 %if market_alloc_model_type=instrument_level %then %do;
27
28 data &ds_out_generation.;
29 set &ds_in_analysis_data.(obs=0);
30 run;
31
32 data &ds_out_elimination.;
33 set &ds_in_analysis_data.(obs=0 keep=instid);
34 run;
35
36 %end;
37 %else %do;
38 %if &market_alloc_model_type.=aggregate_level %then %do;
39
40 /* Run analysis */
41 %irmst_market_agg_bep_analysis(ds_in_portfolio = &ds_out_model_result.
42 , ds_in_projection = &ds_in_bep_expectations.
43 , ds_out = &ds_out_model_result.
44 , target_var = &bep_target_var.
45 , absoluteValue_var = absoluteValue
46 , by_vars = &segmentation_vars.
47 , id_var = instid
48 , horizon_var = ActivationHorizon
49 , scenario_var = bepName
50 , debug = false
51 );
52
53 %end;
54 %end;
55
56%mend;