VaR(R = NULL,
p = 0.95,
...,
method = c("modified", "gaussian","historical", "kernel"),
clean = c("none", "boudt", "geltner"),
portfolio_method = c("single", "component","marginal"),
weights = NULL, mu = NULL, sigma = NULL,
m3 = NULL, m4 = NULL, invert = TRUE)
Return.clean
. Current options are "none", "boudt", or "geltner".quantile
.
More efficient estimates of VaR are obtained if a (correct) assumption is made on the return distribution, such as the normal distribution.
If your return series is skewed and/or has excess kurtosis, Cornish-Fisher estimates of VaR can be more appropriate.
For the VaR of a portfolio, it is also of interest to decompose total portfolio VaR into the risk contributions of each of the portfolio components.
For the above mentioned VaR estimators, such a decomposition is possible in a financially meaningful way.method="historical"
.
When you don't have a sufficiently long set of returns to use non-parametric or historical VaR,
or wish to more closely model an ideal distribution, it is common to us a parmetric estimate based on the distribution.
J.P. Morgan's RiskMetrics parametric mean-VaR was published in 1994 and this methodology for estimating parametric mean-VaR
has become what most literature generally refers to as VaR
.
See Return to RiskMetrics: Evolution of a Standardqnorm(c)
,
and may be accessed with method="gaussian"
.
Other forms of parametric mean-VaR estimation utilize a different distribution for the distribution of losses
to better account for the possible fat-tailed nature of downside risk.
The package VaR
, now orphaned, contains methods for simulating and estimating lognormal VaR.norm
and generalized Pareto VaR.gpd distributions to overcome some of the problems with nonparametric
or parametric mean-VaR calculations on a limited sample size or on potentially fat-tailed distributions.
There is also a VaR.backtest function to apply simulation methods to create a more robust
estimate of the potential distribution of losses. Less commonly a covariance matrix of multiple risk factors may be applied.
We will attempt to incorporate this orphaned functionality into PerformanceAnalytics in a future release.
The limitations of mean Value-at-Risk are well covered in the literature.
The limitations of traditional mean-VaR are all related to the use of a symetrical distribution function.
Use of simulations, resampling, or Pareto distributions all help in making a more accurate prediction,
but they are still flawed for assets with significantly non-normal (skewed or kurtotic) distributions.
Zangari (1996) and Favre and Galeano(2002) provide a modified VaR calculation that takes the higher moments of non-normal distributions
(skewness, kurtosis) into account through the use of a Cornish Fisher expansion,
and collapses to standard (traditional) mean-VaR if the return stream follows a standard distribution.
This measure is now widely cited and used in the literature, and is usually referred to
as VaR
function, and may be accessed by setting method="modified"
.
Favre and Galeano also utilize modified VaR in a modified Sharpe Ratio as the return/risk measure for their portfolio optimization analysis, see SharpeRatio.modified
for more information.portfolio_method="component"
you may calculate the risk contribution of each element of the portfolio. The return from the function in this case will be a list with three components: the univariate portfolio VaR, the scalar contribution of each component to the portfolio VaR (these will sum to the portfolio VaR), and a percentage risk contribution (which will sum to 100%).
Both the numerical and percentage component contributions to VaR may contain both positive and negative contributions. A negative contribution to Component VaR indicates a portfolio risk diversifier. Increasing the position weight will reduce overall portoflio VaR.
If a weighting vector is not passed in via weights
, the function will assume an equal weighted (neutral) portfolio.
Multiple risk decomposition approaches have been suggested in the literature.
A naive approach is to set the risk contribution equal to the stand-alone risk.
This approach is overly simplistic and neglects important diversification effects of the units being exposed differently to the underlying risk factors.
An alternative approach is to measure the VaR contribution as the weight of the position in the portfolio times the partial derivative of the portfolio VaR with respect to the component weight.
$$C_i \mbox{VaR} = w_i \frac{ \partial \mbox{VaR} }{\partial w_i}.$$
Because the portfolio VaR is linear in position size, we have that by Euler's theorem the portfolio VaR is the sum of these risk contributions.
Gourieroux (2000) shows that for
VaR, this mathematical decomposition of portfolio risk has a
financial meaning. It equals the negative value of the asset's
expected contribution to the portfolio return when the portfolio
return equals the negative portfolio VaR:
$$C_i \mbox{VaR} = = -E\left[ w_i r_{i} | r_{p} = - \mbox{VaR}\right]$$
For the decomposition of Gaussian VaR, the estimated mean and covariance matrix are needed. For the decomposition of modified VaR,
also estimates of the coskewness and cokurtosis matrices are needed. If $r$ denotes the $Nx1$ return vector and $mu$ is
the mean vector, then the $N \times N^2$ co-skewness matrix is
$$m3 = E\left[ (r - \mu)(r - \mu)' \otimes (r - \mu)'\right]$$
The $N \times N^3$ co-kurtosis matrix is
$$m_{4} =
E\left[ (r - \mu)(r - \mu)' \otimes (r - \mu)'\otimes (r - \mu)'
\right]$$
where $\otimes$ stands for the Kronecker product. The matrices can be estimated through the functions
skewness.MM
and kurtosis.MM
.
More efficient estimators have been proposed by Martellini and Ziemann (2007) and will be implemented in the future.
As discussed among others in Cont, Deguest and Scandolo (2007), it is important that the estimation of the VaR measure
is robust to single outliers. This is especially the case for modified VaR and its decomposition, since they use higher order moments.
By default, the portfolio moments are estimated by their sample counterparts. If clean="boudt"
then the $1-p$ most extreme observations are winsorized if they are detected as being outliers. For more information, see Boudt, Peterson and Croux (2008) and Return.clean
. If your data consist of returns for highly illiquid assets, then clean="geltner"
may be more appropriate to reduce distortion caused by autocorrelation, see Return.Geltner
for details.
Epperlein and Smillie (2006) introduced a non-parametric kernel estimator for component risk contributions, which is available via method="kernel"
and portfolio_method="component"
.SharpeRatio.modified
chart.VaRSensitivity
Return.clean
data(edhec)
# first do normal VaR calc
VaR(edhec, p=.95, method="historical")
# now use Gaussian
VaR(edhec, p=.95, method="gaussian")
# now use modified Cornish Fisher calc to take non-normal distribution into account
VaR(edhec, p=.95, method="modified")
# now use p=.99
VaR(edhec, p=.99)
# or the equivalent alpha=.01
VaR(edhec, p=.01)
# now with outliers squished
VaR(edhec, clean="boudt")
# add Component VaR for the equal weighted portfolio
VaR(edhec, clean="boudt", portfolio_method="component")
Run the code above in your browser using DataLab