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

    %% Run VaR Backtests for Multiple VaRs at Different Confidence Levels  

%% 
% Create a |varbacktest| object that has multiple VaR identifiers with different
% confidence levels. 
load VaRBacktestData
    vbt = varbacktest(EquityIndex,...
       [Normal95 Normal99 Historical95 Historical99 EWMA95 EWMA99],...
       'PortfolioID','Equity',...
       'VaRID',{'Normal95' 'Normal99' 'Historical95' 'Historical99' 'EWMA95' 'EWMA99'},...
       'VaRLevel',[0.95 0.99 0.95 0.99 0.95 0.99]);  

%% 
% Run the summary report for the |varbacktest| object. 
 summary(vbt)  

%% 
% Run all tests using the |varbacktest| object. 
 runtests(vbt)  

%% 
% Run the traffic light test (|<docid:risk_ug.bvabhvb tl>|) using the |varbacktest|
% object. 
 tl(vbt)