Monte Carlo VaR with Correlated Returns, Copulas, and Historical Bootstrap
Summary
The document outlines portfolio VaR simulation for five assets under Gaussian and Student-t distribution assumptions. Its Monte Carlo recipe generates independent standard normal draws, correlates them with a Cholesky factor, scales each asset by its volatility, applies portfolio weights, and takes a return percentile for the desired confidence level. It also describes extending the approach by connecting marginal distributions with a copula, while noting that the Cholesky construction assumes an elliptical dependence structure.
As a comparison, it presents a historical bootstrap: sample observed return dates with equal probability, apply those returns to current holdings, and calculate a portfolio loss percentile. A large difference from Gaussian Monte Carlo can signal sensitivity to distribution and dependence assumptions, though it does not by itself identify the correct model. The discussion highlights model risk from fitting marginals and copulas. It offers a conceptual procedure rather than a complete implementation, and its simplifying example assumes zero drift.
Key ideas
- Use a Cholesky factor to generate correlated asset returns from simulated standard normal draws.
- Scale simulated returns by asset volatility, apply portfolio weights, and estimate VaR from a tail percentile.
- Copulas allow marginal distributions and dependence assumptions to be modeled separately.
- Historical bootstrap VaR resamples observed return dates and provides a comparison with parametric simulation.
- VaR results depend on distribution and dependence choices, creating model risk.
Tags
Full text
# Step By Step method to calculating VaR using MonteCarlo Simulations
# Step By Step method to calculating VaR using MonteCarlo Simulations
In trying to find VaR for 5 financial assets with prices over a long period of time(2000 days worth of data) how would I do the following:
- Carry out monte-carlo simulation in order to find a VaR value, assuming all 5 assets are standard normally distributed.
- Carry out monte-carlo simulation for all 5 assets to find a VaR value, assuming they follow a student-t distribution with 10 degrees of freedom?
I am trying to do this at both the 95% and 90% confidence levels, and simulate the data with 10,000 replications. Any help would be greatly appreciated. I have already created a Cholesky Decomposition Matrix but not sure how to use the data in it to get the VaR figure.
## Answer by RiskyScientist (score 1)
https://quant.stackexchange.com/a/27797
There are a number of different ways to accomplish your goal. One would involve modelling each financial time series and then connecting these marginal distributions using a copula. Monte Carlo is then a matter of simulating the marginals and the copula.
In using your Cholesky matrix, you are implicitly using an elliptical distribution (think of Gaussian and Student t). If you want to for example create a Gaussian MC simulation in which the marginal distributions are Gaussian and the copula is Gaussian, then you only need the standard deviations of each time series for the marginal distributions and the standard MC simulation approach.
In "pseudocode" the steps are (I assume zero drift for simplicity)
1) Generate uniform random numbers on the interval [0,1] (like Rand() in Excel)
2) Convert each of the uniform randoms to standard Gaussian (0,1) randoms (like NORMSINV)
3) Multiply the Cholesky matrix times the Gaussian random vector to create a vector of correlated randoms for each simulation "date"
4) For each underlying, multiply the new "correlated Gaussian" by the standard deviation corresponding to that underlying/asset
5) Using your portfolio weights and the newly simulated asset returns, calculate the portfolio return
6) Calculate your statistics (like the PERCENTILE function in Excel)
The above series of steps can be converted to other marginal distributions apart from Gaussian, and one can use more realistic copulas than the Gaussian copula.
In modelling your distributions and copula, you are making assumptions which lead to model risk. That is not to say that this is a bad approach, but one just needs to be aware of the fitting errors that arise when performing such an exercise.
There is another simulation method that you might consider which is very easy, and which could be used as a check on the MC method - a sort of "bootstrapping historical simulation".
Again in pseudocode:
1) Convert the price series to log return series
2) Number the data "dates" from 1 to 2000 (the size of your time series)
3) k = 1
4) Choose a random integer i equally likely to be from 1 to 2000 inclusive
5) Apply the returns from "date i" to today's prices (the base price we have today)
6) Using the portfolio weights calculate the fluctuation in portfolio value and record in a vector with index k
7) k = k + 1
8) if K < 10,001 go to step 3) above
9) Calculate the VaR using the vector of portfolio returns (like PERCENTILE in Excel)
If this "historical bootstrap VaR" is extremely different from your Gaussian MC VaR then you probably need to use a more realistic set of marginal distribution assumptions and copula assumptions. A good first step would be to try the Student t distributions and copula.
## Answer by Alex Bădoi (score 0)
https://quant.stackexchange.com/a/22957
Have you looked at the PerformanceAnalytics R package functions? It should allow you to calculate delta normal Var quite easily. I recommend you look at the instructions manual but here is the code for it:
```
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)
```
what you need to look at is the `method`, gaussian being the n-distribution.
to go across your assets (columns) you can use a `for` loop or `apply` functions
```
setwd( enter file name)
data <- read.csv("namefile")
for (i in ncol(data)) {
stock_var <- 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)
print(stock_var)
}
```
i recommend you look at the individual functions separately to understand their format
## Answer by horseless (score 0)
https://quant.stackexchange.com/a/24581
You should be also keep in mind that you are not constrained only to normal and t. The framework you have would go well with a copula function in which you could choose a very wide variety of distributions and relationships between the variables. However, if your project is for compliance or regulators then you might be creating a lot of work for yourself to educate them on what that method does.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.