Class VarBacktest
java.lang.Object
com.quantfinlib.risk.VarBacktest
VaR model validation: do the exceptions (losses beyond VaR) occur at the
promised rate, and independently?
- Kupiec POF — likelihood-ratio test that the exception
frequency matches
1 - confidence(two-sided: both too many and too few exceptions reject). χ²(1). - Christoffersen independence — LR test that exceptions do not cluster (a model that is right on average but wrong in crises fails here). χ²(1).
- Conditional coverage — the joint test (POF + independence),
χ²(2), with the exact p-value
e^{-LR/2}.
-
Method Details
-
test
public static VarBacktest.VarBacktestResult test(double[] returns, double constantVar, double confidence) Backtests a constant VaR (positive loss fraction) against realized returns. -
test
public static VarBacktest.VarBacktestResult test(double[] returns, double[] varForecasts, double confidence) - Parameters:
returns- realized periodic returnsvarForecasts- VaR forecast for each period as a positive loss fraction, aligned withreturnsconfidence- the VaR confidence level (e.g. 0.95, 0.99)
-