transforms VAR taken from Automatic estimation into a standard VAR
rvar=autovar2var(rauto,type_mod,rank_mod)
* rauto = a results tlist from automatic applied to a VAR model (therefore typeof(rauto) is 'results' and rauto('meth') is 'automatic' and rauto('estim') is 'var'
* rauto = the type of results that must be transformed ('final', 'stage 1 models', etc.)
* rank_mod = the rank of the model in the list of results when the result is made of potentially several models ('stage 1 models', 'stage 2 models', etc.)
* rvar = a tlist with
- rvar('meth') = 'restricted var'
- rvar('y') = y data vector
- rvar('x') = x data matrix
- rvar('nobs') = # observations
- rvar('nvar') = # exogenous variables
- rvar('neqs') = # endogenous variables
- rvar('resid') = residuals, with - rvar('resid')(:,i): residuals for equation # i
- rvar('beta') = bhat, with - rvar('beta')(:,i): coefficients 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('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('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('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') = Akaike information criterion
- rvar('bic') = Schwartz information criterion
- rvar('hq') = Hannan-Quinn information criterion
- rvar('xpxi') = inv(X'X)
- rvar('vcovar') = variance amtrix of the vector of all coefficents
- rvar('prests') = boolean indicating the presence or absence of a time series in the regression
- rvar('nx') = # of x variables
- 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/lutk1.dat') bounds('1960q4','1978q4') results=automatic(2,'estim=var','endo=delts(log(rfa_inv));delts(log(rfa_inc));delts(log(rfa_cons))') rvar=autovar2var(results,'final model') // recover the final model in a VAR results tlist varf(rvar,10) // make a 10 quarters forecast rvar2=autovar2var(results,'stage 2 models',2) // recover the second model from the 2nd stage regression varf(rvar2,10) // make a 10 quarters forecast with this alternative model | ![]() | ![]() |