| ||||||||||||||||||||||||||||||||||||||||
|
Bivariate Normal DistributionConsider computing the cumulative distribution function (CDF) of a multivariate normal (Gaussian) distribution (MultinormalDistribution). Refer to [5, §26.3] or 6. Begin by loading the package Stub. Next, define a bivariate mean vector
and a ( We can evaluate the CDF at, say, as follows. Alternatively, using [5, §26.3.1],
and [5, §26.3.3],
we can compute the numerical integral directly (with reduced PrecisionGoal).
Now consider the following.
This is rather slow, and also small imaginary parts have crept in. Compare this result to that of direct numerical integration. Using [5, §26.3.20], we can reduce the general bivariate computation to a one-dimensional problem.
All we need to compute is
When
We simplify this expression, noting the domain of
Hence We need to treat the limiting case
Note the use of Alternatives for handling both exact ( Implementation of §26.3.20 is immediate. Recomputing the earlier test values is much faster--and we are now working at machine precision. Another possibility is to convert the integral
to a differential equation,
and then use NDSolve to compute the numerical solution for a range of
we compute the solution for
We treat the limiting cases To visualize the probability contours, we choose an appropriate PlotRange so as to compare this result with, for example, [5, Figure 26.2].
The agreement is excellent. Here is a surface plot of the cumulative probability.
Returning to the multivariate problem, we recompute the earlier test values.
We observe another factor of 3 speedup. Note, however, that if any of Converted by Mathematica May 8, 2000 |