Skip to content
Prev 386134 / 398513 Next

R optim() function

The issue is almost certainly in the objective function i.e., diagH,
since Nelder Mead doesn't use any matrix operations such as Choleski.

I think you probably need to adjust the objective function to catch
singularities (non-positive definite cases). I do notice that you have
two identical parameters, so perhaps the matrix is something with
identical rows or columns.

You may be able to get more insight by calling optimr() from the optimx
package (I'm one of the authors) and using a different but similar optimizer
such as nmkb which is all in R so the trace is a bit easier.

It also is helpful to try the diagH function with the parameters that seem
to be giving trouble in a direct call from R.

JN
On 2020-10-28 7:03 p.m., Baker, Kieran via R-help wrote: