Description Usage Arguments Details Value References See Also Examples
var.forecast function forecasts the daily VaR and intra-day VaR curves according to intra-day return curves.
1 | var.forecast(yd, sigma_pred, error_fit, quantile_v, Method)
|
yd |
A (grid_point) x (number of observations) matrix drawn from N functional curves. |
sigma_pred |
The predicted conditional standard deviation curve obtained by using the functional ARCH/GARCH model. |
error_fit |
The residual obtained from the functional ARCH/GARCH model. |
quantile_v |
The percentile of the VaR forecasts. |
Method |
A string to indicate which method will be implemented to estimate the quantile of the error: "normal" - assuming errors following a normal distribution; "bootstrap" - bootstrapping the empirical distribution from the historical data; "evt" - fitting the error with a generalized Pareto distribution. |
This function uses a two-step approach to forecast intra-day Value-at-Risk, in formula that
VaR_{i+1}^τ(t)=\hat{σ}_{i+1}(t)\hat{\varepsilon}^τ(t), for 1≤q i ≤q N, t\in[0,1], and the percentile τ \in [0,1],
where the forecats of conditional standard deviation \hat{σ}_{i+1}(t) can be obtained by using est.fArch
, est.fGarch
, or est.fGarchx
. Note that when t=1, VaR_{i+1}^τ(1) is the forecast of daily VaR.
List of objects:
day_VaR: the daily VaR.
day_ES: the daily expected shortfall.
intraday_VaR: the intra-day VaR curves.
vio_seq: the violation curve for the intra-day VaR curves.
Rice, G., Wirjanto, T., Zhao, Y. (2020). Forecasting Value at Risk via intra-day return curves. International Journal of Forecasting. <doi:10.1016/j.ijforecast.2019.10.006>.
basis.est
est.fGarch
diagnostic.fGarch
var.backtest
var.vio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# generate discrete evaluations of the FGARCH(1,1) process.
grid_point = 50; N = 200
yd = dgp.fgarch(grid_point, N, "garch")
yd = yd$garch_mat
# extract data-driven basis functions through the truncated FPCA method.
basis_est = basis.est(yd, M=2, "tfpca")$basis
# fit the curve data and the conditional volatility by using an FGARCH(1,1) model with M=1.
fd = fda::Data2fd(argvals=seq(0,1,len=50),y=yd,fda::create.bspline.basis(nbasis=32))
garch11_est = est.fGarch(fd, basis_est[,1])
diag_garch = diagnostic.fGarch(garch11_est, basis_est[,1], yd)
# get the in-sample fitted conditional variance and error.
sigma_fit = diag_garch$sigma2[,1:N]
error_fit = diag_garch$eps
# get in-sample intra-day VaR curve by assuming a point-wisely Gaussian distributed error term.
var_obj = var.forecast(yd, sigma_fit, error_fit, quantile_v=0.01, Method="normal")
# the intra-day VaR curves.
var_obj$intraday_VaR
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.