On Tue, 13 Oct 2020, Daniel Ventosa-Santaulària wrote:
Hello everyone,
I am having trouble with the recovery of the residuals in a VAR model. If
if do it though the GUI everything is ok, but if I try to do it through a
code, then I can only recover the residuals (as a time series) of the
first equation, but for the remaining equations, I can only get them as a
matrix. Here is this simple example code:
open np.gdt
var 2 rgnp emply interest --robust
series Resid1=$uhat[,1] # This one works perfectly
series Resid2=$uhat[,2] # This one does not; mismatch between series and
matrix
this is probably a rookie's mistake, but I cannot see where the problem is.
It seems like this ought to work, I need to take a closer look. But
you can extract the other columns of $uhat as series if you set the
sample range to start at the first observation used by the VAR:
smpl 1911 ;
series Resid1=$uhat[,1]
series Resid2=$uhat[,2]
Allin