VaR.CornishFisher {PerformanceAnalytics} | R Documentation |
These functions calculate both traditional mean-VaR and modified Cornish-Fisher VaR
VaR.CornishFisher(R, p = 0.99, modified = TRUE, clean=c("none","boudt")) modifiedVaR(R, p = 0.99) VaR.traditional(R, p = 0.95) VaR.mean(R, p = 0.95)
R |
a vector, matrix, data frame, timeSeries or zoo object of asset returns |
p |
confidence level for calculation, default p=.99 |
clean |
|
modified |
TRUE/FALSE default TRUE, use Cornish Fisher Expansion to take higher moments into account |
In the early 90's, academic literature started referring to “value at risk”, typically written as VaR. Take care to capitalize VaR in the commonly accepted manner, to avoid confusion with var (variance) and VAR (vector auto-regression). With a sufficiently large data set, you may choose to utilize a non-parametric VaR estimation method using the historical distribution and the probability quantile of the distribution calculated using quantile
for an arbitrary historical distribution or qnorm
for an idealized normal distribution. The negative return at the correct quantile (usually 95% or 99%), is the non-parametric historical VaR estimate.
In a set of returns for which sufficently long history exists, the per-period Value at risk is simply the correct quantile of the period losses μ with variance σ is denoted by:
VaR=μ_{q_{.99}}
where q_{.99} is the 99% quantile of the distribution.
fPortfolio
has implemented historical mean-VaR as the VaR
function.
This method is also sometimes called “historical VaR”, as it is by definition ex post analysis of the return distribution.
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” and what we have implemented as VaR.traditional
. See Return to RiskMetrics: Evolution of a Standardhttp://www.riskmetrics.com/r2rovv.html,
Parametric mean-VaR does a better job of accounting for the tails of the distribution by more precisely estimating shape of the distribution tails of the risk quantile. The most common estimate is a normally distributed Rsim N(μ,σ^{2}) return series. In this case, estimation of VaR requires the mean return bar{R}, the distribution of losses μ, and the variance of the returns σ. In the most common case, parametric VaR is thus calculated by
σ=variance(R)
VaR=bar{R} - σ cdot q_{c}
where q_{c} is the $c$% quantile of the distribution. Represented in R by qnorm(1-p)
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
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.
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 “Modified VaR” or “Modified Cornish-Fisher VaR”.They arrive at their modified VaR calculation in the following manner:
z_{cf}=q_{c}+frac{(q_{c}^{2}-1)S}{6}+frac{(q_{c}^{3}-3q_{c})K}{24}-frac{(2q_{c}^{3}-5q_{c})S^{2}}{36}
modVaR =bar{R} - σ cdot z_{cf}
where $S$ is the skewness of $R$ and $K$ is the excess kurtosis of $R$.
Cornish-Fisher VaR collapses to traditional mean-VaR when returns are normally distributed. As such, the VaR.mean
and VaR.traditional
functions are wrappers for the VaR.CornishFisher
function. The Cornish-Fisher expansion also naturally encompasses much of the variability in returns that could be uncovered by more computationally intensive techniques such as resampling or Monte-Carlo simulation.
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.
VaR measure
The prototype of the Cornish Fisher VaR function was completed by Prof. Diethelm Wuertz. All corrections to the calculation and error handling are the fault of Brian Peterson.
Brian G. Peterson
Zangari, Peter. A VaR Methodology for Portfolios that include Options. 1996. RiskMetrics Monitor, First Quarter, 4-12.
Laurent Favre and Jose-Antonio Galeano. Mean-Modified Value-at-Risk Optimization with Hedge Funds. Journal of Alternative Investment, Fall 2002, v 5.
Uryasev S, Rockafellar R. Optimization of Conditional VaR. University of Florida, Working paper, 1999.
VaR.Beyond
VaR.Marginal
SharpeRatio.modified
skewness
kurtosis
VaR
VaR.gpd
VaR.norm
VaR.backtest
CVaR
data(edhec) # first do normal VaR calc VaR.traditional(edhec, p=.95) # now use modified Cornish Fisher calc to take non-normal distribution into account VaR.CornishFisher(edhec, p=.95) # now use default p=.99 VaR.CornishFisher(edhec) # now with outliers squished VaR.CornishFisher(edhec, clean="boudt")