I would like to know how to implement a bivariate normal distribution.
Show older comments
I have the following formula(see picture) and I know that
R=-2.25 rhoR=0.5 and the result I should get is ~0.17%.
I read the instructions on Mathworks for the mvnpdf but I dont know how to use it with my data.
I am thankful for any help and suggestions on how I need to enter my data into the formula.
Accepted Answer
More Answers (1)
John D'Errico
on 15 May 2018
Using the stats toolbox, you want to use mvncdf, not mvnpdf anyway. (Ok, you could integrate the pdf. But why would you here?)
R = -2.25;
rhoR=0.5;
mvncdf([R,R],[0 0],[1 rhoR;rhoR 1])
ans =
0.0017093
Which is roughly 0.17%.
Note that mvncdf expects a covariance matrix. And you have supplied a correlation, not apparently a covariance. But since the presumed variances were 1 by default, the correlation matrix will be the same as the covariance matrix here.
1 Comment
Charlotte
on 19 May 2018
Categories
Find more on Startup and Shutdown 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!