varbacktest
R2026bCreate varbacktest object to run suite of value-at-risk
(VaR) backtests
Description
The general workflow is:
Load or generate the data for VaR backtesting analysis.
Create a
varbacktestobject. For more information, see Creation.Use the
summaryfunction to generate a summary report for the given data on the number of observations and the number of failures.Use the
runtestsfunction to run all tests at once.For additional test details, run the following individual tests:
You can use the following functions to perform
varbacktestenhancements:append— Add portfolio and VaR data to VaR backtesting objects.exceptions— Format exceptions in VaR backtesting objects.plot— Visualize VaR portfolio data and highlight exceptions.select— Select VaR data from backtesting objects.
For more information, see VaR Backtesting Workflow.
Creation
Description
creates a vbt = varbacktest(PortfolioData,VaRData)varbacktest object called vbt
using data from portfolio outcomes and the corresponding value-at-risk (VaR).
vbt has the following properties:
PortfolioData — Numeric column vector, table, or timetable containing portfolio outcomes data for VaR backtesting analysis
VaRData — Numeric matrix, table, or timetable containing the VaR data for VaR backtesting analysis
PortfolioID — String containing the identifier for
PortfolioDataVaRID — String row vector containing the VaR IDs for the corresponding columns in
VaRDataVaRLevel — Numeric row vector containing the VaR levels for the corresponding columns in
VaRDataTime — Time points for each
PortfolioDataandVarDataentry
Note
You can express the
PortfolioDataandVaRDatainput arguments as returns or as profits and losses. However, these arguments must use the same units. Thevarbacktestobject does not validate that units are the same.Rows in
PortfolioDataorVaRDatawithNaNvalues are discarded before applying the tests. The reported number of observations is the original number of rows minus the number of missing values. To determine the number of rows each test discards, use theMissingcolumn of thesummaryreport.
sets properties using one or more name-value arguments in addition to the input
arguments in previous syntaxes. For example, vbt = varbacktest(___,Name=Value)vbt =
varbacktest(PortfolioData,VaRData,PortfolioID="Equity100",VaRID="TotalVaR",VaRLevel=0.99).
Input Arguments
Name-Value 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 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 | Report 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.