summary

Report on varbacktest data

Syntax

S = summary(vbt)

Description

example

S = summary(vbt) returns a basic report on the given varbacktest data, including the number of observations, the number of failures, the observed confidence level, and so on (see S for details).

Examples

collapse all

Create a varbacktest object.

load VaRBacktestData
vbt = varbacktest(EquityIndex,Normal95)
vbt = 
  varbacktest with properties:

    PortfolioData: [1043x1 double]
          VaRData: [1043x1 double]
      PortfolioID: "Portfolio"
            VaRID: "VaR"
         VaRLevel: 0.9500

Generate the summary report.

S = summary(vbt)
S=1×10 table
    PortfolioID    VaRID    VaRLevel    ObservedLevel    Observations    Failures    Expected    Ratio    FirstFailure    Missing
    ___________    _____    ________    _____________    ____________    ________    ________    _____    ____________    _______

    "Portfolio"    "VaR"      0.95         0.94535           1043           57        52.15      1.093         58            0   

Use the varbacktest constructor with name-value pair arguments to create a varbacktest object and generate a summary report.

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]);
S = summary(vbt)
S=6×10 table
    PortfolioID        VaRID         VaRLevel    ObservedLevel    Observations    Failures    Expected    Ratio     FirstFailure    Missing
    ___________    ______________    ________    _____________    ____________    ________    ________    ______    ____________    _______

     "Equity"      "Normal95"          0.95         0.94535           1043           57        52.15       1.093         58            0   
     "Equity"      "Normal99"          0.99          0.9837           1043           17        10.43      1.6299        173            0   
     "Equity"      "Historical95"      0.95         0.94343           1043           59        52.15      1.1314         55            0   
     "Equity"      "Historical99"      0.99         0.98849           1043           12        10.43      1.1505        173            0   
     "Equity"      "EWMA95"            0.95         0.94343           1043           59        52.15      1.1314         28            0   
     "Equity"      "EWMA99"            0.99         0.97891           1043           22        10.43      2.1093        143            0   

Input Arguments

collapse all

varbacktest (vbt) object, contains a copy of the given data (the PortfolioData and VarData properties) and all combinations of portfolio ID, VaR ID, and VaR levels to be tested. For more information on creating a varbacktest object, see varbacktest.

Output Arguments

collapse all

Summary report, returned as a table. The table rows correspond to all combinations of portfolio ID, VaR ID, and VaR levels to be tested. The columns correspond to the following information:

  • 'PortfolioID' — Portfolio ID for the given data

  • 'VaRID' — VaR ID for each of the VaR data columns provided

  • 'VaRLevel' — VaR level for the corresponding VaR data column

  • 'ObservedLevel' — Observed confidence level, defined as number of periods without failures divided by number of observations

  • 'Observations' — Number of observations, where missing values are removed from the data

  • 'Failures' — Number of failures, where a failure occurs whenever the loss (negative of portfolio data) exceeds the VaR

  • 'Expected' — Expected number of failures, defined as the number of observations multiplied by one minus the VaR level

  • 'Ratio' — Ratio of the number of failures to expected number of failures

  • 'FirstFailure' — Number of periods until first failure

  • 'Missing' — Number of periods with missing values removed from the sample

Introduced in R2016b