On Tue, 28 Feb 2006, john w wrote:
In my previous posts regarding detecting large residuals I wrote:
> gotta one question about the code that detects large residuals.
> I tried with 3 or 4 lags. This means that I must change number "2" in line
> myvar <- var 2 PRICE INCOME PRIME.
>
> Then the following error comes out:
>
> Matrices not conformable for operation
>>> series uhat$i = vresid[,$i]
Thnx. I THINK I solved the problem.
If one wants to change the number of lags in VAR for exmple into 5 lags must
change this two lines:
myvar <- var 5 PRICE INCOME PRIME
and
smpl +5
Now works.
Good, you got it! The trick is that you have to make the current
sample the right length to accept a column of the matrix in question
as a data series.
This will be easier in the 1.5.1 release. You can say, e.g.,
v1 <- var 4 ...
series uhat1 = v1.$uhat[,1]
In this case you don't have to adjust the sample, because gretl
"knows" you're selecting a column from a VAR residual matrix, and
hence knows how the observations should be aligned within the data
set, as a series.
Allin.