gretl_normal

gretl_normal

Functions

double invmills ()
double bvnorm_cdf ()
gretl_matrix * gretl_GHK ()
gretl_matrix * gretl_GHK2 ()

Description

Functions

invmills ()

double
invmills (double x);

Adapted by putting together code from gsl and TDA (Univ. Bochum). The latter is, in turn, based on A. V. Swan, The Reciprocal of Mills's Ratio, Algorithm AS 17, Journal of the Royal Statistical Society. Series C (Applied Statistics), Vol. 18, No. 1 (1969), 115-116.

Parameters

x

double-precision value.

 

Returns

the inverse Mills ratio, that is the ratio between the normal density function and the complement of the distribution function, both evaluated at x .


bvnorm_cdf ()

double
bvnorm_cdf (double rho,
            double a,
            double b);

Parameters

rho

correlation coefficient.

 

a

abscissa value, first Gaussian r.v.

 

b

abscissa value, second Gaussian r.v.

 

Returns

for (x, y) a bivariate standard Normal rv with correlation coefficient rho , the joint probability that (x < a ) and (y < b ), or NADBL on failure.


gretl_GHK ()

gretl_matrix *
gretl_GHK (const gretl_matrix *C,
           const gretl_matrix *A,
           const gretl_matrix *B,
           const gretl_matrix *U,
           int *err);

Computes the GHK (Geweke, Hajivassiliou, Keane) approximation to the multivariate normal distribution function for n observations on m variates, using r draws.

Parameters

C

Cholesky decomposition of covariance matrix, lower triangular, m x m.

 

A

Lower bounds, n x m; in case a lower bound is minus infinity this should be represented as -1.0E10.

 

B

Upper bounds, n x m; in case an upper bound is plus infinity this should be represented as +1.0E10.

 

U

Uniform random matrix, m x r.

 

Returns

an n x 1 vector of probabilities.


gretl_GHK2 ()

gretl_matrix *
gretl_GHK2 (const gretl_matrix *C,
            const gretl_matrix *A,
            const gretl_matrix *B,
            const gretl_matrix *U,
            gretl_matrix *dP,
            int *err);

Types and Values