Skip to content
All library documents

Correlated Monte Carlo Sampling with Non-Normal Marginals

Article Quant Q&A · Author: sjedi

Summary

The document discusses simulating asset returns with non-normal marginal distributions while preserving dependence between assets. It notes that standard univariate samplers can generate Weibull or lognormal draws, and describes inverse transformation as a general way to sample from a distribution when its cumulative distribution function, or an approximation to its inverse, is available. For joint sampling, it points to copulas as a framework for modeling dependence when a simple matrix transformation is not suitable.

A correlation matrix alone does not fully specify a multivariate distribution, and methods that work conveniently for some distributions may not generalize to arbitrary marginals. The answer also cautions that lognormal and Weibull variables are strictly positive, making them questionable models for raw returns that can be negative. It suggests considering a heavier-tailed distribution such as Student's t, but provides no fitted model, simulation results, or validation against the bond data in the question. Marginal choice and dependence structure both require care.

Key ideas

  • Inverse transformation can generate draws when a distribution's inverse cumulative distribution function is available or approximated.
  • Univariate lognormal and Weibull sampling does not by itself produce a correlated multivariate sample.
  • Copulas can combine specified marginal distributions with a dependence model.
  • A correlation matrix does not fully determine joint dependence for arbitrary distributions.
  • Strictly positive lognormal and Weibull variables may be unsuitable for raw returns that can be negative.

Tags

Full text
# Generate Monte Carlo simulation of multivariate lognormal or weibull distributions in R


# Generate Monte Carlo simulation of multivariate lognormal or weibull distributions in R












I intend to perform a Monte Carlo simulation of asset returns in R. I am currently using the `rmvnorm` function in the `mvtnorm` R package to generate simulated returns based on multivariate normal distribution, taking into account asset return correlations. Based on historical asset prices, the asset returns (bonds) appear to be more similar to a lognormal or weibull distribution.

Is there any R package that can perform a Monte Carlo simulation under multivariate lognormal and weibull distributions, integrating the asset return correlation matrix?

Alternatively, can the existing multivariate normal distribution packages (`mvtnorm`, `MASS`) be tweaked to account for a multivariate lognormal or weibull distribution?

## Answer by oliversm (score 0, accepted)

https://quant.stackexchange.com/a/53483

## Some R packages that might be handy

For the Weibull distribution you can sample from this directly using `rweibull`, and for the log-normal you can use `rlnorm`. (In R-studio you can just search for these in the help-tab).

## If you want some arbitrary distribution

One way of generating from an arbitrary distribution without rejection is the inverse transformation method. All you need to be able to do this is have access to the inverse cumulative distribution function. If you don't happen to have this function but do have access to the cumulative distribution function then you can approximate the inverse using the `inverse` function (from the "GoFKernel" package). If you don't have access to that but only have the probability density function you can approximate the cumulative distribution function (this can be done using your favourite integration package).

## If you want a vector of random variables with a given correlation structure

If you want to jointly sample several random variables which are identically distributed with a certain correlation matrix between them, then for certain distributions you can achieve this by a matrix multiplication, as described in a previous answer of mine to Quasi Random Monte Carlo in m.v. portfolio optimization.

If your distribution doesn't come from such a convenient distribution, which in general you shouldn't expect it to, then how to jointly sample from this is a separate question in its own right. Much of this is answered by studying "copulas" (cf. Using Uniform Distribution to Generate Correlated Random Samples in R ), and in R an example of this can be found in fCopulae (cf. `rellipticalCopula`).Some resources include (copied from an answer to a related question)

- R. B. Nelsen, An Introduction to Copulas, Second Edition, Springer Verlag, 2006.

- D.D. Mari and S. Kotz, Correlation and Dependence, Imperial College Pres, 2004.

- H. Joe, Multivariate Models and Dependence Concepts, Chapman and Hall, 1997.

## I don't think you want either the Weibull or log-normal for modelling your returns

> "Based on historical asset prices, the asset returns (bonds) appear to be more similar to a lognormal or weibull distribution."

I am not sure how the returns can be modelled by these, as these are strictly positive, and have an immediate skew, whereas returns are in reality often not so readily skewed, but just typically have fatter tails, and are often negative. Perhaps a $t$-distribution might better suit your needs.

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.