computes rolling VAR
rvar = rolvar(p,arg1,...,argn)
* p = the lag length
* arg1,...,argn = arguments which can be:
- 'endo=[var1 var2 ... varn]' with vari: the ith endogenous variable in the var
- 'exo=[var1 var2 ... varn]' with vari: the ith exogenous variable in the var
- the string 'nocte' if the user doesn't want a constant in the model
- the string 'noprint' if the user doesn't want the to print the results of the regression
- 'dropna' if the user wants to remove the NA values from the data
- 'nper=x' where x is the number of observations kept at each estimation
- 'start_firstbound=x' where x is the first bound of the first estimation
- 'end_firstbound=x' where x is the first bound of the last estimation
- 'start_firstobs=x' where x is the first observation of the first estimation
- 'end_firstobs=x' where x is the first observation of the last estimation (note that you must use either the option 'start_firstbound=x' along with the option 'end_firstbound=x' or the option 'start_firstobs=x' and 'end_firstobs=x'; the first option is moreover available only with ts)
* rvar = a results tlist with:
. rvar('meth') = 'rolling var'
. rvar('yall') = y data vector lagged data included
. rvar('y') = y data vector used in the rhs parts of the VAR
. rvar('x') = x data matrix
. rvar('nvar') = # exogenous variables
. rvar('nobs') = # observations
. rvar('neqs') = # endogenous variables
. rvar('nlag') = # lags in the VAR
. rvar('resid') = residuals, with rvar('resid')(:,i): residuals for equation # i
. rvar('beta') = bhat, with rvar('beta')(:,i): coefficients for equation # i
. rvar('tstat') = t-stats, with rvar('tstat')(:,i): t-stat for equation # i
. rvar('pvalue')= pvalue of the betas, with rvar('pvalue')(:,i): p-value for equation # i
. rvar('rsqr') = rsquared, with rvar('rsqr')(i) : rsquared for equation # i
. rvar('overallf') = F-stat for the nullity of coefficients other than the constant with: rvar('f')(i): F-stat for equation # i
. rvar('pvaluef') = their significance level with: rvar('pvaluef')(i): significance level for equation # i
. rvar('rbar') = rbar-squared
. rvar('sigu') = sums of squared residuals with rvar('sigu')(:,i): sum of squared residuals for equation # i
. rvar('ser') = standard errors of the regression with rvar('ser')(i): standard error for equation # i
. rvar('dw') = Durbin-Watson Statistic, with: rvar('dw')(i): DW for equation # i
. rvar('condindex') = multicolinearity cond index, with rvar('condindex')(i): cond index for equation # i
. rvar('ftes') = F-stat for the nullity of coefficients other than the constant with f(i): F-stat for equation # i
. rvar('fvalues') = their significance level with fvalues(i): significance level for equation # i
. rvar('boxq') = Box Q-stat, with rvar('boxq')(i): Box Q-stat for equation # i
. rvar('sigma') = (neqs x neqs) var-covar matrix of the regression
. rvar('aic') = Akaïke information criterion
. rvar('bic') = Schwartz information criterion
. rvar('hq') = Hannan-Quinn information criterion
. rvar('xpxi') = inv(X'X)
. rvar('vcovar') = variance matrix of the vector of all coefficents
. rvar('prescte') = boolean indicating the presence or absence of a cosntant in the VAR
. rvar('nx') = # of exogenous variables in the VAR
. rvar('namey') = name of the y variable
. rvar('namex') = name of the x variables (if any)
. rvar('dropna') = boolean indicating if NAs had been dropped
. rvar('bounds') = if there is a timeseries in the regression, the bounds of the regression
. rvar('nonna') = vector indicating position of non-NA values (if the option 'dropna' was active)
global GROCERDIR; load(GROCERDIR+'\data\france_maunf_survey.dat') bounds() resrolvar=rolvar(6,'endo=fra_past_output;fra_exp_output','nper=120','start_firstbound=1990m1','end_firstbound=2004m1') // Example taken from function rovar_d; provides rolling VAR estimates with France past output balance and France expected output balance // with estimations starting in 1990m1 for 120 periods, then in 1990m2 for 120 periods ... until 2004m1 for 120 periods // and 6 lags | ![]() | ![]() |