<< auto_test Automatic estimation automatic_signed >>

Grocer >> Automatic estimation > automatic

automatic

automatic general to specific regression

CALLING SEQUENCE

[results]=automatic(namey,arg1,...,argn)

PARAMETERS

Input

* namey = a time series, a real (n x 1) vector or a string equal to the name of a time series or a (n x 1) real vector between quotes

* arg1,...,argn = arguments which can be:

  * a time series

  * a real (n x 1) vector

  * a string equal to the name of a time series or a (n x 1) real vector between quotes

  * the string 'estim=xxx' where xxx is the estimation method the user wants to use (default ols); available methods in Grocer are 'ols', 'nwest', 'probit' and 'var'; ppooled, pfixed,; prandom, if the user wants to use automatic with her own method, say 'mymeth' she has to write 4 programs: mymeth4auto-explode, mymeth4auto_full, mymeth4auto_part, mymeth4auto_upd (see the user manual chapter 15 for details)

  * the string 'depth=n' where n is the number of non significant variables that are systematically combinated before starting a backward step-wise alogrithm

  * the string 'strategy=liberal' or 'strategy=conservative' if the user wants to use a predefined strategy (default = liberal)

  * the string 'descent=n' where n is the he factor by which p-values of specifiaction tests muts be divided to obtain the new levels used in the subsequent estimations (default 5)

  * the string 'alpha=p' for the simplification significance depth (default = set by the chosen strategy)

  * the string 'f0_tdo=p' for the top_down pre-test significance depth (default = set by the chosen strategy)

  * the string 'f0_bup=p' for the bottom-up pre-test significance depth (default = set by the chosen strategy)

  * the string 'eta=p' for the specification tests significance depth (default = 0.01)

  * the string 'gam=p' for the F-tests significance level (default = set by the chosen strategy)

  * the string 'groups_pval=m1;m2;...;mp' where the mi's are thresholds: coefficient whose p-values are greater than a given threshold are gathered to form a model included in stage 1 models (default = set by the chosen strategy)

  * the string 'crit=x' where x= aic, bic, or hq (default bic)

  * the string 'test=x1,...,xp' where xi is the name of a test function

  * the string 'newname(x1,x2)' where x1 is the name of a test function and x2 is the corresponding name the user wants the program to display

  * the string 'comp=x1;...;xn' where xi is the name of a variable that must be in the regression whatever significance it has

  * the string 'dropna' if the user wants to remove the NA values from the data

  * the string 'win=xx' where xx is the length of the Bartlett window (for the Newey-West estimation)

  * the string 'hac=ccm' if the user wants to use a "clustered" covariance matrix in panel methods ppoled and pfixed

  * the string 'prt=opt1,opt2,...,optn' where opti is one of the following available options:

  - nothing (nothing printed !)

  - initial (results of initial model printed)

  - st0_mod (results of stage 0 model printed)

  - st1_mod (results of stage 1 models printed)

  - st1_union (results of stage 1 union model printed)

  - st2_mod (results of stage 2 models printed)

  - st2_union (results of stage 2 union model printed)

  - final (results of final model printed)

  - test_inter (results of specification tests for the intermediate results printed)

  - test_final (results of specification tests for the final model printed)

  - test (specification tests printed for every regression result printed)

  - st1_path (results of stage 1 paths printed)

  - st2_path (results of stage 2 paths printed)

  - all (all results printed: can be very long !)

  * the string 'test=opt1,opt2,...,optn' where opti is one of the following available options:

  - chowtest(p)

  - predfailin(p)

  - doornhans

  - bpagan(p)

  - hetero_sq

 

Output

* results = a results tlist with the following fields:

  * results('meth') = 'automatic'

  * results('estim') = estimation method (ols, nwest, var, probit or any user defined method)

  * results('strategy') = estimation strategy (liberal, conservative or expert)

  * results('alpha') = simplification significance depth (default = set by the chosen strategy)

  * results('f0_tdo') = top_down pre-test significance depth (default = set by the chosen strategy)

  * results('f0_bup') = bottom-up pre-test significance depth (default = set by the chosen strategy)

  * results('gam') = F-tests significance level (default = set by the chosen strategy)

  * results('eta') = specification tests significance depth (default = 0.01)

  * results('comp') = matrix of values for the compulsory variables

  * results('f_test') = the function used to perform the specification tests

  * results('m_test') = the names of the specification tests

  * results('initial model') = the estimation results of the unrestricted model

  * results('ending reason') = the reason why the final model has been chosen

  * results('final model') = the estimation results of the final model

  * results('wind length') = the size of the Bartlett window (if the Nwest correction has been used)

  * results('top-down model') = the top-down model

  * results('bottom-up model') = the bottom-up model

  * results('stage 0 model') = the estimation results of the stage 0 restricted model (all variables whose individual tstat depth is lower than 1 and whose joint significance depth is lower than f0_tdo are withdrawn)

  * results('selected stage 0 model') = the way the stage 0 model has been selected

  * results('checking process model') = the model resulting from the group checking process

  * results('stage i models') = the estimation results of the stage i (i=1, 2.0, 2.1) models and the corresponding paths

  * results('stage i union model') = the estimation results of the model built from the union of stage i (i=1, 2.0, 2.1) models

DESCRIPTION

Performs automatic selection of a model by least-squares regressions along the lines suggested by Hendry and Krolzig and Doornik: starting from the list of exogenous variables provided by the user, the function selects the "best" regression, that is one where all variables are significant, all specification tests are passed, and, if more than one regression have these properties, the one with the smallest aic criterion.

EXAMPLE

load(GROCERDIR+'/data/bdhenderic.dat') ;
bounds('1964q3','1989q2')
 
[r1]=automatic('delts(lm1-lp)','lagts(lm1-lp-ly)','delts(lp)','rnet','delts(lagts(lm1-lp))', 'delts(lagts(2,lm1-lp))','delts(lagts(3,lm1-lp))','delts(lagts(4,lm1-lp))',&133;
'delts(ly)','delts(lagts(1,ly))', 'delts(lagts(2,ly))','delts(lagts(3,ly))','delts(lagts(4,ly))',&133;
'delts(delts(lp))','delts(delts(lagts(1,lp)))','delts(delts(lagts(2,lp)))','delts(delts(lagts(3,lp)))','delts(delts(lagts(4,lp)))',&133;
'delts(rnet)','delts(lagts(1,rnet))','delts(lagts(2,rnet))','delts(lagts(3,rnet))','delts(lagts(4,rnet))','const',&133;
'prt=initial,final','test=predfailin(0.5),predfailin(0.9),doornhans,arlm(5),hetero_sq','groups_pval=[]')
// Starts from a rather extensive set of exogenous variables: from 'lagts(lm1-lp-ly)' to 'cte'
// in examples 1 and 2 and from 'lagts(lm1)' in example 3.
// Here, the initial model is printed along with the final one; tests are given by the user and
// models of coefficients with p-value greater than some threshold are not examined.
 
[r2]=automatic('delts(lm1-lp)','lagts(lm1-lp-ly)','delts(lp)','rnet','delts(lagts(lm1-lp))', 'delts(lagts(2,lm1-lp))','delts(lagts(3,lm1-lp))','delts(lagts(4,lm1-lp))',&133;
'delts(ly)','delts(lagts(1,ly))', 'delts(lagts(2,ly))','delts(lagts(3,ly))','delts(lagts(4,ly))',&133;
'delts(delts(lp))','delts(delts(lagts(1,lp)))','delts(delts(lagts(2,lp)))','delts(delts(lagts(3,lp)))','delts(delts(lagts(4,lp)))',&133;
'delts(rnet)','delts(lagts(1,rnet))','delts(lagts(2,rnet))','delts(lagts(3,rnet))','delts(lagts(4,rnet))','const',&133;
'prt=final','test=predfailin(0.5),predfailin(0.9),doornhans,arlm(5),hetero_sq','strategy=conservative','depth=2')
 
// Same set of variables, but only the final model is printed, tests are given by the user,
// the strategy is turned from default (liberal) to conservative and the depth is set to 2 (nstead of 1).
 
[r3]=automatic('delts(lm1-lp)','lagts(lm1-lp-ly)','delts(lp)','rnet','delts(lagts(lm1-lp))', 'delts(lagts(2,lm1-lp))','delts(lagts(3,lm1-lp))','delts(lagts(4,lm1-lp))',&133;
'delts(ly)','delts(lagts(1,ly))', 'delts(lagts(2,ly))','delts(lagts(3,ly))','delts(lagts(4,ly))',&133;
'delts(delts(lp))','delts(delts(lagts(1,lp)))','delts(delts(lagts(2,lp)))','delts(delts(lagts(3,lp)))','delts(delts(lagts(4,lp)))',&133;
'delts(rnet)','delts(lagts(1,rnet))','delts(lagts(2,rnet))','delts(lagts(3,rnet))','delts(lagts(4,rnet))','const',&133;
'prt=initial,final,st2_mod','test=predfailin(0.51),predfailin(0.862),doornhans,arlm(5),hetero_sq','alpha=0.01')
 
// Same set of variables, but  the initial model and all the stage 2 model
// (among which the final model is selected by the BIC information criterion) are printed along with the final one,
// tests are again given by the user and the significance level of individual coefficients is set to 0.01.
 
global GROCERDIR;
load(GROCERDIR+'/data/lutk1.dat')
bounds('1960q4','1978q4')
results=automatic(2,'estim=var','endo=delts(log(rfa_inv));delts(log(rfa_inc));delts(log(rfa_cons))','depth=3')
// This is an example with another method (here a VAR model which is restricted to significant coefficients),
// and with depth augmented to 3, in order to test a greater number of models

// examples with panel estimation methods 
load(GROCERDIR+'/panel/Munnellunbal.dat')
// pooled data(i.e ols)
automatic('gsp',Munnell_testauto,'estim=ppooled','x=lpcap;private;emp;unemp;const;'+joinstr('rand',string(1:10),';'))

// with "clustered" covariance matrix 
automatic('gsp',Munnell_testauto,'estim=ppooled','x=lpcap;private;emp;unemp;const;'+joinstr('rand',string(1:10),';'),'hac=ccm')

// fixed effects
automatic('gsp',Munnell_testauto,'estim=pfixed','x=lpcap;private;emp;unemp;'+joinstr('rand',string(1:10),';'))

// fixed effects at a looser size, which leads rand3 to be selected
automatic('gsp',Munnell_testauto,'estim=pfixed','x=lpcap;private;emp;unemp;'+joinstr('rand',string(1:10),';'),'alpha=0.1')

// fixed effects with heteroskedasticty and autocrrelation correction
automatic('gsp',Munnell_testauto,'estim=pfixed','x=lpcap;private;emp;unemp;'+joinstr('rand',string(1:10),';'),'hac=ccm')

// random effects
automatic('gsp',Munnell_testauto,'estim=prandom','x=lpcap;private;emp;unemp;'+joinstr('rand',string(1:10),';'))

AUTHOR

Eric Dubois 2002-2013

Report an issue
<< auto_test Automatic estimation automatic_signed >>