[ADMB Users] Non-matching analytic and numeric derivatives

Johnoel Ancheta johnoel at hawaii.edu
Fri Oct 10 10:51:08 PDT 2014


Thanks Dave!

On Fri, Oct 10, 2014 at 7:45 AM, dave fournier <davef at otter-rsch.com> wrote:

> On 10/09/2014 07:32 AM, Jeff Laake wrote:
>
> This might be of interest to others so I cc's it to the list.
>
> In your code for the log-likelihood you have the line.
>
>    f-= log(pch+0.000000000000000000000001);
>
>    Now I figured that 0.000000000000000000000001  might be too small.
>
> What would happen is that is pch is zero you will get derivatives on the
> order of
>
>          1.0/ (0.000000000000000000000001)
>
> and this could make the model numerically unstable at least during the
> initial fitting stage.
>
> I modified this to
>
>    f-= log(pch+1.e-8);
>
> and ran the model for a while and then used the values as initial values
> to run the
> model with your original code.  It converged easily.
>
> There is nothing magical about 1.e-8. For some models you might need
> something like 1.e-4 to start.
>
>         Dave
>
>
>  Dave-
>>
>> Per Johnoel's request I forwarded a zip containing an example in which
>> the numeric and analytic derivatives don't match when I use -dd.  The
>> code fails because it thinks it should move but can't make any
>> progress because it is at the min.
>>
>> --jeff
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20141010/1dc4923a/attachment.html>


More information about the Users mailing list