Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
verification of bi-variate normal distribution

Subject: verification of bi-variate normal distribution

From: Cris

Date: 2 Jan, 2009 16:13:13

Message: 1 of 7

in Matlab2008b, there is a function "mvncdf".

suppose I have two random variables. both have standard normal
distributions and they have no covariance (the covariance matrix is an
identity matrix). now I wanna compute the joint probability for these
two variable between -1 and 1.

y = mvncdf(xl,xu,mu,SIGMA) is a good function and can give out the
result.

the question is how I can verify this result because there is no such
a bi-variate normal distribution table as the one for one variable
standard normal distribution to check. before I make use of this
function, I have to make sure that it gives out the correct result.

or some one can provide me with some special cases for bi-variate
normal distributions?

many thanks.

VB
/Cris

Subject: verification of bi-variate normal distribution

From: Tom Lane

Date: 2 Jan, 2009 16:59:01

Message: 2 of 7

> suppose I have two random variables. both have standard normal
> distributions and they have no covariance (the covariance matrix is an
> identity matrix). now I wanna compute the joint probability for these
> two variable between -1 and 1.
>
> y = mvncdf(xl,xu,mu,SIGMA) is a good function and can give out the
> result.
>
> the question is how I can verify this result because there is no such
> a bi-variate normal distribution table as the one for one variable
> standard normal distribution to check.

If the covariance matrix is the identity, then the two dimensions are
independent. The probablity that both are between -1 and 1 is the square of
the probability that one of them is:

>> mvncdf([-1 -1],[1 1],[0 0],eye(2))
ans =
    0.4661

>> (normcdf(1)-normcdf(-1))^2
ans =
    0.4661

-- Tom

Subject: verification of bi-variate normal distribution

From: Roger Stafford

Date: 2 Jan, 2009 17:28:01

Message: 3 of 7

Cris <xiaosong.ding@gmail.com> wrote in message <40a781ee-e950-4938-89e6-347193b36611@c36g2000prc.googlegroups.com>...
> in Matlab2008b, there is a function "mvncdf".
>
> suppose I have two random variables. both have standard normal
> distributions and they have no covariance (the covariance matrix is an
> identity matrix). now I wanna compute the joint probability for these
> two variable between -1 and 1.
>
> y = mvncdf(xl,xu,mu,SIGMA) is a good function and can give out the
> result.
>
> the question is how I can verify this result because there is no such
> a bi-variate normal distribution table as the one for one variable
> standard normal distribution to check. before I make use of this
> function, I have to make sure that it gives out the correct result.
>
> or some one can provide me with some special cases for bi-variate
> normal distributions?
>
> many thanks.
>
> VB
> /Cris

  I don't see the problem here. The function mvncdf(X,mu,sigma) in which X has rows of two elements each, mu is 1 x 2, and sigma is 2 x 2, gives you precisely the "table" you are looking for. For standard normal the mu's would be zeros and sigma the identity matrix. It is a two-dimensional table, not one-dimensional. Checking that you are in agreement with this table means of course that you have to go beyond the limits of -1 and +1, in principle clear to plus and minus infinity. Nothing short of this will do the job. If your random variables are in agreement with this cumulative distribution function (an admittedly Herculean task) then they are independent, jointly standard normal random variables.

Roger Stafford

Subject: verification of bi-variate normal distribution

From: Cris

Date: 3 Jan, 2009 01:39:47

Message: 4 of 7

On 1=D4=C23=C8=D5, =C9=CF=CE=E712=CA=B159=B7=D6, "Tom Lane" <tl...@mathwork=
s.com> wrote:
> > suppose I have two random variables. both have standard normal
> > distributions and they have no covariance (the covariance matrix is an
> > identity matrix). now I wanna compute the joint probability for these
> > two variable between -1 and 1.
>
> > y =3D mvncdf(xl,xu,mu,SIGMA) is a good function and can give out the
> > result.
>
> > the question is how I can verify this result because there is no such
> > a bi-variate normal distribution table as the one for one variable
> > standard normal distribution to check.
>
> If the covariance matrix is the identity, then the two dimensions are
> independent. The probablity that both are between -1 and 1 is the square=
 of
> the probability that one of them is:
>
> >> mvncdf([-1 -1],[1 1],[0 0],eye(2))
>
> ans =3D
> 0.4661
>
> >> (normcdf(1)-normcdf(-1))^2
>
> ans =3D
> 0.4661
>
> -- Tom

I see, thank you Tom!

VB
/Cris

Subject: verification of bi-variate normal distribution

From: Cris

Date: 3 Jan, 2009 01:43:18

Message: 5 of 7

On 1=D4=C23=C8=D5, =C9=CF=CE=E71=CA=B128=B7=D6, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> Cris <xiaosong.d...@gmail.com> wrote in message <40a781ee-e950-4938-89e6-=
347193b36...@c36g2000prc.googlegroups.com>...
> > in Matlab2008b, there is a function "mvncdf".
>
> > suppose I have two random variables. both have standard normal
> > distributions and they have no covariance (the covariance matrix is an
> > identity matrix). now I wanna compute the joint probability for these
> > two variable between -1 and 1.
>
> > y =3D mvncdf(xl,xu,mu,SIGMA) is a good function and can give out the
> > result.
>
> > the question is how I can verify this result because there is no such
> > a bi-variate normal distribution table as the one for one variable
> > standard normal distribution to check. before I make use of this
> > function, I have to make sure that it gives out the correct result.
>
> > or some one can provide me with some special cases for bi-variate
> > normal distributions?
>
> > many thanks.
>
> > VB
> > /Cris
>
> I don't see the problem here. The function mvncdf(X,mu,sigma) in which=
 X has rows of two elements each, mu is 1 x 2, and sigma is 2 x 2, gives yo=
u precisely the "table" you are looking for. For standard normal the mu's =
would be zeros and sigma the identity matrix. It is a two-dimensional tabl=
e, not one-dimensional. Checking that you are in agreement with this table=
 means of course that you have to go beyond the limits of -1 and +1, in pri=
nciple clear to plus and minus infinity. Nothing short of this will do the=
 job. If your random variables are in agreement with this cumulative distr=
ibution function (an admittedly Herculean task) then they are independent, =
jointly standard normal random variables.
>
> Roger Stafford

Thank you both. But any suggestions for the verification of the
probability when two normally distributed random variables are not
independent?

VB
/Cris

Subject: verification of bi-variate normal distribution

From: Roger Stafford

Date: 3 Jan, 2009 03:37:02

Message: 6 of 7

Cris <xiaosong.ding@gmail.com> wrote in message <0d0ff15f-010e-4d8e-81c8-ddf23ca6a04e@w1g2000prk.googlegroups.com>...
> ........
> Thank you both. But any suggestions for the verification of the
> probability when two normally distributed random variables are not
> independent?
>
> VB
> /Cris

  I'm not sure what you mean in what you call "the verification of the probability". With your first article Tom interpreted it to mean a verification that for independent variables the results of 'mvncdf' are compatible with those of 'normcdf'. I took it to mean a verification of the observed joint statistical distribution of your actual variables. You seemed content with Tom's answer which indicates his was probably the correct interpretation of your query.

  However, the computation of joint normal cumulative probability distributions for correlated random variables is a much more difficult task and cannot be readily found by referring to 'normcdf' values. There are many algorithms given in the literature for performing this calculation and that used in 'mvncdf' is just one of them.

  The Matlab Statistics Toolbox documentation has a number of references given in the 'mvncdf' function section which you might look up. You can also peruse the Wikipedia site at

 http://en.wikipedia.org/wiki/Multivariate_normal_distribution

for a discussion of these matters.

Roger Stafford

Subject: verification of bi-variate normal distribution

From: Cris

Date: 3 Jan, 2009 04:41:08

Message: 7 of 7

On 1=D4=C23=C8=D5, =C9=CF=CE=E711=CA=B137=B7=D6, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> Cris <xiaosong.d...@gmail.com> wrote in message <0d0ff15f-010e-4d8e-81c8-=
ddf23ca6a...@w1g2000prk.googlegroups.com>...
> > ........
> > Thank you both. But any suggestions for the verification of the
> > probability when two normally distributed random variables are not
> > independent?
>
> > VB
> > /Cris
>
> I'm not sure what you mean in what you call "the verification of the pr=
obability". With your first article Tom interpreted it to mean a verificat=
ion that for independent variables the results of 'mvncdf' are compatible w=
ith those of 'normcdf'. I took it to mean a verification of the observed j=
oint statistical distribution of your actual variables. You seemed content=
 with Tom's answer which indicates his was probably the correct interpretat=
ion of your query.
>
> However, the computation of joint normal cumulative probability distrib=
utions for correlated random variables is a much more difficult task and ca=
nnot be readily found by referring to 'normcdf' values. There are many alg=
orithms given in the literature for performing this calculation and that us=
ed in 'mvncdf' is just one of them.
>
> The Matlab Statistics Toolbox documentation has a number of references =
given in the 'mvncdf' function section which you might look up. You can al=
so peruse the Wikipedia site at
>
> http://en.wikipedia.org/wiki/Multivariate_normal_distribution
>
> for a discussion of these matters.
>
> Roger Stafford

Thank you, Roger.

You are right. Tom solved part of my puzzles when two random variables
are independent. My second question is just as what you have described
above. Maybe it is really hard to verify the results of the
probability for correlated random variables. I'd better search the
literature...

VB
/Cris

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us