libgretl

libgretl

Synopsis

#define             isnan                               (x)
#define             YMD_READ_FMT
#define             YMD_WRITE_FMT
#define             YMD_WRITE_Y2_FMT
#define             YMD_WRITE_Y4_FMT
#define             gettext_noop                        (String)
#define             _                                   (String)
#define             N_                                  (String)
#define             I_                                  (String)
#define             A_                                  (String)
#define             MAXLINE
#define             MAXLABEL
#define             MAXLEN
#define             MAXDISP
#define             VNAMELEN
#define             OBSLEN
#define             M_PI
#define             M_2PI
#define             SQRT_2_PI
#define             LN_2_PI
#define             LN_SQRT_2_PI
#define             PMAX_NOT_AVAILABLE
#define             screen_zero                         (x)
enum                GretlType;
#define             gretl_scalar_type                   (t)
#define             gretl_ref_type                      (t)
enum                gretlopt;
enum                GretlOp;
enum                ModelSelCriteria;
                    cmplx;
typedef             GRETL_VAR;
typedef             model_data_item;
typedef             ModelTest;
typedef             equation_system;
typedef             VARINFO;
                    DATASET;
                    VMatrix;
                    SAMPLE;
                    ARINFO;
                    MODEL;
                    FITRESID;

Description

Details

isnan()

#  define isnan(x) ((x) != (x))


YMD_READ_FMT

#define YMD_READ_FMT     "%d-%d-%d" 


YMD_WRITE_FMT

#define YMD_WRITE_FMT    "%d-%02d-%02d"


YMD_WRITE_Y2_FMT

#define YMD_WRITE_Y2_FMT "%02d-%02d-%02d"


YMD_WRITE_Y4_FMT

#define YMD_WRITE_Y4_FMT "%04d-%02d-%02d"


gettext_noop()

# define gettext_noop(String) String


_()

# define _(String) gettext (String)


N_()

# define N_(String) gettext_noop (String)


I_()

# define I_(String) iso_gettext (String) 


A_()

# define A_(String) alt_gettext (String)


MAXLINE

#define MAXLINE 16384  /* maximum length of command line */


MAXLABEL

#define MAXLABEL  128  /* maximum length of descriptive labels for variables */


MAXLEN

#define MAXLEN    512  /* max length of regular "long" strings */


MAXDISP

#define MAXDISP    32  /* max length of "display names" for variables */


VNAMELEN

#define VNAMELEN   32  /* space allocated for var names (including termination) */


OBSLEN

#define OBSLEN     16  /* space allocated for obs strings (including termination) */


M_PI

# define M_PI 3.1415926535897932384626432


M_2PI

# define M_2PI 6.2831853071795864769252864


SQRT_2_PI

#define SQRT_2_PI     2.506628274631000502415765284811


LN_2_PI

#define LN_2_PI       1.837877066409345483560659472811


LN_SQRT_2_PI

#define LN_SQRT_2_PI  0.918938533204672741780329736406


PMAX_NOT_AVAILABLE

#define PMAX_NOT_AVAILABLE 666


screen_zero()

#define screen_zero(x)  ((fabs(x) > 1.0e-13)? x : 0.0)


enum GretlType

typedef enum {
    GRETL_TYPE_NONE,
    GRETL_TYPE_BOOL,
    GRETL_TYPE_INT,
    GRETL_TYPE_OBS,
    GRETL_TYPE_LIST,
    GRETL_TYPE_DOUBLE,
    GRETL_TYPE_INT_ARRAY,
    GRETL_TYPE_DOUBLE_ARRAY,
    GRETL_TYPE_STRING,
    GRETL_TYPE_CMPLX_ARRAY,
    GRETL_TYPE_SERIES,
    GRETL_TYPE_MATRIX,
    GRETL_TYPE_STRUCT,
    GRETL_TYPE_SCALAR_REF,
    GRETL_TYPE_SERIES_REF,
    GRETL_TYPE_MATRIX_REF,
    GRETL_TYPE_USERIES,
    GRETL_TYPE_DATE,
    GRETL_TYPE_BUNDLE,
    GRETL_TYPE_BUNDLE_REF,
    GRETL_TYPE_VOID
} GretlType;

GRETL_TYPE_NONE

GRETL_TYPE_BOOL

GRETL_TYPE_INT

GRETL_TYPE_OBS

GRETL_TYPE_LIST

GRETL_TYPE_DOUBLE

GRETL_TYPE_INT_ARRAY

GRETL_TYPE_DOUBLE_ARRAY

GRETL_TYPE_STRING

GRETL_TYPE_CMPLX_ARRAY

GRETL_TYPE_SERIES

GRETL_TYPE_MATRIX

GRETL_TYPE_STRUCT

GRETL_TYPE_SCALAR_REF

GRETL_TYPE_SERIES_REF

GRETL_TYPE_MATRIX_REF

GRETL_TYPE_USERIES

GRETL_TYPE_DATE

GRETL_TYPE_BUNDLE

GRETL_TYPE_BUNDLE_REF

GRETL_TYPE_VOID


gretl_scalar_type()

#define             gretl_scalar_type(t)


gretl_ref_type()

#define             gretl_ref_type(t)


enum gretlopt

typedef enum {
    OPT_NONE = 0,
    OPT_A = 1 <<  0,
    OPT_B = 1 <<  1,
    OPT_C = 1 <<  2,
    OPT_D = 1 <<  3,
    OPT_E = 1 <<  4,
    OPT_F = 1 <<  5,
    OPT_G = 1 <<  6,
    OPT_H = 1 <<  7,
    OPT_I = 1 <<  8,
    OPT_J = 1 <<  9,
    OPT_K = 1 << 10,
    OPT_L = 1 << 11,
    OPT_M = 1 << 12,
    OPT_N = 1 << 13,
    OPT_O = 1 << 14,
    OPT_P = 1 << 15,
    OPT_Q = 1 << 16,
    OPT_R = 1 << 17,
    OPT_S = 1 << 18,
    OPT_T = 1 << 19,
    OPT_U = 1 << 20,
    OPT_V = 1 << 21,
    OPT_W = 1 << 22,
    OPT_X = 1 << 23,
    OPT_Z = 1 << 24,
    OPT_Y = 1 << 25,
    OPT_UNSET = 1 << 30
} gretlopt;

OPT_NONE

OPT_A

OPT_B

OPT_C

OPT_D

OPT_E

OPT_F

OPT_G

OPT_H

OPT_I

OPT_J

OPT_K

OPT_L

OPT_M

OPT_N

OPT_O

OPT_P

OPT_Q

OPT_R

OPT_S

OPT_T

OPT_U

OPT_V

OPT_W

OPT_X

OPT_Z

OPT_Y

OPT_UNSET


enum GretlOp

typedef enum {
    OP_EQ  = '=',
    OP_GT  = '>',
    OP_LT  = '<',
    OP_NEQ = 21,
    OP_GTE = 22,
    OP_LTE = 23
} GretlOp;

OP_EQ

OP_GT

OP_LT

OP_NEQ

OP_GTE

OP_LTE


enum ModelSelCriteria

typedef enum {
    C_AIC,
    C_BIC,
    C_HQC,
    C_MAX
} ModelSelCriteria;

C_AIC

C_BIC

C_HQC

C_MAX


cmplx

typedef struct {
    double r;
    double i;
} cmplx;


GRETL_VAR

typedef struct GRETL_VAR_ GRETL_VAR;


model_data_item

typedef struct model_data_item_ model_data_item;


ModelTest

typedef struct ModelTest_ ModelTest;


equation_system

typedef struct equation_system_ equation_system;


VARINFO

typedef struct VARINFO_ VARINFO;

Holds extended private information on an individual data series.


DATASET

typedef struct {
    int v;              /* number of variables */
    int n;              /* number of observations */
    int pd;             /* periodicity or frequency of data */
    int structure;      /* time series, cross section or whatever */
    double sd0;         /* float representation of stobs */
    int t1, t2;         /* start and end of current sample */
    char stobs[OBSLEN];  /* string representation of starting obs (date) */
    char endobs[OBSLEN]; /* string representation of ending obs */
    double **Z;         /* data array */
    char **varname;     /* array of names of variables */
    VARINFO **varinfo;  /* array of specific info on vars */
    char markers;       /* NO_MARKERS (0), REGULAR MARKERS or DAILY_DATE_STRINGS */
    char **S;           /* to hold observation markers */
    char *descrip;      /* to hold info on data sources etc. */
    char *submask;      /* subsampling mask */
    char *restriction;  /* record of sub-sampling restriction */
    char *padmask;      /* record of padding to re-balance panel data */
    int auxiliary;      /* = 0 for regular dataset, 1 for aux dataset */
    char *pangrps;      /* panel-only: name of series holding group names */
    int panel_pd;       /* panel-only: panel time-series frequency */
    double panel_sd0;   /* panel-only: time-series start */
} DATASET;


VMatrix

typedef struct {
    int ci;
    int dim;
    int t1, t2, n;
    char **names;
    double *vec;
    int *list;
    int missing;
} VMatrix;


SAMPLE

typedef struct {
    int t1;
    int t2;
} SAMPLE;


ARINFO

typedef struct {
    int *arlist;          /* list of autoreg lags */
    double *rho;          /* array of autoreg. coeffs. */
    double *sderr;        /* and their standard errors */
} ARINFO;


MODEL

typedef struct {
    int ID;                      /* ID number for model */
    int refcount;                /* for saving/deleting */
    int ci;                      /* "command index" -- estimation method */
    gretlopt opt;                /* record of options */
    int t1, t2, nobs;            /* starting observation, ending
                                    observation, and number of obs */
    char *submask;               /* keep track of sub-sample in force
                                    when model was estimated */
    char *missmask;              /* missing observations mask */
    SAMPLE smpl;                 /* numeric start and end of current sample
                                    when model was estimated */
    int full_n;                  /* full length of dataset on estimation */
    int ncoeff, dfn, dfd;        /* number of coefficents; degrees of
                                    freedom in numerator and denominator */
    int *list;                   /* list of variables by ID number */
    int ifc;                     /* = 1 if the equation includes a constant,
				    else = 0 */
    int nwt;                     /* ID number of the weight variable (WLS) */
    int aux;                     /* code representing the sort of
				    auxiliary regression this is (or not) */
    double *coeff;               /* array of coefficient estimates */
    double *sderr;               /* array of estimated std. errors */
    double *uhat;                /* regression residuals */
    double *yhat;                /* fitted values from regression */
    double *xpx;                 /* X'X matrix, in packed form */
    double *vcv;                 /* VCV matrix for coefficient estimates */
    double ess, tss;             /* Error and Total Sums of Squares */
    double sigma;                /* Standard error of regression */
    double rsq, adjrsq;          /* Unadjusted and adjusted R^2 */     
    double fstt;                 /* overall F-statistic */
    double chisq;                /* overall chi-square statistic */
    double lnL;                  /* log-likelihood */
    double ybar, sdy;            /* mean and std. dev. of dependent var. */
    double criterion[C_MAX];     /* array of model selection statistics */
    double dw, rho;              /* Durbin-Watson stat. and estimated 1st
				    order autocorrelation coefficient */
    ARINFO *arinfo;              /* pointer to struct to hold special info for 
				    autoregressive model */ 
    int errcode;                 /* Error code in case of failure */
    char *name;                  /* for use in GUI */
    char *depvar;                /* name of dependent var in special cases */
    int nparams;                 /* number of named model parameters */
    char **params;               /* for named model parameters */
    int ntests;                  /* number of attached test results */
    ModelTest *tests;            /* attached hypothesis test results */
    DATASET *dataset;            /* for handling models estimated on a
				    sub-sampled portion of the dataset */
    int n_data_items;            /* number of extra data items */
    model_data_item **data_items; /* pointer to additional data */
} MODEL;


FITRESID

typedef struct {
    int model_ID;   /* ID of model on which forecast is based */
    int asymp;      /* 0/1 flag for asymptotic estimator */
    int std;        /* 0/1 flag for standardized residuals */
    int model_t1;   /* start of model estimation range */
    int method;     /* one of the ForecastMethod options */
    double *actual; /* array of values of dependent variable */
    double *fitted; /* array of fitted values */
    double *resid;  /* array of residuals */
    double *sderr;  /* array of forecast standard errors (or NULL) */
    double sigma;   /* standard error of regression */
    double alpha;   /* for confidence intervals */
    int pmax;       /* if positive, suggested number of decimal places
                       for use in printing */
    int df;         /* degrees of freedom for model */
    int t0;         /* start of pre-forecast data range */
    int t1;         /* start of forecast range */
    int t2;         /* end of forecast range */
    int k;          /* number of steps ahead (method = FC_KSTEP only) */
    int nobs;       /* length of the arrays actual, fitted, resid */
    char depvar[VNAMELEN]; /* name of dependent variable */
} FITRESID;