|
MULTIVARIATE NORMAL CDFName:
The CDF is the integral of the probability density function from negative infinity to the desired value. In addition to the CDF case, this command can handle integration from the specified point to positive infinity and integration from negative infinity to positive infinity. For the multivariate case, you need to specify a varible containing the location estimates for each variable, the variance-covariance matrix of the the variables, and variables specifying the limits of integration. This command uses codes provided by Alan Genz (see the Reference seciton below). In particular, this code supports four different methods:
Alan Genz has written several papers comparing the speed and accuracy of these various methods. His basic conclusion is that for moderate accuracy SADMVN and KROMVN are usually much faster (with SADMVN faster for fewer than 10 variables and KROMVN faster for more than 10 variables). By default, Dataplot uses the SADMVN method, but you specify one of the other methods (see the Note section below).
where <sigma> is a matrix containing the desired variance-covariance matrix; <upplim> is a variable containing the upper levels of integration; and where <par> is a parameter containing the computed multivariate normal cdf value. This syntax computes the cdf function.
where <sigma> is a matrix containing the desired variance-covariance matrix; <lowlim> is a variable containing the lower levels of integration; <upplim> is a variable containing the upper levels of integration; and where <par> is a parameter containing the computed multivariate normal cdf value. This syntax can be used to compute arbitrary integrals of the multivariate normal function.
1 0.5 0.5 0.5 1 0.5 0.5 0.5 1 END OF DATA LET LOWLIM = DATA 1.5 2 0.5 LET A = MULTIVARIATE NORMAL CDF SIGMA LOWLIM
where <method> is one of the following:
KROMVN RANMVN SPHMVN
LET RELEPS = <value> These define the desired absolute and relative errors, respectively. The default absolute error is set to 0.00005 and the default relative error is set to 0 (i.e., the absolute error is used). This should be a reasonable choice for most applications.
"Numerical Computation of Multivariate Normal Probabilities", Alan Genz, Journal of Computational and Graphical Statistics, 1, 1992, pp. 141-149.
read matrix sigma 1.0 -0.707107 0.0 0.0 0.0 -0.707107 1.0 0.5 0.5 0.5 0.0 0.5 1.0 0.5 0.5 0.0 0.5 0.5 1.0 0.5 0.0 0.5 0.5 0.5 1.0 end of data . let cpumin = -infinity let lowl = data 0.0 0.0 1.7817 1.4755 cpumin let uppl = data infinity 1.5198 infinity infinity 1.5949 . let a = multivariate normal cdf sigma lowl uppl set multivariate normal kromvn let a = multivariate normal cdf sigma lowl uppl set multivariate normal ranmvn let a = multivariate normal cdf sigma lowl uppl set multivariate normal sphmvn let a = multivariate normal cdf sigma lowl upplDataplot generated the following output. ******************************************************* ** let a = multivariate normal cdf sigma lowl uppl ** ******************************************************* THE COMPUTED VALUE OF THE CONSTANT A = 0.28695473E-02 ************************************** ** set multivariate normal kromvn ** ************************************** THE FORTRAN COMMON CHARACTER VARIABLE MULTNORM HAS JUST BEEN SET TO KROM ******************************************************* ** let a = multivariate normal cdf sigma lowl uppl ** ******************************************************* THE COMPUTED VALUE OF THE CONSTANT A = 0.28632688E-02 ************************************** ** set multivariate normal ranmvn ** ************************************** THE FORTRAN COMMON CHARACTER VARIABLE MULTNORM HAS JUST BEEN SET TO RANM ******************************************************* ** let a = multivariate normal cdf sigma lowl uppl ** ******************************************************* THE COMPUTED VALUE OF THE CONSTANT A = 0.28603778E-02 ************************************** ** set multivariate normal sphmvn ** ************************************** THE FORTRAN COMMON CHARACTER VARIABLE MULTNORM HAS JUST BEEN SET TO SPHM ******************************************************* ** let a = multivariate normal cdf sigma lowl uppl ** ******************************************************* ***** WARNING IN MULTIVARIATE NORMAL CDF-- ERROR IS GREATER THAN REQUESTED VALUE OF 0.5000000E-04 THE COMPUTED VALUE OF THE CONSTANT A = 0.28631196E-02
Date created: 5/21/2003 |