From: naseeb on
Hi,

For the function mvncdf, if used for bivariate normal case; how can I get cdf wrt a limit. For example, Pr = (X<z and Y>z)
where z is the limit that I want to put in the mvncdf function. Any idea??


Thanks.
From: Sadik on
Hi Naseeb,

I am writing it for P(X<=z,Y<=z) so that you can figure it out for any other configuration.

But before proceeding, you should realize that in fact we need to write it as P(X1<=z,X2<=z) because in general, we are going to have a d-dimensional vector X whose elements are jointly normally distributed. [In this case, bivariate is equivalent to saying d = 2.]

Therefore, also keeping an eye on the documentation

http://www.mathworks.com/access/helpdesk/help/toolbox/stats/mvncdf.html

we have [assuming zero mean and identity covariance matrix]

P(X1<=z,X2<=z) = mvncdf([z,z]);

Best.
From: naseeb on
Hi Sadik,

Thanks for your comment. In the document of mvncdf, format given is-
y = mvncdf(X,mu,SIGMA)

I am not understanding, in this format how to put the limit point for X and Y.

Please advise.

Thanks
Naseeb

"Sadik " <sadik.hava(a)gmail.com> wrote in message <hobmrg$8d5$1(a)fred.mathworks.com>...
> Hi Naseeb,
>
> I am writing it for P(X<=z,Y<=z) so that you can figure it out for any other configuration.
>
> But before proceeding, you should realize that in fact we need to write it as P(X1<=z,X2<=z) because in general, we are going to have a d-dimensional vector X whose elements are jointly normally distributed. [In this case, bivariate is equivalent to saying d = 2.]
>
> Therefore, also keeping an eye on the documentation
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/stats/mvncdf.html
>
> we have [assuming zero mean and identity covariance matrix]
>
> P(X1<=z,X2<=z) = mvncdf([z,z]);
>
> Best.
From: Sadik on
In the documentation,

y = mvncdf(X,mu,SIGMA);

Lowercase y here has nothing to do with our X or Y, OK? y here is just a number between 0 and 1 and represents a probability. So, let us replace it with p. Then we have

p = mvncdf(X,mu,SIGMA);

Now we need to make another replacement. In this notation, X denotes a vector. So let us look at the 2-dim case and replace X with a 2-dim vector:

p = mvncdf([x1,x2],mu,SIGMA);

Now, x1 and x2 are the "limits". Finally, to fit your situation, let's make our final replacement, which is

x1 = x_lim;
x2 = y_lim;

from which we get:

p = mvncdf([x_lim,y_lim],mu,SIGMA);

Best.