pbivnorm: Standard bivariate normal CDF

Description Usage Arguments Details Value Author(s) References Examples

View source: R/pbivnorm.r

Description

Calculate probabilities from the CDF of a standard bivariate normal distribution.

Usage

1
pbivnorm(x, y, rho = 0, recycle = TRUE)

Arguments

x

vector of upper integration limits for the CDF. May also be a two-column matrix, in which case y should not be used.

y

vector of upper integration limits.

rho

correlation parameter.

recycle

whether to automatically recycle the vectors x, y, and rho to conform to whichever is longest. If FALSE, all three must be the same length.

Details

This function returns values identical to those of biv.nt.prob in the mnormt package, but is vectorized to reduce the number of Fortran calls required for computation of many probabilities.

Value

Numeric vector of probabilities.

Author(s)

Fortran code by Alan Genz (see references). R interface by Brenton Kenkel (brenton.kenkel@gmail.com), based on code from Adelchi Azzalini's mnormt package.

References

Genz, A. (1992). Numerical Computation of Multivariate Normal Probabilities. J. Computational and Graphical Statist., 1, 141–149.

Genz, A. (1993). Comparison of methods for the computation of multivariate normal probabilities. Computing Science and Statistics, 25, 400–405.

Genz, A. Fortran code for MVTDSTPACK available at http://www.math.wsu.edu/math/faculty/genz/software/fort77/mvtdstpack.f (as of 2011-02-21).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- rnorm(10)
y <- rnorm(10)
rho <- runif(10)

pbivnorm(x, y, rho)

X <- cbind(x, y)
pbivnorm(X, rho = rho)

## rho can be a single value, unless recycling is disallowed
rho <- runif(1)
pbivnorm(x, y, rho)

Example output

 [1] 0.21968238 0.07716540 0.14997004 0.54812878 0.66021502 0.39766409
 [7] 0.20347588 0.40154448 0.48737310 0.04510075
 [1] 0.21968238 0.07716540 0.14997004 0.54812878 0.66021502 0.39766409
 [7] 0.20347588 0.40154448 0.48737310 0.04510075
 [1] 0.13385114 0.08531803 0.14100229 0.52786189 0.64445507 0.39226041
 [7] 0.18077490 0.38958464 0.48734081 0.04481439

pbivnorm documentation built on May 2, 2019, 4:22 a.m.