Main Content

pof

Proportion of failures test for value-at-risk (VaR) backtesting

Description

example

TestResults = pof(vbt) generates the proportion of failures (POF) test for value-at-risk (VaR) backtesting.

example

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

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 pof test results.

TestResults = pof(vbt,'TestLevel',0.99)
TestResults=1×9 table
    PortfolioID    VaRID    VaRLevel     POF      LRatioPOF    PValuePOF    Observations    Failures    TestLevel
    ___________    _____    ________    ______    _________    _________    ____________    ________    _________

    "Portfolio"    "VaR"      0.95      accept     0.46147      0.49694         1043           57         0.99   

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 pof test results using the TestLevel optional input.

TestResults = pof(vbt,'TestLevel',0.90)
TestResults=6×9 table
    PortfolioID        VaRID         VaRLevel     POF      LRatioPOF    PValuePOF    Observations    Failures    TestLevel
    ___________    ______________    ________    ______    _________    _________    ____________    ________    _________

     "Equity"      "Normal95"          0.95      accept     0.46147       0.49694        1043           57          0.9   
     "Equity"      "Normal99"          0.99      reject      3.5118      0.060933        1043           17          0.9   
     "Equity"      "Historical95"      0.95      accept     0.91023       0.34005        1043           59          0.9   
     "Equity"      "Historical99"      0.99      accept     0.22768       0.63325        1043           12          0.9   
     "Equity"      "EWMA95"            0.95      accept     0.91023       0.34005        1043           59          0.9   
     "Equity"      "EWMA99"            0.99      reject      9.8298     0.0017171        1043           22          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 = pof(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

pof test results, returned as a table where the rows correspond to all combinations of portfolio ID, VaR ID, and VaR level 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

  • '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

  • 'Observations' — Number of observations

  • 'Failures' — Number of failures

  • 'TestLevel' — Test confidence level

Note

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

More About

collapse all

Proportion of Failures (POF) Test

The pof function performs Kupiec's proportion of failures test.

The POF test is a likelihood ratio test proposed by Kupiec (1995) to assess if the proportion of failures (number of failures divided by number of observations) is consistent with the VaR confidence level.

Algorithms

The likelihood ratio (test statistic) of the pof test is given by

LRatioPOF=2log((1pVaR)NxpVaRx(1xN)Nx(xN)x)=2[(Nx)log(N(1pVaR)Nx)+xlog(NpVaRx)]

where N is the number of observations, x is the number of failures, and pVaR = 1 - VaRLevel. This test statistic is asymptotically distributed as a chi-square distribution with 1 degree of freedom. By the properties of the logarithm,

LRatioPOF=2Nlog(1pVar)   if x=0.

and

LRatioPOF=2Nlog(pVar)   if x=N.

The p-value of the POF test is the probability that a chi-square distribution with 1 degree of freedom exceeds the likelihood ratio LRatioPOF

PValuePOF=1F(LRatioPOF)

where F is the cumulative distribution of a chi-square variable with 1 degree of freedom.

The result of the test is to accept if

PValuePOF<F(TestLevel)

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

References

[1] Kupiec, P. "Techniques for Verifying the Accuracy of Risk Management Models." Journal of Derivatives. Vol. 3, 1995, pp. 73 – 84.

Version History

Introduced in R2016b