Generating a string of random standard normal variables that are correlated
Show older comments
Hi Everyone,
I'm a sort of newbie, I would like to know how and what the implications are of 'Generating a string of random standard normal variables that are correlated with each other'.
To get by this problem, I have been generating and correlating my desired sequence to a different random variable and then calculating the correlation between my sequence.
Thanks for the anticipated answer.
ps: Generate random standard normal's A, B, C, D so that have a correlation and standard deviation of corr and std.
Thanks again
Accepted Answer
More Answers (2)
Oleg Komarov
on 6 Dec 2011
Given a correlation matrix C = A*A', then A = P*sqrt(D), where:
[P,D] = eig(C); % spectral decomposition
To get the correlated normal random series Z, use W = (W1, ...,W2)' (the normal random series):
Z = A*W;
Note that if you have 4 variables, then C is 4 by 4, and W should be 4 by nobs.
Chet Sharma
on 30 Jan 2018
0 votes
I think you should refer Hull's option book. In the 8th edition, chapter 20, page 450, I believe you will find out answer. He describes something called a "Cholesky decomposition" that is needed to generate the "correct" correlation matrix......
1 Comment
Garrison Greenwood
on 24 Feb 2021
Cholesky won't work if the C matrix is positive semi-definite.
Categories
Find more on Random Number Generation 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!