varbacktest
Create varbacktest
object to run suite of value-at-risk
(VaR) backtests
Description
The general workflow is:
Load or generate the data for the VaR backtesting analysis.
Create a
varbacktest
object. For more information, see Create varbacktest.Use the
summary
function to generate a summary report for the given data on the number of observations and the number of failures.Use the
runtests
function to run all tests at once.For additional test details, run the following individual tests:
You can use the following functions to perform
varbacktest
enhancements:append
— Add portfolio and VaR data to VaR backtesting objectsexceptions
— Format exceptions in VaR backtesting objectsplot
— Visualize VaR portfolio data and highlight exceptionsselect
— Select VaR data from backtesting objects
For more information, see VaR Backtesting Workflow.
Creation
Description
creates a vbt
= varbacktest(PortfolioData
,VaRData
)varbacktest
(vbt
) object
using portfolio outcomes data and corresponding value-at-risk (VaR) data.
The vbt
object has the following properties:
PortfolioData —
NumRows
-by-1
numeric array containing a copy of thePortfolioData
VaRData —
NumRows
-by-NumVaRs
numeric array containing a copy of theVaRData
PortfolioID — String containing the
PortfolioID
VaRID —
1
-by-NumVaRs
string vector containing theVaRID
s for the corresponding columns inVaRData
VaRLevel —
1
-by-NumVaRs
numeric array containing theVaRLevel
s for the corresponding columns inVaRData
.
Note
The required input arguments for
PortfolioData
andVaRData
must all be in the same units. These arguments can be expressed as returns or as profits and losses. There are no validations in thevarbacktest
object regarding the units of these arguments.If there are missing values (
NaN
s) in the data forPortfolioData
orVaRData
, the row of data is discarded before applying the tests. Therefore, a different number of observations are reported for models with different number of missing values. The reported number of observations equals the original number of rows minus the number of missing values. To determine if there are discarded rows, use the'Missing'
column of thesummary
report.
sets Properties using name-value
pairs and any of the arguments in the previous syntax. For example,
vbt
= varbacktest(___,Name,Value
)vbt =
varbacktest(PortfolioData,VaRData,'PortfolioID','Equity100','VaRID','TotalVaR','VaRLevel',.99)
.
You can specify multiple name-value pairs as optional name-value pair
arguments.
Input Arguments
Properties
Object Functions
tl | Traffic light test for value-at-risk (VaR) backtesting |
bin | Binomial test for value-at-risk (VaR) backtesting |
pof | Proportion of failures test for value-at-risk (VaR) backtesting |
tuff | Time until first failure test for value-at-risk (VaR) backtesting |
cc | Conditional coverage mixed test for value-at-risk (VaR) backtesting |
cci | Conditional coverage independence test for value-at-risk (VaR) backtesting |
tbf | Time between failures mixed test for value-at-risk (VaR) backtesting |
tbfi | Time between failures independence test for value-at-risk (VaR) backtesting |
summary | Report on varbacktest data |
runtests | Run all tests in varbacktest |
append | Add portfolio, value-at-risk (VaR), and expected shortfall (ES) data to backtest objects |
exceptions | Format exceptions in value-at-risk (VaR) or expected shortfall (ES) backtest objects |
plot | Visualize value-at-risk (VaR) or expected shortfall (ES) and portfolio data, and highlight exceptions |
select | Select value-at-risk (VaR) or expected shortfall (ES) data from backtest objects |
Examples
References
[1] Basel Committee on Banking Supervision, Supervisory Framework for the Use of 'Backtesting' in Conjunction with the Internal Models Approach to Market Risk Capital Requirements. January, 1996, https://www.bis.org/publ/bcbs22.htm.
[2] Christoffersen, P. "Evaluating Interval Forecasts." International Economic Review. Vol. 39, 1998, pp. 841 – 862.
[3] Cogneau, Ph. “Backtesting Value-at-Risk: How Good is the Model?" Intelligent Risk, PRMIA, July, 2015.
[4] Haas, M. "New Methods in Backtesting." Financial Engineering, Research Center Caesar, Bonn, 2001.
[5] Jorion, Ph. Financial Risk Manager Handbook. 6th Edition. Wiley Finance, 2011.
[6] Kupiec, P. "Techniques for Verifying the Accuracy of Risk Management Models." Journal of Derivatives. Vol. 3, 1995, pp. 73 – 84.
[7] McNeil, A., Frey, R., and Embrechts, P. Quantitative Risk Management. Princeton University Press, 2005.
[8] Nieppola, O. “Backtesting Value-at-Risk Models.” Helsinki School of Economics, 2009.