panel VAR with exogeneous variables

Dec 29, 2015 at 10:57 AM
Hi Jaromir,

I have a few questions estimating a reduced-form panel VAR with exogenous variables and fixed-effects:
I estimate the panel VAR as given in the tutorial first and arrive at country-specific fixed-effects K and the same A (=VAR coefficients matrix) for all 3 countries. when using any release after 20150226 (fixed-effects = default option).

Now I add an exogenous variable e.g. oil price and get:
J = get(vp,'J')
J =
0.0042    0.0003    0.0025
0.0000    0.0050    0.0087
-0.0004 -0.0035 -0.0025
-0.0941 0.0010 0.0420

J-matrix estimates country-specific effect of the exogenous variable whereas I expected J to have 1 column and summarize the same effect for all countries. I thought the country-specific effect would be captured in K only and not further in J.

I also tried to turn off the fixed-effects by setting 'fixedEff=',false, then I receive an error message:
Error using command prompt
IRIS Toolbox Error @ VAR:estimate.

*** Internal IRIS error. Please report this error with a copy of the screen message.

The model I want to estimate is
Y_it = K_i + A1Y_it-1 + A2Y_it-2 + J*X_it + e_it
You see A1, A2 and J may not be country-specific but the same across countries and have no index. K_i are country-specific. A1 and A2 are fine. But J: Can I average over the 3 columns of J to get the average effect?

I guess that the order lag = p only applies to the VAR endogenous part but not to the exogenous part. How would I incorporate lags of X_it?

VAR/assign – command still doesn’t seem to work although I saw records of improvement in the latest release:
V = assign(vp,A,K,J,Omg)
Error using command prompt
IRIS Toolbox Error @ varobj:assign.
*** Invalid size of the covariance matrix Omg.
Now if I use any release of before 20150226 where fixed-effects are not the default option, then I get for A, K, J from the following command:
vp = VAR({'infl','gap','int','dex'},'exogenous=','oilprice','groups=',{'Au','Ca','No'});
[vp,dvp] = estimate(vp,d,estrange,'order=',p','groupWeights=',[1,1,1])

A(:,:,1) =
0.5621    0.0211    0.3590   -0.0011
-0.1670 0.3530 0.1517 -0.0007
-0.0287 0.0614 1.4767 -0.0051
2.4243    3.4343   -1.4817    0.1880
A(:,:,2) =
0.0471   -0.0114   -0.2675    0.0061
0.0980    0.2889   -0.1267   -0.0054
0.0086   -0.0147   -0.5442    0.0022
-1.2920 1.5714 2.6837 -0.1782

J =
0.0028    0.0028    0.0028
0.0042    0.0042    0.0042
-0.0014 -0.0014 -0.0014
-0.0267 -0.0267 -0.0267

K =
0.1340    0.1340    0.1340
-0.1636 -0.1636 -0.1636
0.3772    0.3772    0.3772
-5.4737 -5.4737 -5.4737

But if I add the option fixed-effects = true, it does not work any more with exogeneous variables:
[vp,dvp] = estimate(vp,d,estrange, ...
'order=',p','groupWeights=',[1,1,1],'fixedEffect=',true)
Or I have also seen this:
[vp,dvp] = estimate(vp,d,estrange, ...
'order=',p','groupWeights=',[1,1,1],'fixedEff=',true)
[vp,dvp] = estimate(vp,d,estrange, ...
'order=',p','groupWeights=',[1,1,1],'fixedEffect=',true) %
Undefined function or variable 'nxPer'.

Error in VAR/mystackdata (line 60)
        x(pos,nxPer:end,:) = NaN;
Error in VAR/estimate (line 155)
[y0,k0,x0,y1,g1,ci] = mystackdata(This,y,x,opt);


Leaving out the exogenous variables everything works fine again. Could it be that anything is wrong here?

So in summary, if I use any release after 20150226, I get for J country-specific estimates which I don’t want, but I need J to be the same for all countries, and fixed-effects to be captured in K only.

If I use any release before 20150226, I don’t get individual K for each country but I get for J the same across countries. If I added fixedEff=true as an option, the estimation shows an error whenever exogeneous variables in involved in there.

I have been using this panel VAR-X tool for a few months since the summer and unfortunately I only realised now these problems after having read through the debug notes on the website.