Skip to content

minor numerical change/issue in test-AGHQ test #57

@paciorek

Description

@paciorek

In the "AGH Quadrature Comparison to LME4 1 RE for Poisson-Normal" test, line 475 of test-AGHQ.R (formerly test-ADaghq.R), we are now getting this optimization "failure":

  [Warning] In maximizing the Laplace/AGHQ approximation,
            `optim` has a non-zero convergence code: 1,
            with the message 'false convergence (8)'.
            The control parameters of `optim` can be adjusted using the `outerOptimControl`
            list component of the `control` list argument of `buildLaplace` or `buildAGHQ`.

When I compare results to nimble 1.3.0, the numerical values at the optimum are essentially identical and in fact the new values are very slightly better than the old ones in terms of the Laplace-approximated logLik and the optimization stops in 9 iterations instead of 10 previously. Also, when using 1.3.0, if I re-run cmLaplace$findMLE()$par immediately again (i.e., starting a new optimization from the optimized value), it gives a lack of convergence warning. So I think that there are just some minor numerical issues with the optimization generally for this model. That said, it's a bit disconcerting to get an optim "failure" when we didn't before.

As far as I can see, the difference seems to be caused by a very slightly different optimization path because the results of calcLogLik2 and gr_logLik2 in the 1D inner AGHQ/Laplace are slightly different with Perry's recent AD/Laplace changes. The differences are not present for all of the 50 Laplaces involved in this model , but for some of them there are very small floating point differences. I'm presuming that these add up enough to affect the optimization path. I should also note that Paul and I did change how gr_logLik/gr_logDens work to handle inclusion/exclusion of the prior. I don't think this would change numerical values, but it's possible I'm being to cavalier in saying that.

I'm not particularly inclined to pursue this further, and I can monkey with the test to deal with the warning, but wanted to get thoughts from @perrydv @paul-vdb if they have any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions