Skip to content
Prev 307511 / 398506 Next

problem with convergence in mle2/optim function

On 10-10-2012, at 00:21, Adam Zeilinger wrote:

            
Your grr function is not returning the gradient of NLL2 w.r.t. the parameters p1,p2,mu1,mu2.
You have 20 time periods and 4 parameters. Your grr is returning a single vector containing the gradients stacked (length=4*20).
You need to return the gradient of -sum(dmnom2(c(n1, n2, n3), prob = p.all, log = TRUE)) with respect to those parameters.
That would be a vector of length 4.
I don't know.

Berend