How to find the correlation between two random numbers
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Multivariate Distributions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!