MATLAB: How create joint distribution of two dependent variables

joint distributionjoint pdfjoint probability density functionlognpdf

Hi,
I have defined two random variables, A and B, which are correlated. I have defined their respective (marginal) pdfs using lognpdf. I want to define their joint pdf. How do I do this?
Or, equivalently, if I define the pdfs of A and the joint for (A,B), can I back out the pdf for B?
mu_A = 0;
mu_B = 0;
sigma_A = sqrt(1);
sigma_B = sqrt(1);
sigma_AB = 0.2;
pdfA = @(a) lognpdf(a,par.mu_A,par.sigma_A);
pdfB = @(b) lognpdf(lb,par.mu_B,par.sigma_B);

Best Answer

I don't think your two questions are equivalent.
If you have the two marginal pdfs and the correlation, there are lots of ways to define the joint distribution--it is not uniquely determined by the marginals and correlation, except in the special case of the bivariate normal. So, you need to choose one of the possible joint distributions depending on your situation. For more information, read about "copulas".
On the other hand, if you have the joint distribution, you can compute everything from it. For example, you can integrate it across one variable to get the marginal distribution for the other variable. Similarly, you can compute the correlation. So, the joint distribution does uniquely determine everything else. Just not vice versa.