unconditional
Unconditional expected shortfall backtest by Acerbi and Szekely
Syntax
Description
runs the unconditional expected shortfall (ES) backtest of Acerbi-Szekely
(2014).TestResults
= unconditional(ebts
)
[
adds an optional name-value pair argument for TestResults
,SimTestStatistic
] = unconditional(ebts
,Name,Value
)TestLevel
.
Examples
Run an ES Unconditional Test
Create an esbacktestbysim
object.
load ESBacktestBySimData rng('default'); % for reproducibility ebts = esbacktestbysim(Returns,VaR,ES,"t",... 'DegreesOfFreedom',10,... 'Location',Mu,... 'Scale',Sigma,... 'PortfolioID',"S&P",... 'VaRID',["t(10) 95%","t(10) 97.5%","t(10) 99%"],... 'VaRLevel',VaRLevel);
Generate the ES unconditional test report.
TestResults = unconditional(ebts)
TestResults=3×10 table
PortfolioID VaRID VaRLevel Unconditional PValue TestStatistic CriticalValue Observations Scenarios TestLevel
___________ _____________ ________ _____________ ______ _____________ _____________ ____________ _________ _________
"S&P" "t(10) 95%" 0.95 accept 0.093 -0.13342 -0.16252 1966 1000 0.95
"S&P" "t(10) 97.5%" 0.975 reject 0.031 -0.25011 -0.2268 1966 1000 0.95
"S&P" "t(10) 99%" 0.99 reject 0.008 -0.57396 -0.38264 1966 1000 0.95
Input Arguments
ebts
— esbacktestbysim
object
object
esbacktestbysim
(ebts
) object,
contains a copy of the given data (the PortfolioData
,
VarData
, ESData
, and
Distribution
properties) and all combinations of
portfolio ID, VaR ID, and VaR levels to be tested. For more information
on creating an esbacktestbysim
object, see esbacktestbysim
.
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,SimTestStatistic] =
unconditional(ebts,'TestLevel',0.99)
TestLevel
— Test confidence level
0.95
(default) | numeric with values between 0
and
1
Test confidence level, specified as the comma-separated pair
consisting of 'TestLevel'
and a numeric value
between 0
and 1
.
Data Types: double
Output Arguments
TestResults
— Results
table
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'Unconditional'
— Categorical array with categories 'accept' and 'reject' that indicate the result of the unconditional test'PValue'
— P-value of the unconditional test'TestStatistic'
— Unconditional test statistic'CriticalValue'
— Critical value for the unconditional test'Observations'
— Number of observations'Scenarios'
— Number of scenarios simulated to get the p-values'TestLevel'
— Test confidence level
SimTestStatistic
— Simulated values of the test statistic
numeric array
Simulated values of the test statistic, returned as a
NumVaRs
-by-NumScenarios
numeric array.
More About
Unconditional Test by Acerbi and Szekely
The unconditional test is also known as the second Acerbi-Szekely test.
The unconditional test is based on the unconditional relationship
where
X
t is the portfolio outcome, that
is, the portfolio return or portfolio profit and loss for period
t.
P
VaR is the probability of VaR
failure defined as 1-VaR level.
ES
t is the estimated expected
shortfall for period t.
I
t is the VaR failure indicator on
period t with a value of 1 if
X
t < -VaR, and 0
otherwise.
The unconditional test statistic is defined as:
Significance of the Test
Under the assumption that the distributional assumptions are
correct, the expected value of the test statistic
Z
uncond is
0
.
This is expressed as
Negative values of the test statistic indicate risk underestimation. The
unconditional test is a one-sided test that rejects when there is evidence that
the model underestimates risk (for technical details on the null and alternative
hypotheses, see Acerbi-Szekely, 2014). The unconditional test rejects the model
when the p-value is less than 1
minus the
test confidence level.
For more information on the steps to simulate the test statistics and the
details for the computation of thep-values and critical
values, see simulate
.
Edge Cases
The unconditional test statistic takes a value of
1
when there are no VaR failures in the data or in a
simulated scenario.
1
is also the maximum possible value for the test
statistic. When the expected number of failures
Np
VaR is small, the distribution of
the unconditional test statistic has a discrete probability jump at
Z
uncond = 1
, and
the probability that Z
uncond ≤
1
is 1
. The p-value is
set to 1
in these cases, and the test result is to
'accept'
, because there is no evidence of risk
underestimation. Scenarios with no failures are more likely as the expected number
of failures Np
VaR gets smaller.
References
[1] Acerbi, C., and B. Szekely. Backtesting Expected Shortfall. MSCI Inc. December, 2014.
Version History
Introduced in R2017b
See Also
summary
| runtests
| conditional
| quantile
| minBiasRelative
| minBiasAbsolute
| simulate
| esbacktestbysim
| esbacktestbyde
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)