# lncdfbvn2¶

## Purpose¶

Returns natural log of standardized bivariate Normal cumulative distribution function of a bounded rectangle.

## Format¶

lnp = lncdfbvn2(h, dh, k, dk, corr)
Parameters: h (Nx1 vector) – upper limits of integration for variable 1. dh (Nx1 vector) – increments for variable 1. k (Nx1 vector) – upper limits of integration for variable 2. dk (Nx1 vector) – increments for variable 2. corr (Nx1 vector) – correlation coefficients between the two variables. lnp (Nx1 vector) – the log of the integral from h, k to h+dh, k+dk of the standardized bivariate Normal distribution.

## Examples¶

### Example 1¶

// Upper limits of integration for variable 1
h = 1;

// Increment for variable 1
dh = 1;

// Upper limits of integration for variable 2
k = 1;

// Increment for variable 2
dk = 1;

// Correlation
corr = 0.5;

lncdfbvn2(h, dh, k, dk, corr);


produces

-3.2180110258198771e+000


### Example 2¶

trap 0, 2;
// Upper limits of integration for variable 1
h = 1;

// Increment for variable 1
dh = 1e-15;

// Upper limits of integration for variable 2
k = 1;

// Increment for variable 2
dk = 1e-15;

// Correlation
corr = 0.5;

lncdfbvn2(h, dh, k, dk, corr);


produces

-7.098869e+001


### Example 3¶

trap 2,2;
// Upper limits of integration for variable 1
h = 1;

// Increment for variable 1
dh = 1e-45;

// Upper limits of integration for variable 2
k = 1;

// Increment for variable 2
dk = 1e-45;

// Correlation
corr = 0.5;

lncdfbvn2(h, dh, k, dk, corr);


produces

WARNING: Dubious accuracy from lncdfbvn2:
0.000e+000 +/- 2.8e-060
-INF


## Remarks¶

Scalar input arguments are okay; they will be expanded to Nx1 vectors.

lncdfbvn2() will abort if the computed integral is negative.

lncdfbvn2() computes an error estimate for each set of inputs-the real integral is $$exp(y) \pm err$$. The size of the error depends on the input arguments. If trap 2 is set, a warning message is displayed when $$err \geq= exp(y)/100$$.

For an estimate of the actual error, see cdfBvn2e().