[Rd] Problem with mle in stats4 (R 1.9.1)

From: Daniel Hoppe <daniel.hoppe_at_univie.ac.at>
Date: Tue 14 Sep 2004 - 02:12:44 EST


This is a repost of an earlier message (with a clearer example demonstrating the problem I ran into). If you run the mle example in stats4

     x <- 0:10
     y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
     ll <- function(ymax=15, xhalf=6)
         -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))

(fit <- mle(ll))
plot(profile(fit), absVal=FALSE)

everything works fine. Now run

(fit <- mle(ll, method="BFGS", control=list(ndeps=c(1e-3, 1e-3))))
     plot(profile(fit), absVal=FALSE)

and you will get

Error in interpSpline.default(obj[[i]]$par.vals[, i], obj[[i]]$z, na.action = na.omit) :

        only 0's may mix with negative subscripts

This happens because optim gets the old ndeps but just one variable to optimize. The optim error is not reported, so the problem is rather hard to trace. Would you agree that this would be worth fixing?

Best regards,


(original posting with quick workaround

Daniel Hoppe
Department of Marketing
University of Vienna
Bruenner Strasse 72
1210 Vienna

R-devel@stat.math.ethz.ch mailing list
Received on Tue Sep 14 02:16:41 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:00:15 EST