How VaR and CVaR Are Estimated from Return Distributions
Summary
The discussion explains that VaR and CVaR can be calculated repeatedly to track portfolio risk over time. It distinguishes the risk measure itself, which is computed from a return or loss distribution, from time-series methods that may be used to estimate that distribution. In R, return data containers such as data frames and time-series objects do not change a univariate calculation by themselves.
It describes analytical estimates based on a Gaussian distribution or a Cornish–Fisher expansion, which incorporates skewness and kurtosis. For portfolio risk, a scenario approach can represent historical or simulated returns; portfolio weights turn each scenario into a portfolio outcome, VaR is its quantile, and CVaR averages outcomes in the tail beyond that threshold. The discussion notes that multivariate Cornish–Fisher calculations can become burdensome for large portfolios because of co-skewness and co-kurtosis inputs. It does not provide a detailed R implementation, and the chosen distribution or scenarios remain important modeling assumptions.
Key ideas
- VaR and CVaR can be recalculated through time to monitor portfolio risk.
- Time-series techniques can estimate a return distribution, while VaR and CVaR are functions of that distribution.
- Gaussian and Cornish–Fisher approaches provide analytical estimates with different distributional assumptions.
- Scenario methods combine asset outcomes with portfolio weights, then derive VaR from a quantile and CVaR from tail outcomes.
- Multivariate Cornish–Fisher calculations can become computationally demanding for large portfolios.
Tags
Full text
# quantiative risk measure how they are implemented in R and their use
# quantiative risk measure how they are implemented in R and their use
So far I have just theoretical knowledge of risk measure and never used them in application. Therefore I have some basic question how risk measures are used in reality and how they are implemented in R.
- Let's assume you are managing a portfolio containing some assets. In particular I'm interested in VaR and CVaR. VaR is a quantile of the loss distribution. In reality one would calculate the VaR for the returns to see what the current risk of your portfolio is. This leads to a series of VaR over time, is this correct?
- How CVaR implemented in R? I know there is the PerformanceAnalytics package containing the function ES. But how does this function calculate the CVaR? Moreover, this function (ES) has as argument a vector, matrix, data frame, timeSeries or zoo object of asset returns. How does the calculation differs if the argument is a data frame of asset returns or a timeSeries object?
- Closely related to 2. How are Time Series used to calculate VaR/CVar?
I'm very thankful for any explanations / references.
## Answer by John (score 1, accepted)
https://quant.stackexchange.com/a/10912
For the first, people regularly compute VaR or CVaR over time and plot the results.
For two and three, the documentation for the ETL function says that you can either calculate it using a Gaussian approach or Cornish-Fisher expansion. These are both analytical methods. The Gaussian approach uses only the mean and variance (effectively assuming that the distribution of returns is a Gaussian distribution with whatever mean and variance you provide), while the Cornish-Fisher also takes into account the skewness and kurtosis of the distribution.
You can use the function to calculate a univariate CVaR for one or more series. The underlying formula would not change for different data types so long as you are considering a univariate CVaR. However, if you choose to calculate the CVaR of a portfolio (by changing the portfolio_method parameter, I believe), then the formulas change to handle the multivariate relationships between the different securities. In this case, the Cornish-Fisher expansion typically becomes burdensome for large portfolios because the co-skewness and co-kurtosis matrices become huge.
To resolve this issue, the more general way to calculate VaR and CVaR is to represent the distribution of returns by scenarios. Some people use the historical distribution of returns in this way, but you can also use simulations from more general distributions. Given a vector of portfolio weights, you can calculate the portfolio returns for each scenario. Then you can find the VaR of the portfolio by the quantile function. The CVaR is then just the average of the returns less than the VaR. This can be done quite easily in just about any language.
I wouldn't say time series are used to calculate VaR and CVaR. Rather, time series methods or techniques can be used to produce estimates of the expected distribution of returns. VaR and CVaR are functions on those distributions. xts is used in PerformanceAnalytics mainly as a data container, i.e. to make it easier to work with returns and dates.
## Answer by dmanuge (score 1)
https://quant.stackexchange.com/a/16519
A risk measure $\rho$ applied to time series $X \in \mathbb{R^n}$ yields $Y \in \mathbb{R} $. i.e. $\rho: \mathbb{R^n} \rightarrow \mathbb{R}$
As for implementation (using R), see here.
A look at the formulas for VAR and ES (which is exactly the same as CVAR) should clear up any confusion.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.