Functions
nlspec_destroy_arrays ()
void
nlspec_destroy_arrays (nlspec *s);
oc_set_destroy ()
void
oc_set_destroy (ocset *oc);
nl_calculate_fvec ()
int
nl_calculate_fvec (nlspec *s);
update_coeff_values ()
int
update_coeff_values (const double *x,
nlspec *s);
check_gmm_requirements ()
int
check_gmm_requirements (nlspec *spec);
nlspec_add_orthcond ()
int
nlspec_add_orthcond (nlspec *s,
const char *str,
const DATASET *dset);
nlspec_add_ivreg_oc ()
int
nlspec_add_ivreg_oc (nlspec *s,
int lhv,
const int *rlist,
const double **Z);
nlspec_add_weights ()
int
nlspec_add_weights (nlspec *s,
const char *str);
nlspec_print_gmm_info ()
void
nlspec_print_gmm_info (const nlspec *spec,
PRN *prn);
maybe_add_gmm_residual ()
void
maybe_add_gmm_residual (MODEL *pmod,
const nlspec *spec,
const DATASET *dset);
gmm_add_vcv ()
int
gmm_add_vcv (MODEL *pmod,
nlspec *spec);
gmm_calculate ()
int
gmm_calculate (nlspec *s,
PRN *prn);
gmm_missval_check_etc ()
int
gmm_missval_check_etc (nlspec *s);
Types and Values
parm
typedef struct parm_ parm;
ocset
typedef struct ocset_ ocset;
struct nlspec_
struct nlspec_ {
int ci; /* NLS, MLE or GMM */
int generr; /* error from genr */
int flags; /* numeric or analytic derivatives, etc. */
gretlopt opt; /* can include OPT_V for verbose output; if ci = MLE
can also include OPT_H (Hessian) or OPT_R (QML)
to control the estimator of the variance matrix;
can also include OPT_N to force use of
numerical derivatives.
*/
int dv; /* ID number of dependent variable (NLS) */
int lhtype; /* type of the LHS variable */
char lhname[VNAMELEN]; /* name of LHS var in criterion function */
char hname[VNAMELEN]; /* name of Hessian matrix, if present */
char *parnames; /* user-set names for parameters */
int lhv; /* ID number of LHS series in function being
minimized or maximized... */
gretl_matrix *lvec; /* or LHS vector */
char *nlfunc; /* string representation of function,
expressed in terms of the residuals (NLS,
GMM) or the log-likelihood (MLE)
*/
int nparam; /* number of parameters */
int ncoeff; /* number of coefficients (allows for vector params) */
int nvec; /* number of vector parameters */
int naux; /* number of auxiliary commands */
int ngenrs; /* number of variable-generating formulae */
int iters; /* number of iterations performed */
int fncount; /* number of function evaluations (BFGS) */
int grcount; /* number of gradient evaluations (BFGS) */
int t1; /* starting observation */
int t2; /* ending observation */
int real_t1; /* real starting observation (if sub-sampled) */
int real_t2; /* real ending observation (if sub-sampled) */
int nobs; /* number of observations used */
double crit; /* criterion (minimand or maximand) */
double tol; /* tolerance for stopping iteration */
parm *params; /* array of information on function parameters
(see the parm_ struct above) */
double *fvec; /* function vector */
double *jac; /* Jacobian array */
double *coeff; /* coefficient estimates */
gretl_matrix *Hinv; /* negative inverse of Hessian */
char **aux; /* auxiliary commands */
char *hesscall; /* function call for Hessian */
GENERATOR **genrs; /* variable-generation pointers */
GENERATOR *hgen; /* generator for Hessian */
DATASET *dset; /* pointer to dataset */
PRN *prn; /* printing aparatus */
ocset *oc; /* orthogonality info (GMM) */
char *missmask; /* mask for missing observations */
};