genmain

genmain —

Synopsis




enum        RetrievalIndex;
enum        ModelDataIndex;
#define     model_data_scalar               (i)
#define     model_data_series               (i)
#define     model_data_matrix               (i)
typedef     GENERATOR;
int         generate                        (const char *line,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             gretlopt opt,
                                             PRN *prn);
GENERATOR*  genr_compile                    (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);
int         execute_genr                    (GENERATOR *genr,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);
void        destroy_genr                    (GENERATOR *genr);
int         genr_get_output_varnum          (const GENERATOR *genr);
gretl_matrix* genr_get_output_matrix        (const GENERATOR *genr);
int         varindex                        (const DATAINFO *pdinfo,
                                             const char *varname);
int         genr_fit_resid                  (const MODEL *pmod,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int code,
                                             int undo);
double      generate_scalar                 (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);
double*     generate_series                 (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);
int         print_object_var                (const char *oname,
                                             const char *param,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);
int         gretl_reserved_word             (const char *str);
void        genr_set_na_check               (GENERATOR *genr);
void        genr_unset_na_check             (GENERATOR *genr);
int         function_from_string            (const char *s);
int         const_lookup                    (const char *s);

Description

Details

enum RetrievalIndex

typedef enum {
    R_NOBS = 1,   /* number of observations in current sample range */
    R_NVARS,      /* number of variables in dataset (including the constant) */
    R_PD,         /* periodicity of dataset */
    R_T1,         /* start of current sample range */
    R_T2,         /* end of current sample range */
    R_DSET_MAX,   /* separator */
    R_TEST_STAT,  /* test statistic from last explicit test performed */
    R_TEST_PVAL,  /* p-value from last explicit test performed */
    R_STOPWATCH,  /* stopwatch */ 
    R_SCALAR_MAX, /* separator: scalars vs series */
    R_INDEX,      /* consecutive observations index */
    R_MAX
} RetrievalIndex;


enum ModelDataIndex

typedef enum {
    M_ESS = R_MAX + 1, /* error sum of squares */
    M_T,          /* observations used */
    M_RSQ,        /* R-squared */
    M_SIGMA,      /* standard error of residuals */
    M_DF,         /* degrees of freedom */
    M_NCOEFF,     /* total number of estimated coefficients */
    M_LNL,        /* log-likelihood */
    M_AIC,        /* Akaike info criterion */
    M_BIC,        /* Bayesian info criterion */
    M_HQC,        /* Hannan-Quinn criterion */
    M_TRSQ,       /* T * R-squared, last model */
    M_SCALAR_MAX, /* -- separator -- */
    M_UHAT,       /* residuals */
    M_YHAT,       /* fitted values */
    M_AHAT,       /* per-unit intercepts in panel model */
    M_H,          /* GARCH predicted variances */
    M_SERIES_MAX, /* -- separator -- */
    M_COEFF,      /* parameter estimates */
    M_SE,         /* parameter standard errors */
    M_VCV,        /* parameter covariance matrix */
    M_RHO,        /* autoregressive coefficients */
    M_OLDMAT_MAX, /* -- separator -- */
    M_JALPHA,     /* Johansen's alpha */
    M_JBETA,      /* Johansen's beta */
    M_JVBETA,     /* Covariance matrix for Johansen's normalised beta */
    M_JS00,       /* VECM residual covariance matrix (1st differences) */
    M_JS11,       /* VECM residual covariance matrix (levels) */
    M_JS01,       /* VECM residual cross-product matrix */
    M_MAX         /* sentinel */
} ModelDataIndex;


model_data_scalar()

#define model_data_scalar(i) (i > R_MAX && i < M_SCALAR_MAX)

i :

model_data_series()

#define model_data_series(i) (i > M_SCALAR_MAX && i < M_SERIES_MAX)

i :

model_data_matrix()

#define model_data_matrix(i) (i > M_SERIES_MAX && i < M_MAX)

i :

GENERATOR

typedef struct parser_ GENERATOR;


generate ()

int         generate                        (const char *line,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             gretlopt opt,
                                             PRN *prn);

line :
pZ :
pdinfo :
opt :
prn :
Returns :

genr_compile ()

GENERATOR*  genr_compile                    (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);

s :
pZ :
pdinfo :
err :
Returns :

execute_genr ()

int         execute_genr                    (GENERATOR *genr,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);

genr :
pZ :
pdinfo :
prn :
Returns :

destroy_genr ()

void        destroy_genr                    (GENERATOR *genr);

genr :

genr_get_output_varnum ()

int         genr_get_output_varnum          (const GENERATOR *genr);

genr :
Returns :

genr_get_output_matrix ()

gretl_matrix* genr_get_output_matrix        (const GENERATOR *genr);

genr :
Returns :

varindex ()

int         varindex                        (const DATAINFO *pdinfo,
                                             const char *varname);

pdinfo : data information struct.
varname : name of variable to test.
Returns : the ID number of the variable whose name is given, or the next available ID number if there is no variable of that name.

genr_fit_resid ()

int         genr_fit_resid                  (const MODEL *pmod,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int code,
                                             int undo);

Adds residuals or fitted values or squared residuals from a given model to the data set.

pmod :
pZ :
pdinfo :
code :
undo :
Returns :

generate_scalar ()

double      generate_scalar                 (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);

s :
pZ :
pdinfo :
err :
Returns :

generate_series ()

double*     generate_series                 (const char *s,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             int *err);

s :
pZ :
pdinfo :
err :
Returns :

print_object_var ()

int         print_object_var                (const char *oname,
                                             const char *param,
                                             double ***pZ,
                                             DATAINFO *pdinfo,
                                             PRN *prn);

oname :
param :
pZ :
pdinfo :
prn :
Returns :

gretl_reserved_word ()

int         gretl_reserved_word             (const char *str);

str : string to be tested.
Returns : non-zero if str is a reserved word that cannot figure as the name of a user-defined variable, otherwise 0.

genr_set_na_check ()

void        genr_set_na_check               (GENERATOR *genr);

genr :

genr_unset_na_check ()

void        genr_unset_na_check             (GENERATOR *genr);

genr :

function_from_string ()

int         function_from_string            (const char *s);

s : the string to look up.
Returns : 1 if there is a function corresponding to the name s, or 0 if there is no such function.

const_lookup ()

int         const_lookup                    (const char *s);

s :
Returns :