estimates a VAR model (low level)
rvar=var1(y,nlag,x,nocte)
* y = an (nobs x neqs) matrix of y-vectors
* nlag = the lag length
* x = optional matrix of variables (nobs x nx)
* nocte = 'nocte' if the user doesn't want a constant in the model
* rvar = a results tlist with:
. rvar('meth') = 'var'
. rvar('y') = y data vector
. rvar('x') = x data matrix
. rvar('nobs') = # observations
. rvar('nvar') = # exogenous variables
. rvar('neqs') = # endogenous variables
. rvar('nlag') = # lags
. 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('overallf')(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('ftest') = matrix of causality tests of each variable (in column) in each equation (in row)
. rvar('fvalues') = the corresponding p-values
. 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('prescte') = boolean indicating the presence or absence of a constant in the regression
load(GROCERDIR+'/data/lutk1.dat') bounds() dy=explone(['delts(log(rfa_inv))';'delts(log(rfa_inc))';'delts(log(rfa_cons))']) rvar=var1(dy,2,[]) // a var with constant and 2 lags y=explone(['log(rfa_inv)';'log(rfa_inc)';'log(rfa_cons)') trend=[1:size(y,1)]' rvar=var1(y,2,trend) // a var with trend and constant and 2 lags | ![]() | ![]() |