performs bayesian error correction model estimation
rbecm=becm(nlag,tight,weight,decay,arg1,...,argn)
* nlag = the lag length of the VAR
* tight = Litterman's tightness hyperparameter
* weight = Litterman's weight (matrix or scalar)
* decay = Litterman's lag decay = lag^(-decay)
* argi = an argument which can be:
- 'jres=xx' where xx is the name of a johansen results tlist (optional: if not given, is estimated by the function)
- '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 'noprint' if the user doesn't want to print the results of the regression
- 'endo=var1;var2;...;varn' or 'endo=[var1;var2;...;varn]' with vari the name of an admissible variable for explox (a real vector, a ts, a real matrix or a list of such variables)
- the string 'dropna' if the user wants to remove the NA values from the data
- 'stat_meth=asym' if the user wants to use asymptotic tables to determine the # of cointegration relationships instead of simulated 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
* rbecm = a results tlist with:
. rbecm('meth') = 'becm'
. rbecm('y') = y data vector
. rbecm('x') = x data matrix
. rbecm('nobs') = # observations
. rbecm('nvar') = # exogenous variables
. rbecm('neqs') = # endogenous variables
. rbecm('tight') = Litterman's tightness hyperparameter
. rbecm('decay') = Litterman's lag decay = lag^(-decay)
. rbecm('weight') = Litterman's weight (matrix or scalar)
. rbecm('beta') = bhat, with rbecm('beta')(:,i): coefficients for equation # i
. rbecm('tstat') = t-stats, with rbecm('tstat')(:,i): t-stat for equation # i
. rbecm('pvalue')= pvalue of the betas, with rbecm('pvalue')(:,i): p-value for equation # i
. rbecm('resid') = residuals, with rbecm('resid')(:,i): residuals for equation # i
. rbecm('yhat') = the adjusted variables
. rbecm('sige') = variance of residuals with rbecm('sigu')(:,i): variance of residuals for equation # i
. rbecm('ser') = standard errors of the regression with rbecm('ser')(i): standard error for equation # i
. rbecm('dw') = Durbin-Watson Statistic, with: rbecm('dw')(i): DW for equation # i
. rbecm('rsqr') = r-squared with rbecm('rsqr')(i): r-squared for equation # i
. rbecm('rbar') = rbar-squared with rbecm('rbar')(i): rbar-squared for equation # i
. rbecm('sigma') = (neqs x neqs) var-covar matrix of the regression
. rbecm('nx') = # of x variables
. rbecm('prescte) = a boolean indicating if there is a constant in the regressions
. rbecm('xpxi) = inv(x'*x)
. rbecm('namey') = name of the y variable
. rbecm('namex') = name of the cointegrating variables (if any)
. rbecm('prests') = boolean indicating the presence or absence of a time series in the regression
. rbecm('nb_coint_relat') = # of cointegration relations
. rbecm('jres') = the result tlist from the johansen step
. rbecm('dropna') = boolean indicating if NAs have been dropped
. rbecm('bounds') = if there is a timeseries in the forecast, the bounds of the regression
. rbecm('evec') = matrix of cointegrating vectors
. rbecm('namexo_lt') = the names of the exogenous variables in the cointegration relationship
. rbecm('nonna') = vector indicating position of non-NAs
load(GROCERDIR+'/data/datajpl.dat') // load Le Sage matlab data results = becm(2,0.1,1,0.5,'endo=[illinos;indiana;kentucky;michigan;ohio;pennsyvlania;tennesse;westvirginia','exo_st=const'); // Example taken from function becm_d(); endogenous variables are 'illinos','indiana','kentucky','michigan', // 'ohio','pennsyvlania','tennesse','westvirginia'; # of lags set to 2; tight, weight and decay are set to 0.1,1 and 0.5 // and there is a constant in the regressions. | ![]() | ![]() |