Inconsistency in different ways of calculating CDF of bivariate

• To: mathgroup at smc.vnet.net
• Subject: [mg106405] Inconsistency in different ways of calculating CDF of bivariate
• From: Stephen <aultman.stephen at gmail.com>
• Date: Mon, 11 Jan 2010 18:53:07 -0500 (EST)

```I would like to calculate the CDF of a bivariate normal in some C++
code. My first thought was to reduce the dimensionality of the
integral by using the conditonal distribution of the bivariate normal
when one variable is known (see link below). When I try to calculate
the CDF  this way I get an incorrect result. In the code pasted below
I defined a function, temp1, that uses mathematica's built in
bivaraite normal CDF function. The function temp2 attempts to
calculate the same quantity using a one dimension integral and the
conditional distribution of the bivariate normal.

It is more than just rounding errors. For some values of rho, the
error is as much as 0.03, which is a lot in probability terms. Mostly
I am curious why this doesn't work from a mathematical statistics
perspective. There are ways to code around this, but I am curious if
there is a bigger math issue at play. Any thoughts?

mu1 = 0; mu2 = 0; sigma1 = 1; sigma2 = 1; rho = .1; z1 = 0; z2 = 0;
Needs["MultivariateStatistics`"]
temp1[mu1_, mu2_, sigma1_, sigma2_, rho_, z1_, z2_] :=
CDF[MultinormalDistribution[{mu1,
mu2}, {{sigma1^2, rho*sigma1*sigma2}, {rho*sigma1*sigma2,
sigma2^2}}], {z1, z2}]
temp2[mu1_, mu2_, sigma1_, sigma2_, rho_, z1_, z2_] :=
NIntegrate[
PDF[NormalDistribution[mu1, sigma1], x]*
CDF[NormalDistribution[
mu2 + (sigma2/sigma1)*rho (x - mu1), (1 - rho^2)*sigma2^2],
z2], {x, -Infinity, z1}]

Plot[temp1[mu1, mu2, sigma1, sigma2, rho, z1, z2] -
temp2[mu1, mu2, sigma1, sigma2, rho, z1, z2], {rho, -.99, .99}]

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

```

• Prev by Date: Re: Re: Radicals simplify
• Next by Date: Re: NonlinearModelFit and ParameterTable
• Previous by thread: Re: Positions of earliest dates for each month in a list of dates
• Next by thread: Re: Inconsistency in different ways of calculating CDF of bivariate