Page 1 of 1

@inner with lag-indexed series

Posted: Fri Feb 12, 2016 4:42 am
by mamo
Dear eviews team,
given two series x and y, the program line

Code: Select all

!v=@inner((x(1)-1),((y(1)-1))
produces the error
1 is not a valid index for vector-series-coefficient Y in "!V2=@INNER((X(1)-1),(Y(1)-2))".
Why? Is this a bug?
It is clear to me that the following lines work ok

Code: Select all

!v=@inner((x-1),((y-1)) series v=@inner((x(1)-1),((y(1)-1))
For convenience, see example programme below
Best mamo

Code: Select all

wfcreate a 2000 2015 series x=nrnd series y=nrnd 'while the following works .... !v1=@inner((x-1),(y-2)) '...the following two lines create an error! !v2=@inner((x(0)-1),(y(0)-2)) !v2=@inner((x(1)-1),(y(1)-2)) ' but this works... series v3=@inner((x(0)-1),(y(0)-2)) series v4=@inner((x(1)-1),(y(1)-2))

Re: @inner with lag-indexed series

Posted: Fri Feb 12, 2016 9:25 am
by EViews Gareth
The reason is long and tedious, but basically comes down to the fact that EViews has two different parsing engines - one for use with series and one for use with matrix/vectors.

Which parsing engine gets used depends on the object on the left side of the equals sign. If it is a matrix/vector/scalar then the matrix parser gets used.

The matrix parser knows nothing about series objects. The series parser knows nothing about matrix objects.

The obvious problem with this is that often you want to use a function that works on a series object and returns a vector or scalar. EViews allows that by on the fly converting a series into a vector.

That generally works ok, but in some cases fails. Notably if you have a function of a function of a series, it fails, or something involving dates, or if you have something involving a sample it will fail (since the series is converted to a vector, and vectors can't have samples applied to them).

In your case @inner is a matrix function. It works on series objects as it converts the series on the fly to a vector. But it doesn't understand expressions involving series.