Why use Cholesky decomposition of diag. matrix of VARIANCES to create multivariate normal random draws

3 views (last 30 days)
Hi,
I'm looking at some code where the cholesky decomposition of the covariance matrix is used to create multivariate random draws. It looks like this:
covrc = diag( [ .5 .5 .5 .5 .2] )
v = randn(5,100);
rc = chol(covrc)'*v;
Now, the covariance matrix in this case is only a diagonal matrix of variances. So what does this code create? Does it create five independent vectors of 100 random draws all with a variance of .5 except the last vector? Is this correct?
Would it be the same if a drew 4 vectors of from normal distribution with mean 0 and standard deviation sqrt(.5) and one from a normal distribution with standard deviation sqrt(.2)?
All answers are greatly appreciated!
Best, Florian

Answers (0)

Categories

Find more on Matrix Decomposition in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!