0
$\begingroup$

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?

$\endgroup$
4
  • $\begingroup$ Can you use the inverse transformation method to generate from these distributions and then introduce the required correlation by a matrix multiplication? The matrix multiplication works for self-convolving distributions. Perhaps a literature read will show how to draw doint variables from these distributions. $\endgroup$
    – oliversm
    Apr 17, 2020 at 17:16
  • $\begingroup$ @oliversm would you be able to share your proposed methodology here? $\endgroup$
    – sjedi
    Apr 19, 2020 at 13:42
  • $\begingroup$ if you found my answer useful perhaps consider upvoting it... $\endgroup$
    – oliversm
    Apr 23, 2020 at 16:50
  • $\begingroup$ @oliversm I have upvoted it but it doesn't show up publicly as my rank is too low $\endgroup$
    – sjedi
    Apr 24, 2020 at 8:35

1 Answer 1

0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.