www.gusucode.com > risk 案例源码程序 matlab代码 > risk/GenerateTablesforRiskMeasureandConfidenceIntervalsforacrExample.m

    %% Generate Tables for Risk Measure and Confidence Intervals for a |creditCopula| Object

%% 
% Load saved portfolio data. 
load CreditPortfolioData.mat;  

%% 
% Create a |creditCopula| object with a two-factor model. 
cc = creditCopula(EAD,PD,LGD,Weights2F,'FactorCorrelation',FactorCorr2F)  

%% 
% Set the |VaRLevel| to 99%. 
cc.VaRLevel = 0.99;  

%% 
% Use the |<docid:risk_ug.bvaj1_z-1 simulate>|
% function before running |portfolioRisk|. Then use |portfolioRisk| with the |creditCopula| object to generate the |riskMeasure|
% and |ConfidenceIntervals| tables. 
cc = simulate(cc,1e5);
[riskMeasure,confidenceIntervals] = portfolioRisk(cc,'ConfidenceIntervalLevel',0.9)