- out <- nlm(function(p) dev(p), p = rep(ip, length.out = np),
- hessian = TRUE)
- obj$loglik <- -out$minimum / 2
- obj$rates <- out$estimate
- if (any(out$gradient == 0))
+ out <- nlminb(rep(ip, length.out = np), function(p) dev(p),
+ lower = rep(0, np), upper = rep(Inf, np))
+ obj$loglik <- -out$objective/2
+ obj$rates <- out$par
+ oldwarn <- options("warn")
+ options(warn = -1)
+ h <- nlm(function(p) dev(p), p = obj$rates, iterlim = 1,
+ stepmax = 0, hessian = TRUE)$hessian
+ options(oldwarn)
+ if (any(h == 0))