How to find the correlation between two random numbers
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multivariate Distributions dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!