olsecm — Error correction test for cointegration
rolsecm = olsecm(p,namey,varargin)
p = order of time polynomial in the error correction part
* -1, no deterministic part (default)
* 0, for constant term
* 1, for constant plus time-trend
* 2, for constant plus quadratic time-trend
namey = a time series, a real (nx1) vector or a string equal to the name of a time series or a (nx1) real vector between quotes.
WARNING: if the user does not provide a cointegrationg vector this serie should be in level because it is also used for the estimation of error correction part
argi = arguments which can be:
- 'coint=[var1 var2 varn]' or 'coint=''y+a1*var1+a2*var2+ +an*varn''', in case of constrained or previously estimated
cointegrating relation, with vari: the ith exogenous variable in the cointegrating relation
- the exogenous variables of the ECM which can be
* a time series
* a real (nxp) vector
* a string equal to the name of a time series or a (nxp)
* real vector between quotes
- p = order of time polynomial in the error correction part
* 'p = -1', no deterministic part (default)
* 'p = 0', for constant term
* 'p = 1', for constant plus time-trend
* 'p = 2', for constant plus quadratic time-trend
- the string 'noprint' if the user doesn't want to display the results of the regression
- the string 'dropna' if the user wants to delete NAs (this option should be used when dealing with daily and weekly TS)
rolsecm = a results tlist with:
- rolsecm('meth') = 'olsecm'
- rolsecm('y') = y data vector of the auxiliary regression
- rolsecm('y') = y data vector of the ECM
- rolsecm('x') = x data matrix of the ECM
- rolsecm('ecm') = data matrix of the error correction
- rolsecm('nobs') = # observations in the ECM
- rolsecm('nvar') = # variables in the ECM
- rolsecm('beta') = bhat
- rolsecm('yhat') = yhat
- rolsecm('resid') = residuals of the auxiliary regression
- rolsecm('vcovar') = estimated variance-covariance matrix of beta
- rolsecm('sige') = estimated variance of the residuals
- rolsecm('sigu') = sum of squared residuals
- rolsecm('ser') = standard error of the regression
- rolsecm('tstat') = t-stats
- rolsecm('pvalue') = pvalue of the betas
- rolsecm('dw') = Durbin-Watson Statistic
- rolsecm('condindex') = multicolinearity cond index
- rolsecm('prescte') = boolean indicating the absence of a constant in the regression
- rolsecm('test p-value') = the (approximate) p-value of the test
- rolsecm('test crit. value') = the Ericsson-MacKinnon critical value of the test
- rolsecm('deterministic') = type of deterministic part in the cointegrating vector
- rolsecm('prests') = boolean indicating the presence or absence of a time series in the regression
- rolsecm('namey') = name of the y variable of the ECM
- rolsecm('namex') = name of the x variables of the ECM
- rolsecm('name ecm') = name of the variables of the error correction part
- rolsecm('bounds') = if there is a timeseries in the regression, the bounds of the regression
- rolsecm('like') = log-likelihood of the regression
- rolsecm('dropna') = boolean indicating if NAs had been droped
- rolsecm('nonna') = vector indicating position of non-NAs
NOTE THAT THE PROGRAMMER WHO WANTS TO RE-USE THE TABLES PROVIDED IN GROCER MUST BEFORE OBTAIN WRITTEN CONSENT FROM N.R. ERICSSON OR J.G. MACKINNON.
load(GROCERDIR+'/data/UsCons.dat'); // take logs lco =log(co); lrw = log(w/p); lry = log(y/p); // estimation of the error correction and test of cointegration bounds('1957q1','1998q4'); rolsecm = olsecm(0,'lco','coint=[''lrw'';''lry'']',... 'lagts(2,delts(lco))','delts(lry)','lagts(delts(lry))','lagts(delts(lrw))',.... 'lagts(delts(r))','lagts(2,delts(r))','delts(u)','cte'); rolsecm = olsecm(0,'delts(lco)','coint=''lco-0.1779062*lrw-0.8684839*lry-3.9326624''',... 'lagts(2,delts(lco))','delts(lry)','lagts(delts(lry))','lagts(delts(lrw))',.... 'lagts(delts(r))','lagts(2,delts(r))','delts(u)','cte'); // Examples taken from function olsecm_d. In the first example the program estimates the error correction then test cointegration whereas in // the second example the user provides it's own error correction. Note that in the second example the endogenous variable is inserted // in first difference whereas it is inserted in level in the former. We use this convenience so that when the user does not provide it's own // error correction relation, the program knows the level and the first difference of the series.