On Mon, 7 Dec 2015, Riccardo (Jack) Lucchetti wrote:
On Mon, 7 Dec 2015, Allin Cottrell wrote:
> On Mon, 7 Dec 2015, Riccardo (Jack) Lucchetti wrote:
>
>> On Mon, 7 Dec 2015, Artur T. wrote:
>>
>>> Thanks for your quick responses!
>>> The sample script and datafile is actually just an extract from a
>>> rolling-window exercise, and gretl just crashed at this specific window
>>> involving apparently some numerical issues, as you said, Jack.
>>>
>>> Thanks for the hint with the re-scaling; that will help for the
>>> moment but of course gretl should not crash at any point.
>>
>> Upon further investigation: I'm now inclined to think that the root of the
>> problem lies in the function ordered_hessian() in discrete.c, where we
>> simply compute the Hessian by numerically differentiating the analytical
>> score. I distinctly remember that at the time I thought to myself
"this'll
>> do for now", but then I forgot about it; of course, in "hard"
cases such
>> as yours, this is a major source of numerical instability. When we find
>> some time to write down a C implementation of the analytical Hessian for
>> the ordered probit model, all the problems should be over.
>
> Ah, good idea. In the meantime I've made sure that when the Hessian can't
> be inverted the error propagates correctly, stopping the rot before a crash
> occurs.
In the mean^2-time, I've used a marginally more sophisticated way to computed
the numerical Hessian for ordered probit and committed it to git. Artur's
script shouldn't crash any longer. Please tell me if it does.
It wouldn't crash after my amendment, but after yours it actually
works. Nice job!
Allin