Top |
GRETL_VAR * gretl_VAR (int order
,int *laglist
,int *list
,const DATASET *dset
,gretlopt opt
,PRN *prn
,int *err
);
Estimate a vector auto-regression (VAR), print and save the results.
order |
lag order for the VAR. |
|
laglist |
specific list of lags, or NULL. |
|
list |
specification for the first model in the set. |
|
dset |
dataset struct. |
|
opt |
if includes |
|
prn |
gretl printing struct. |
|
err |
location to receive error code. |
GRETL_VAR * gretl_VECM (int order
,int rank
,int *list
,const DATASET *dset
,gretlopt opt
,PRN *prn
,int *err
);
order |
lag order. |
|
rank |
cointegration rank. |
|
list |
list of endogenous variables, possibly plus exogenous variables. |
|
dset |
dataset struct. |
|
opt |
may include OPT_N ("nc"), OPT_R ("rc"), OPT_A ("crt"), OPT_T ("ct"), OPT_D (include seasonals), OPT_F (show variance decompositions), OPT_I (show impulse responses), OPT_V (verbose operation), OPT_Q (quiet), OPT_S (silent). |
|
prn |
gretl printing struct. |
|
err |
location to receive error code. |
int gui_VAR_lagsel (int order
,int *list
,const DATASET *dset
,gretlopt opt
,PRN *prn
,gretl_matrix **pm
);
const gretl_matrix * gretl_VAR_get_forecast_matrix (GRETL_VAR *var
,int t1
,int t2
,DATASET *dset
,gretlopt opt
,int *err
);
const gretl_matrix *
gretl_VAR_get_residual_matrix (const GRETL_VAR *var
);
gretl_matrix * gretl_VAR_get_fcast_decomp (const GRETL_VAR *var
,int targ
,int periods
,int *errp
);
gretl_matrix * gretl_VAR_get_vma_matrix (const GRETL_VAR *var
,const DATASET *dset
,int *err
);
gretl_matrix * gretl_VAR_get_FEVD_matrix (const GRETL_VAR *var
,int targ
,int shock
,int horizon
,const DATASET *dset
,int *err
);
gretl_matrix * gretl_VAR_get_full_FEVD_matrix (const GRETL_VAR *var
,const DATASET *dset
,int *err
);
gretl_matrix * gretl_FEVD_from_bundle (gretl_bundle *b
,int targ
,int shock
,const DATASET *dset
,int *err
);
gretl_matrix * gretl_IRF_from_bundle (gretl_bundle *b
,int targ
,int shock
,double alpha
,const DATASET *dset
,int *err
);
gretl_matrix * VECM_get_EC_matrix (const GRETL_VAR *v
,const DATASET *dset
,int *err
);
int gretl_VAR_do_error_decomp (const gretl_matrix *S
,gretl_matrix *C
,const gretl_matrix *ord
);
int gretl_VAR_autocorrelation_test (GRETL_VAR *var
,int order
,DATASET *dset
,gretlopt opt
,PRN *prn
);
int gretl_VAR_arch_test (GRETL_VAR *var
,int order
,DATASET *dset
,gretlopt opt
,PRN *prn
);
int gretl_VAR_normality_test (const GRETL_VAR *var
,gretlopt opt
,PRN *prn
);
GRETL_VAR * gretl_VAR_omit_test (GRETL_VAR *var
,const int *omitlist
,DATASET *dset
,gretlopt opt
,PRN *prn
,int *err
);
Re-estimates a given VAR after removing the variables
specified in omitlist
, and reports per-equation F-tests
and system-wide LR tests for the null hypothesis that
the omitted variables have zero parameters.
int gretl_VAR_wald_omit_test (GRETL_VAR *var
,const int *omitlist
,DATASET *dset
,gretlopt opt
,PRN *prn
);
Runs a Wald test for the joint omission of the exogenous
variables specified in omitlist
.
double * gretl_VECM_get_EC (GRETL_VAR *vecm
,int j
,const DATASET *dset
,int *err
);
gretl_matrix * gretl_VAR_get_impulse_response (GRETL_VAR *var
,int targ
,int shock
,int periods
,double alpha
,const DATASET *dset
,int *err
);
Computes the response of targ
to a perturbation of shock
in the context of var
: targ
and shock
are zero-based indices
relative to the structure of var
. For example if targ
= 0 and
shock
= 1, we compute the response of the dependent variable in
the first VAR equation to a perturbation of the variable that
appears as dependent in the second VAR equation.
If alpha
is zero, the response matrix returned is a column vector
of length periods
, giving the point estimate of the response
function. Otherwise, the response matrix returned has
three columns, containing the point estimate, the alpha
/ 2
quantile and the 1 - alpha
/ 2 quantile, where the quantiles
are based on bootstrap replication, with resampling of the
original residuals with replacement.
var |
pointer to VAR struct. |
|
targ |
index of the target or response variable. |
|
shock |
index of the source or shock variable. |
|
periods |
number of periods over which to compute the response. |
|
alpha |
determines confidence level for bootstrap interval. |
|
dset |
dataset struct. |
|
err |
location to receive error code. |
double * gretl_VAR_get_resid_series (GRETL_VAR *var
,int eqnum
,int *err
);
GRETL_VAR * johansen_test (int order
,const int *list
,const DATASET *dset
,gretlopt opt
,PRN *prn
);
Carries out the Johansen test for cointegration.
order |
lag order for test. |
|
list |
list of variables to test for cointegration. |
|
dset |
dataset struct. |
|
opt |
|
|
prn |
gretl printing struct. |
int johansen_test_simple (int order
,const int *list
,const DATASET *dset
,gretlopt opt
,PRN *prn
);
Carries out the Johansen test for cointegration and prints the
results (but unlike johansen_test()
, does not return the
allocated results in VAR form).
order |
lag order for test. |
|
list |
list of variables to test for cointegration. |
|
dset |
dataset struct. |
|
opt |
|
|
prn |
gretl printing struct. |
int gretl_VECM_test (GRETL_VAR *vecm
,gretl_restriction *rset
,const DATASET *dset
,gretlopt opt
,PRN *prn
);
int gretl_VAR_test (GRETL_VAR *var
,gretl_restriction *rset
,const DATASET *dset
,gretlopt opt
,PRN *prn
);
GRETL_VAR * real_gretl_restricted_vecm (GRETL_VAR *orig
,gretl_restriction *rset
,const DATASET *dset
,PRN *prn
,int *err
);
orig |
orginal VECM model. |
|
rset |
restriction information. |
|
dset |
dataset struct. |
|
prn |
gretl printing struct. |
|
err |
location to receive error code. |
pointer to struct containing information on
the newly restricted VECM system or NULL
on failure.
double * gretl_VAR_get_series (const GRETL_VAR *var
,const DATASET *dset
,int idx
,const char *key
,int *err
);
gretl_matrix * gretl_VAR_get_matrix (const GRETL_VAR *var
,int idx
,int *err
);
void gretl_VAR_param_names (GRETL_VAR *v
,char **params
,const DATASET *dset
);
int gretl_VAR_serialize (const GRETL_VAR *var
,SavedObjectFlags flags
,PRN *prn
);
int gretl_VAR_bundlize (const GRETL_VAR *var
,DATASET *dset
,gretl_bundle *b
);
int transcribe_VAR_models (GRETL_VAR *var
,const DATASET *dset
,const gretl_matrix *XTX
);
GRETL_VAR * gretl_VAR_from_XML (xmlNodePtr node
,xmlDocPtr doc
,const DATASET *dset
,int *err
);
struct GRETL_VAR_ { int ci; /* command index (VAR or VECM) */ int refcount; /* for saving/deleting */ int err; /* error code */ int neqns; /* number of equations in system */ int order; /* maximum lag order */ int t1; /* starting observation */ int t2; /* ending observation */ int T; /* number of observations */ int df; /* T - average coeffs per equation */ int ifc; /* equations include a constant (1) or not (0) */ int ncoeff; /* total coefficients per equation */ int *lags; /* list of specific lags */ int *ylist; /* list of stochastic vars */ int *xlist; /* list of exogenous variables */ int *rlist; /* restricted exogenous variables (VECM only) */ int detflags; /* record of automatic deterministic vars added */ int robust; /* computing robust std errors? */ int xcols; /* full column size of X matrix (VECM special) */ gretl_matrix *Y; /* matrix of dependent variables */ gretl_matrix *X; /* matrix of independent variables */ gretl_matrix *B; /* basic coefficient matrix */ gretl_matrix *XTX; /* X'X inverse */ gretl_matrix *A; /* augmented coefficient matrix (companion form) */ gretl_matrix *L; /* lambda: inverse roots of A(L) polynomial */ gretl_matrix *E; /* residuals matrix */ gretl_matrix *C; /* Cholesky-decomposed covariance matrix */ gretl_matrix *S; /* cross-equation variance matrix */ gretl_matrix *F; /* optional forecast matrix */ gretl_matrix *V; /* full parameter covariance matrix */ gretl_matrix *ord; /* optional Cholesky-ordering vector */ MODEL **models; /* pointers to individual equation estimates */ double *Fvals; /* hold results of F-tests */ double *Ivals; /* hold results of info criteria comparisons */ double ldet; /* log-determinant of S */ double ll; /* log-likelihood */ double AIC; /* Akaike criterion */ double BIC; /* Bayesian criterion */ double HQC; /* Hannan-Quinn criterion */ double LR; /* for likelihood-ratio testing */ double LB; /* Ljung-Box (Portmanteau) test statistic */ int LBs; /* order for Portmanteau test */ JohansenInfo *jinfo; /* extra information for VECMs */ char *name; /* for use in session management */ };