Main Content

cc

Conditional coverage mixed test for value-at-risk (VaR) backtesting

Description

TestResults = cc(vbt) generates the conditional coverage (CC) mixed test for value-at-risk (VaR) backtesting.

example

TestResults = cc(vbt,Name,Value) adds an optional name-value pair argument for TestLevel.

example

Examples

collapse all

Create a varbacktest object.

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

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

Generate the cc test results.

TestResults = cc(vbt)
TestResults=1×19 table
    PortfolioID    VaRID    VaRLevel      CC      LRatioCC    PValueCC     POF      LRatioPOF    PValuePOF     CCI      LRatioCCI    PValueCCI    Observations    Failures    N00    N10    N01    N11    TestLevel
    ___________    _____    ________    ______    ________    ________    ______    _________    _________    ______    _________    _________    ____________    ________    ___    ___    ___    ___    _________

    "Portfolio"    "VaR"      0.95      accept    0.72013     0.69763     accept     0.46147      0.49694     accept     0.25866      0.61104         1043           57       932    53     53      4       0.95   

Use the varbacktest constructor with name-value pair arguments to create a varbacktest object.

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])
vbt = 
  varbacktest with properties:

    PortfolioData: [1043x1 double]
          VaRData: [1043x6 double]
             Time: [1043x1 double]
      PortfolioID: "Equity"
            VaRID: ["Normal95"    "Normal99"    "Historical95"    "Historical99"    "EWMA95"    "EWMA99"]
         VaRLevel: [0.9500 0.9900 0.9500 0.9900 0.9500 0.9900]

Generate the cc test results using the TestLevel optional input.

TestResults = cc(vbt,'TestLevel',0.90)
TestResults=6×19 table
    PortfolioID        VaRID         VaRLevel      CC      LRatioCC    PValueCC      POF      LRatioPOF    PValuePOF     CCI      LRatioCCI    PValueCCI    Observations    Failures    N00     N10    N01    N11    TestLevel
    ___________    ______________    ________    ______    ________    _________    ______    _________    _________    ______    _________    _________    ____________    ________    ____    ___    ___    ___    _________

     "Equity"      "Normal95"          0.95      accept    0.72013       0.69763    accept     0.46147       0.49694    accept     0.25866      0.61104         1043           57        932    53     53      4        0.9   
     "Equity"      "Normal99"          0.99      accept     4.0757       0.13031    reject      3.5118      0.060933    accept     0.56393      0.45268         1043           17       1008    17     17      0        0.9   
     "Equity"      "Historical95"      0.95      accept     1.0487       0.59194    accept     0.91023       0.34005    accept     0.13847      0.70981         1043           59        928    55     55      4        0.9   
     "Equity"      "Historical99"      0.99      accept     0.5073       0.77597    accept     0.22768       0.63325    accept     0.27962      0.59695         1043           12       1018    12     12      0        0.9   
     "Equity"      "EWMA95"            0.95      accept    0.95051       0.62173    accept     0.91023       0.34005    accept    0.040277      0.84094         1043           59        927    56     56      3        0.9   
     "Equity"      "EWMA99"            0.99      reject     10.779     0.0045645    reject      9.8298     0.0017171    accept     0.94909      0.32995         1043           22        998    22     22      0        0.9   

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.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: TestResults = cc(vbt,'TestLevel',0.99)

Test confidence level, specified as the comma-separated pair consisting of 'TestLevel' and a numeric between 0 and 1.

Data Types: double

Output Arguments

collapse all

cc test results, returned as a table where the 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 corresponding VaR data column

  • 'CC' — Categorical array with the categories accept and reject that indicate the result of the cc test

  • 'LRatioCC' — Likelihood ratio of the cc test

  • 'PValueCC' — P-value of the cc test

  • 'POF' — Categorical array with the categories accept and reject that indicate the result of the pof test

  • 'LRatioPOF' — Likelihood ratio of the pof test

  • 'PValuePOF' — P-value of the pof test

  • 'CCI' — Categorical array with categories 'accept' and 'reject' that indicate the result of the cci test

  • 'LRatioCCI' — Likelihood ratio of the cci test

  • 'PValueCCI' — P-value of the cci test

  • 'Observations' — Number of observations

  • 'Failures' — Number of failures

  • 'N00' — Number of periods with no failures followed by a period with no failures

  • 'N10' — Number of periods with failures followed by a period with no failures

  • 'N01' — Number of periods with no failures followed by a period with failures

  • 'N11' — Number of periods with failures followed by a period with failures

  • 'TestLevel' — Test confidence level

Note

For cc test results, the terms accept and reject are used for convenience, technically a cc test does not accept a model. Rather, the test fails to reject it.

More About

collapse all

Conditional Coverage (CC) Mixed Test

The cc function performs the conditional coverage mixed test, also known as Christoffersen's interval forecasts method.

'Mixed' means that it combines a frequency and an independence test. The frequency test is Kupiec's proportion of failures test, implemented by the pof function. The independence test is the conditional coverage independence test implemented by the cci function. This is a likelihood ratio test proposed by Christoffersen (1998) to assess the independence of failures on consecutive time periods. The CC test combines the POF test and the CCI test.

Algorithms

The likelihood ratio (test statistic) of the cc test is the sum of the likelihood ratios of the pof and cci tests,

LRatioCC=LRatioPOF+LRatioCCI

which is asymptotically distributed as a chi-square distribution with 2 degrees of freedom. See the Algorithms section in pof and cci for the definition of their likelihood ratios.

The p-value of the cc test is the probability that a chi-square distribution with 2 degrees of freedom exceeds the likelihood ratio LRatioCC,

PValueCC=1F(LRatioCC)

where F is the cumulative distribution of a chi-square variable with 2 degrees of freedom.

The result of the cc test is to accept if

F(LRatioCC)<F(TestLevel)

and reject otherwise, where F is the cumulative distribution of a chi-square variable with 2 degrees of freedom.

References

[1] Christoffersen, P. "Evaluating Interval Forecasts." International Economic Review. Vol. 39, 1998, pp. 841 – 862.

Version History

Introduced in R2016b