On Mon, 9 Oct 2017, Riccardo (Jack) Lucchetti wrote:
On Mon, 9 Oct 2017, Artur T. wrote:
> Dear all,
>
> just by chance I've found a bug (at least realized using 4-day old git on
> ubuntu). When adding a lagged intercept to the ordered probit model, gretl
> gets captured in infinite computation (I would call this a 'crash'):
>
> <hansl>
> open ooballot -q
> smpl Status > 0 --restrict
> # works
> probit Vote 0 CPI
> # crashes (infinite computation)
> series const_1 = const(-1)
> probit Vote 0 const_1 CPI
> </hansl>
The problem lies in the function we use for removing the constant from a list
(list_purge_const in discrete.c), which doesn't handle well the "lagged
constant" case.
That's now fixed in git. Thanks to Artur for pointing out the bug: I
think it has "always" been there in ordered probit/logit.
Note that including const(-1) is not the only condition that would
send list_purge_const() into an infinite loop. Any constant term
immediately following const itself would do, as in
series three = 3
probit Vote 0 three const_1 CPI
This was due to a classic off-by-one error.
However, I was thinking: can lagging the constant ever make sense, in
any
situation? Shouldn't const(-1) be a no-op?
I suppose it could be used as a tricksy way of getting a series that's
all 1s apart from NA at observation 1. We could ban the operation but
I'm not sure that would be worthwhile.
Allin