Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

runtests

Run all expected shortfall (ES) backtests for esbacktest object

Syntax

TestResults = runtests(ebt)
TestResults = runtests(ebt,Name,Value)

Description

example

TestResults = runtests(ebt) runs all the tests for the esbacktest object. runtests reports only the final test result. For test details, such as p-values, run the individual tests:

example

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

Examples

collapse all

Create an esbacktest object.

load ESBacktestData
ebt = esbacktest(Returns,VaRModel1,ESModel1,'VaRLevel',VaRLevel)
ebt = 

  esbacktest with properties:

    PortfolioData: [1966×1 double]
          VaRData: [1966×1 double]
           ESData: [1966×1 double]
      PortfolioID: "Portfolio"
            VaRID: "VaR"
         VaRLevel: 0.9750

Generate the TestResults report for all ES backtests.

TestResults = runtests(ebt,'TestLevel',0.99)
TestResults =

  1×5 table

    PortfolioID    VaRID    VaRLevel    UnconditionalNormal    UnconditionalT
    ___________    _____    ________    ___________________    ______________

    "Portfolio"    "VaR"    0.975       reject                 accept        

Input Arguments

collapse all

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

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: TestResults = runtests(ebt,'TestLevel',0.99)

collapse all

Test confidence level, specified as the comma-separated pair consisting of 'TestLevel' and a numeric value between 0.5 or 0.9999.

Data Types: double

Output Arguments

collapse all

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 the corresponding VaR data column

  • 'UnconditionalNormal'— Categorical array with categories 'accept' and 'reject' that indicate the result of the unconditional normal test

  • 'UnconditionalT' — Categorical array with categories 'accept' and 'reject' that indicate the result of the unconditional t test

Note

For the test results, the terms accept and reject are used for convenience. Technically, a test does not accept a model; rather, a test fails to reject it.

Introduced in R2017b

Was this topic helpful?