Top |
int | default_lag_order () |
int | standard_lag_of () |
int | is_standard_diff () |
int | diffgenr () |
int | laggenr () |
int | loggenr () |
int | invgenr () |
int | xpxgenr () |
int | list_diffgenr () |
int | list_orthdev () |
int | list_resample () |
int | list_dropcoll () |
int | list_laggenr () |
int * | laggenr_from_to () |
int | list_loggenr () |
int | list_stdgenr () |
int | list_xpxgenr () |
int | list_dumgenr () |
int | dumgenr_with_oddval () |
int | auto_dummify_list () |
int | list_makediscrete () |
int | hf_list_diffgenr () |
void | gretl_transforms_cleanup () |
Functions to generate standard transformations (logs, lags, first differences and so on) of series in the dataset.
int standard_lag_of (int v
,int parent
,const DATASET *dset
);
int is_standard_diff (int v
,const DATASET *dset
,int *parent
);
int diffgenr (int v
,int ci
,DATASET *dset
);
Creates the first difference (or log- or seasonal difference,
depending on the value of ci
) of variable v
, if the
differenced variable does not already exist.
int laggenr (int v
,int lag
,DATASET *dset
);
Creates the specified lag of variable v
if this variable does
not already exist.
int loggenr (int v
,DATASET *dset
);
Creates the natural log of variable v
if this variable does
not already exist.
int invgenr (int v
,DATASET *dset
);
Creates the reciprocal of variable v
if this variable does
not already exist.
int xpxgenr (int vi
,int vj
,DATASET *dset
);
Creates the cross product of variables vi
and vj
if this
variable does not already exist.
int list_diffgenr (int *list
,int ci
,DATASET *dset
);
Generate differences of the variables in list
, and add them
to the data set. If ci
is DIFF these are ordinary first
differences; if ci
is LDIFF they are log differences; and
if ci
is SDIFF they are seasonal differences.
int list_orthdev (int *list
,DATASET *dset
);
Generate orthogonal deviations of the variables in list
, and add
them to the data set.
int list_dropcoll (int *list
,double eps
,DATASET *dset
);
Drop collinear variables from list
.
int list_laggenr (int **plist
,int lmin
,int lmax
,const gretl_matrix *lvec
,DATASET *dset
,int compfac
,gretlopt opt
);
Generates and adds to the data set lagged values of the
variables given in the list pointed to by plist
.
plist |
on entry, pointer to list of variables to process. On exit the list holds the ID numbers of the lag variables. |
|
lmin |
minimum lag to include (defaults to 1). |
|
lmax |
maximum lag to include (or 0 for automatic). |
|
lvec |
(alternative to |
|
dset |
dataset struct. |
|
compfac |
compaction factor (for MIDAS lists only, otherwise give 0). |
|
opt |
may contain OPT_L to order the list by lag rather than by variable. |
int * laggenr_from_to (int v
,int fromlag
,int tolag
,DATASET *dset
,int *err
);
Creates the specified lags of variable v
if they do not
already exist.
int list_loggenr (int *list
,DATASET *dset
);
Generates and adds to the data set the natural logs of the
variables given in list
.
int list_stdgenr (int *list
,DATASET *dset
,gretlopt opt
);
Generates and adds to the dataset standardized versions
of the series given in list
.
int list_xpxgenr (int **plist
,DATASET *dset
,gretlopt opt
);
Generates and adds to the data set squares and (if opt
is OPT_O)
cross-products of the variables given in the list pointed to
by plist
.
int list_dumgenr (int **plist
,DATASET *dset
,gretlopt opt
);
For each of the variables given in the list to which plist
points, generates and adds to the data set k dummy variables
coding for the k distinct values of the variable in question.
All these variables must have already been marked as discrete.
If the OPT_F or OPT_L option is given, either the first or
the last value of each variable is taken as the "base" and is
not given a dummy encoding (that is, only k - 1 dummies are
added for each variable).
int dumgenr_with_oddval (int **plist
,DATASET *dset
,double oddval
);
For each of the variables given in the list to which plist
points, generates and adds to the data set k dummy variables
coding for the k distinct values of the variable in question.
All these variables must have already been marked as discrete.
if oddval
is not NADBL
, it is treated as the omitted
category and only k - 1 dummies are added for each variable).
int auto_dummify_list (int **plist
,DATASET *dset
);
Produces a list in which any coded series in the original list are replaced by a set of dummy variables. If the original list contains no such series it is not altered. In generating dummy series, the omitted category is the minimum value of the coding variable.
int list_makediscrete (const int *list
,DATASET *dset
,gretlopt opt
);
Sets the variables given in list
as discrete, unless
opt is OPT_R, in which case the variables are set as
continuous.
int hf_list_diffgenr (int *list
,int ci
,double parm
,DATASET *dset
);
Generate high-frequency differences of the variables in list
and add them to the data set. If ci
is DIFF these are ordinary
first differences; if ci
is LDIFF they are log differences.
If parm
is not NA then the new series are all multiplied by
the specified value (as in multiplication of log-differences
by 100).
void
gretl_transforms_cleanup (void
);
Called by libgretl_cleanup()
. Frees any memory allocated
as workspace for the creation of transformed variables.