On Thu, 25 Apr 2013, Sven Schreiber wrote:
I was mixing up the parentheses and tried to access a single value of
a
series like this:
x(1995:1) -- instead of x[1995:1]
The problem is that gretl did not complain, but instead seems to have
treated this as a lag expression and I got some weird results. Now,
AFAICS the expression '1995:1' is not a valid numeral that can be used
as a lag order, so I think gretl should give an error instead, no?
Well, an expression such as '1995:1' is converted internally
into an integer observation number (assuming the dataset has a
suitable frequency), and in that guise it is accepted as a lag
(or actually a lead). You can also do, for example,
scalar t3 = (1995:1)*3
But note that if (in the context above) you specified the type
on the left-hand side
scalar foo = x(1995:1)
you would get an error OK.
We could, I suppose, make an internal distinction between
"general" scalars and scalars that have been converted from
observation identifiers, and limit the contexts in which we
accept the latter.
Allin