Main Content

runtests

Run all expected shortfall (ES) backtests foresbacktestbyde对象

Description

example

TestResults= runtests(ebtde)runs all the tests for theesbacktestbyde对象.runtestsreports only the final test result. For test details such asp-values, run the individual tests:

example

TestResults= runtests(___,Name,Value)specifies options using one or more name-value pair arguments in addition to the input argument in the previous syntax.

Examples

collapse all

Create anesbacktestbyde对象for atmodel with 10 degrees of freedom, and then run ES backtests.

loadESBacktestDistributionData.matrng('default');% For reproducibilityebtde = esbacktestbyde(Returns,"t",...'DegreesOfFreedom',T10DoF,...'Location',T10Location,...'Scale',T10Scale,...'PortfolioID',"S&P",...'VaRID',["t(10) 95%","t(10) 97.5%","t(10) 99%"],...'VaRLevel',VaRLevel); runtests(ebtde)
ans=3×5 tablePortfolioID VaRID VaRLevel ConditionalDE UnconditionalDE ___________ _____________ ________ _____________ _______________ "S&P" "t(10) 95%" 0.95 reject accept "S&P" "t(10) 97.5%" 0.975 reject accept "S&P" "t(10) 99%" 0.99 reject reject

To view complete details for the tests, use the name-value pair argument'ShowDetails'.

runtests(ebtde,'ShowDetails',真正的)
ans=3×8 tablePortfolioID VaRID VaRLevel ConditionalDE UnconditionalDE CriticalValueMethod NumLags TestLevel ___________ _____________ ________ _____________ _______________ ___________________ _______ _________ "S&P" "t(10) 95%" 0.95 reject accept "large-sample" 1 0.95 "S&P" "t(10) 97.5%" 0.975 reject accept "large-sample" 1 0.95 "S&P" "t(10) 99%" 0.99 reject reject "large-sample" 1 0.95

Input Arguments

collapse all

esbacktestbyde对象, which contains a copy of the data (thePortfolioData,VarData, andESDataproperties) and all combinations of portfolio ID, VaR ID, and VaR levels to be tested. For more information on creating anesbacktestbyde对象, seeesbacktestbyde.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis 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 encloseNamein quotes.

Example:TestResults = runtests(ebtde,'CriticalValueMethod','simulation','TestLevel',0.99,'ShowDetails',true)

Method to compute critical values, confidence intervals, andp-values, specified as the comma-separated pair consisting of'CriticalValueMethod'and character vector or string with a value of'large-sample'or'simulation'.

Data Types:char|string

Number of lags in theconditionalDEtest, specified as the comma-separated pair consisting of'NumLags'and a positive integer.

Data Types:double

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

Data Types:double

Flag to display all details in output including the columns for critical-value method, number of lags tested, and test confidence level, specified as the comma-separated pair consisting of'ShowDetails'and a scalar logical value.

Data Types:logical

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:

  • 'PortfolioID'— Portfolio ID for the given data

  • 'VaRID'— VaR ID for each of the VaR levels

  • 'VaRLevel'— VaR level

  • 'ConditionalDE'— Categorical array with the categories'accept'and'reject', which indicate the result of theconditionalDEtest

  • 'UnconditionalDE'— Categorical array with the categories'accept'and'reject', which indicate the result of theunconditionalDEtest

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.

If you set theShowDetailsoptional name-value argument totrue,TestResultstable also includes'CriticalValueMethod','NumLags', and'TestLevel'columns.

References

[1] Du, Z., and J. C. Escanciano. "Backtesting Expected Shortfall: Accounting for Tail Risk."管理三英洁具ce.Vol. 63, Issue 4, April 2017.

[2] Basel Committee on Banking Supervision."Minimum Capital Requirements for Market Risk".January 2016 (https://www.bis.org/bcbs/publ/d352.pdf).

Version History

Introduced in R2019b