bhhh_max

bhhh_max

Functions

double (*BHHH_FUNC) ()
int bhhh_max ()

Description

Functions

BHHH_FUNC ()

double
(*BHHH_FUNC) (double *Param1,
              gretl_matrix *Param2,
              void *Param3,
              int Param4,
              int *Param5);

bhhh_max ()

int
bhhh_max (double *theta,
          int k,
          gretl_matrix *M,
          BHHH_FUNC callback,
          double toler,
          int *fncount,
          int *grcount,
          void *data,
          gretl_matrix *V,
          gretlopt opt,
          PRN *prn);

Maximize likelihood using the BHHH method, implemented via iteration of the Outer Product of the Gradient (OPG) regression with line search.

callback is called to calculate the loglikelihood for the model in question. The parameters passed to this function are: (1) the current array of estimated coefficients; (2) G ; (3) the data pointer; (4) an integer indicator that is 1 if the gradient should be calculated in G , 0 if only the loglikelihood is needed; and (5) an int pointer to receive an error code. The return value from callback should be the loglikelihood (or NADBL on error).

For an example of the use of such a function, see arma.c in the plugin directory of the gretl source.

Parameters

theta

array of adjustable coefficients.

 

k

number of elements in theta .

 

M

T x k matrix to hold the gradient.

 

callback

pointer to function for calculating log-likelihood and score.

 

toler

tolerance for convergence.

 

fncount

location to receive count of function evaluations.

 

grcount

location to receive count of gradient evaluations.

 

data

pointer to be passed to loglik .

 

V

matrix in which to store covariance, or NULL.

 

opt

can include OPT_V for verbose output.

 

prn

printing struct for iteration info (or NULL).

 

Returns

0 on successful completion, non-zero error code otherwise.

Types and Values