performs bayesian VAR estimation
rbvar=bvar(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:
- 'endo=[var1;var2; ... ;varn]' or 'endo=var1;var2; ... ;varn' with vari the name of an admissible variable for explone (a real vector, a ts, a real matrix or a list of such variables)
- 'exo=[var1;var2; ... ;varn]' or 'exo=var1;var2; ... ;varn' with vari the name of an admissible variable for explone (a real vector, a ts, a real matrix or a list of such variables)
- the string 'noprint' if the user doesn't want to print the results of the regression.
- the string 'dropna' if the user wants to remove the NA values from the data
* rbvar = a results tlist with:
. rbvar('meth') = 'bvar'
. rbvar('y') = y data vector
. rbvar('x') = x data matrix
. rbvar('nvar') = # exogenous variables
. rbvar('nobs') = # observations
. rbvar('neqs') = # endogenous variables
. rbvar('nlag') = # lags
. rbvar('tight') = Litterman's tightness hyperparameter
. rbvar('weight') = Litterman's weight (matrix or scalar)
. rbvar('decay') = Litterman's lag decay = lag^(-decay)
. rbvar('beta') = bhat, with rbvar('beta')(:,i): coefficients for equation # i
. rbvar('tstat') = t-stats, with rbvar('tstat')(:,i): t-stat for equation # i
. rbvar('pvalue')= pvalue of the betas, with rbvar('pvalue')(:,i): p-value for equation # i
. rbvar('resid') = residuals, with rbvar('resid')(:,i): residuals for equation # i
. rbvar('yhat') = yhat, with rbvar('yhat')(:,i): residuals for equation # i
. rbvar('sige') = estimated variances rbvar('sige')(i): variance for equation # i
. rbvar('ser') = standard errors of the regression with rbvar('ser')(i): standard error for equation # i
. rbvar('dw') = Durbin-Watson Statistic, with: rbvar('dw')(i): DW for equation # i
. rbvar('rsqr') = rsquared, with rbvar('rsqr')(i) : rsquared for equation # i
. rbvar('rbar') = rbar-squared
. rbvar('sigma') = (neqs x neqs) var-covar matrix of the regression
. rbvar('nx') = # exogenous variables
. rbvar('xpxi) = inv(x'*x)
. rbvar('namey') = name of the y variable
. rbvar('namex') = name of the x variables (if any)
. rbvar('prests') = boolean indicating the presence or absence of a time series in the regression
. rbvar('dropna') = boolean indicating if NAs have been dropped
. rbvar('bounds') = if there is a timeseries in the forecast, the bounds of the regression
. rbvar('nonna') = vector indicating position of non-NAs
load(GROCERDIR+'/data/datajpl.dat') // load Le Sage matlab data results = bvar(2,0.1,1,0.5,'illinos','indiana','kentucky','michigan'... ,'ohio','pennsyvlania','tennesse','westvirginia'); // Example taken from function bvar_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. | ![]() | ![]() |