Vectorized Bivariate Normal CDF

Provides a vectorized R function for calculating probabilities from a standard bivariate normal CDF.


Vectorized bivariate normal CDF

pbivnorm is an R package containing a vectorized function to compute the bivariate normal CDF. It is based on the mnormt package by Adelchi Azzalini, which uses Fortran code by Alan Genz to compute integrals of multivariate normal densities.

A call to pbivnorm() produces identical output to a corresponding set of calls to mnormt::pmnorm(), but at lower computational cost due to vectorization (i.e., looping in Fortran rather than in R).

R> library("pbivnorm")
R> library("mnormt")
R> set.seed(9497)
R> x1 <- rnorm(10)
R> x2 <- rnorm(10)
R> X <- cbind(x1, x2)
R> all.equal(pbivnorm(X), apply(X, 1, pmnorm, mean = c(0, 0), varcov = diag(2)))
## [1] TRUE

R> library("microbenchmark")
R> microbenchmark(pbivnorm = pbivnorm(X),
   mnormt = apply(X, 1, pmnorm, mean = c(0, 0), varcov = diag(2)))
## Unit: microseconds
##      expr      min       lq   median       uq     max neval
##  pbivnorm   59.373   61.851   66.987   73.373  140.38   100
##    mnormt 1052.671 1074.699 1091.472 1120.907 2283.88   100

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pbivnorm")

0.6.0 by Brenton Kenkel, 12 years ago


https://github.com/brentonk/pbivnorm


Browse source code at https://github.com/cran/pbivnorm


Authors: Fortran code by Alan Genz. R code by Brenton Kenkel , based on Adelchi Azzalini's 'mnormt' package.


Documentation:   PDF Manual  


GPL (>= 2) license



Imported by DiceOptim, GPareto, GeoModels, KrigInv, PanelSelect, ROCModels, ROCnReg, SemiPar.depCens, bizicount, cSEM, clordr, ctmm, depCensoring, discnorm, endogeneity, lavaan, lillardhaz, micemd, mvord, pGPx, plssem, semTools, sigInt, twoCoprimary.

Depended on by StratSel.

Suggested by iop, sirt.

Enhanced by pbv.


See at CRAN