Learn R Programming

sirt (version 4.1-15)

pbivnorm2: Cumulative Function for the Bivariate Normal Distribution

Description

This function evaluates the bivariate normal distribution \(\Phi_2 ( x, y ; \rho )\) assuming zero means and unit variances. It uses a simple approximation by Cox and Wermuth (1991) with corrected formulas in Hong (1999).

Usage

pbivnorm2(x, y, rho)

Value

Vector of probabilities

Arguments

x

Vector of \(x\) coordinates

y

Vector of \(y\) coordinates

rho

Vector of correlations between random normal variates

References

Cox, D. R., & Wermuth, N. (1991). A simple approximation for bivariate and trivariate normal integrals. International Statistical Review, 59(2), 263-269.

Hong, H. P. (1999). An approximation to bivariate and trivariate normal integrals. Engineering and Environmental Systems, 16(2), 115-127. tools:::Rd_expr_doi("10.1080/02630259908970256")

See Also

See also the pbivnorm::pbivnorm function in the pbivnorm package.

Examples

Run this code
library(pbivnorm)
# define input
x <- c(0, 0,  .5, 1, 1  )
y <- c( 0, -.5,  1, 3, .5 )
rho <- c( .2, .8, -.4, .6, .5 )
# compare pbivnorm2 and pbivnorm functions
pbiv2 <- sirt::pbivnorm2( x=x, y=y, rho=rho )
pbiv <- pbivnorm::pbivnorm(  x,  y, rho=rho )
max( abs(pbiv-pbiv2))
  ## [1] 0.0030626
round( cbind( x, y, rho,pbiv, pbiv2 ), 4 )
  ##          x    y  rho   pbiv  pbiv2
  ##   [1,] 0.0  0.0  0.2 0.2820 0.2821
  ##   [2,] 0.0 -0.5  0.8 0.2778 0.2747
  ##   [3,] 0.5  1.0 -0.4 0.5514 0.5514
  ##   [4,] 1.0  3.0  0.6 0.8412 0.8412
  ##   [5,] 1.0  0.5  0.5 0.6303 0.6304

Run the code above in your browser using DataLab