View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Multivariate Lognormal Simulation with Correlation

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

3.83333
3.8 | 6 ratings Rate this file 8 Downloads (last 30 days) File Size: 1.98 KB File ID: #6426 Version: 1.0

Multivariate Lognormal Simulation with Correlation

by

 

29 Nov 2004 (Updated )

A multivariate lognormal simulator.

| Watch this File

File Information
Description

MVLOGNRAND MultiVariate Lognormal random numbers with correlation.

This function will generate multivariate lognormal random numbers with correlation.

Often one would simulation a lognormal distribution by first simulating a normal and then taking the exponent of it.

If you provide the correlation matrix to the multivariate normal random number generator and then exponeniate the results, you will not have the correlation stucture you input in the normal distribution because of the exponeniation. This function adjusts for that and passes the adjusted correlation matrix to the normal random number generator.

Example:
Mu = [ 11 12 13 ];
Sigma= [ .1 .3 .5 ];
Sims= 1e6;
CorrMat=[1 .2 .4 ; .2 1 .5 ; .4 .5 1];
y=MvLogNRand(Mu,Sigma,Sims,CorrMat );

  corrcoef(y)
  ans =
           1 0.19927 0.40156
     0.19927 1 0.50008
     0.40156 0.50008 1

  CorrMat =
         1 0.2 0.4
       0.2 1 0.5
       0.4 0.5 1

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
20 Jul 2016 Katerina Rippi

I tried to use the code with 2 variables but then it is giving an error saying that Sigma should be a symmetric semi-positive definite matrix. Do you have any idea of how I should deal with that?

23 Jul 2014 Dima

Dima (view profile)

 
10 Jul 2013 Nan Shen

question: is the meam and standard deviation normal or lognormal?

Comment only
14 Nov 2012 Jenny Chew  
19 Jan 2008 Tube Event  
15 May 2007 jane matthew

i need information abaout matlab for lognormal distribution in statistik

26 Oct 2005 ofer setty  

Contact us