The function calculates the \(\tau\)th Value-at-Risk of the next time occurrence,
i.e., that number such that the probability that the returns fall below its
negative value is \(\tau\). The parameter \(\tau\) is typically chosen to be a
small number such as 0.01, 0.025, or 0.05. By definition, the negative value of the
\(\tau\)th Value-at-Risk is the \(\tau\)th conditional quantile. Therefore,
the estimation is performed using a local linear conditional quantile estimation.
However, prior to this nonparametric estimation, a dimension reduction technique
is performed to select linear combinations of the predictor variables.
Specifically, the user provides a vector of returns y
(usually log-returns)
and an integer p
for the number of past observations to be used as the
predictor variables. The function then forms the m x p design matrix x, where m is
the number of used observations. For example, m can be n - p if the user wants to
use all observations, or m can be equal to the moving window (default value is
min(250, n - p)). Value-at-Risk is then defined as the negative value of the
\(\tau\)th conditional quantile of y given x. However, to aid the nonparametric
estimation of the \(\tau\)th conditional quantile, the cqs
function is
applied to estimate the fewest linear combinations of the predictor x
that
contain all the information available on the conditional quantile function. Finally,
the llqr
function is applied to estimate the local linear conditional quantile
of y using the extracted directions as the predictor variables.
For more details on the method and for an application to the Bitcoin data, see
Christou (2020). Also, see Christou and Grabchak (2019) for a thorough
comparison between the proposed methodology and commonly used methods.