How to find the correlation between two random numbers
Show older comments
Hi,
I want to give a specific correlation between two random numbers. I am using them to find the inverse lognormal distribution, so they have to remain between 0 and 1. How can I do this?
script:
N = 10;
ro = 0.75; %correlation between random numbers
f = rand(N,2);
mu7 = 0.84208;
su7 = 0.3852;
my7 = 0.688;
sy7 = 0.09975;
j = f(:,1);
g = f(:,2);
epy = logninv(j,my7,sy7);
epu_y = logninv(g,mu7,su7);
epu = epu_y + epy;
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Multivariate Distributions 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!