performs error correction model estimation
recm=ecm(p,arg1,...,argn)
* p = # of lags
* argi = an argument which can be:
- 'endo=var1;var2;...;varn' or 'endo=[var1;var2;...;varn]' with vari the name of an admissible variable (a real vector, a ts, a real matrix or a list of such variables)
- 'jres=xx' where xx is the name of a johansen results tlist (optional: if not given, is estimated by the function)
- 'exo_st=exo1;..,exok' where exo1,...,exok are variables entering the johansen estimation equations in the short run dynamic (needed if the user does not use the option 'jrex=xx')
- 'exo_lt=exo1;..,exok' where exo1,...,exok are variables entering the johansen estimation equations in the cointegration relationships (needed if the user does not use the option 'jrex=xx')
- 'nbr=xx' where xx is the # of cointegration vectors to keep from the johansen estimation (optional: if not given, is calculated by the function with a level equal to plevel)
- 'plevel=xx' where xx=0.01, 0.05 or 0.1 is the significance level for the cointegrating vectors (optional: if not given, is set to 0.05; useless if the option 'nbr=xx' is used)
- the string 'dropna' if the user wants to remove the NA values from the data
- the string 'noprint' if the user does not want to print the results
- 'stat_meth=asym' if the user wants to use asymptotic tables to determine the # of cointegration relationships instead of // . the string 'noprint' if the user doesn't want to // print the results of the regression ones obtained by bootstrap
- 'Nboot=xx' where xx is the number of bootstrap replications in the johansen method (default =999)
- 'st2lt' if the user wants to add the exogenous variables in the short run relation to the long run relationship
* recm = a results tlist with:
. recm('meth') = 'ecm'
. recm('y') = y data vector
. recm('x') = x data matrix
. recm('nobs') = # observations
. recm('nvar') = # exogenous variables
. recm('neqs') = # endogenous variables
. recm('resid') = residuals, with recm('resid')(:,i): residuals for equation # i
. recm('beta') = bhat, with recm('beta')(:,i): coefficients for equation # i
. recm('tstat') = t-stats, with recm('tstat')(:,i): t-stat for equation # i
. recm('pvalue')= pvalue of the betas, with recm('pvalue')(:,i): p-value for equation # i
. recm('rsqr') = rsquared, with recm('rsqr')(i) : rsquared for equation # i
. recm('overallf') = F-stat for the nullity of coefficients other than the constant
with: recm('overallf')(i): F-stat for equation # i
. recm('pvaluef') = their significance level with: recm('pvaluef')(i): significance level for equation # i
. recm('rbar') = rbar-squared
. recm('sigu') = sums of squared residuals with recm('sigu')(:,i): sum of squared residuals for equation # i
. recm('ser') = standard errors of the regression with recm('ser')(i): standard error for equation # i
. recm('dw') = Durbin-Watson Statistic, with: recm('dw')(i): DW for equation # i
. recm('condindex') = multicolinearity cond index, with recm('condindex')(i): cond index for equation # i
. recm('ftest') = matrix of F statistics for the nullity of the coefficient of all lag of a variable in each equation
. recm('fvalues') = the corresponding p values
. recm('boxq') = Box Q-stat, with recm('boxq')(i): Box Q-stat for equation # i
. recm('sigma') = variance-covariance matrix of residuals
. recm('aic') = Akaïke information criterion
. recm('bic') = Schwartz information criterion
. recm('hq') = Hannan-Quinn information criterion
. recm('nx') = # of x variables
. recm('xpxi') = inv(X'*X)
. recm('prescte) = a boolean indicating if there is a constant in the regressions
. recm('namey') = name of the y variable
. recm('namex') = name of the cointegration relations (if any) and short term exogenous variables
. recm('nb_coint_relat') = # of cointegration relations
. recm('jres') = results of johansen estimation
. recm('dropna') = boolean indicating if NAs have been dropped
. recm('bounds') = if there is a timeseries in the forecast, the bounds of the regression
. recm('evec') = matrix of cointegrating vectors
. recm('namexo_lt') = the names of the exogenous variables in the cointegration relationship
. recm('nonna') = vector indicating position of non-NAs
load(GROCERDIR+'/data/datajpl.dat') // load Le Sage matlab data result = ecm(2,'endo=[illinos;indiana;kentucky;michigan;ohio;pennsyvlania;tennesse;westvirginia]','exo_st=const') result = ecm(2,'endo=[illinos;indiana;kentucky;michigan;ohio;pennsyvlania;tennesse;westvirginia]','exo_st=const','plevel=0.05') result = ecm(2,'endo=[illinos;indiana;kentucky;michigan;ohio;pennsyvlania;tennesse;westvirginia]','exo_st=const','nbr=1') // First example is taken from function ecm_d(); endogenous variables are 'illinos','indiana','kentucky','michigan', // 'ohio','pennsyvlania','tennesse','westvirginia'; example 1 let the function set the number of cointegration // relations to the one chosen by a Johansen estimation at a 5% level; since there are 2 cointegration relations at a 5% level, all 3 examples give the same result. | ![]() | ![]() |