https://github.com/cran/bbmle
Tip revision: 95d37841ff40f3df3329e27a70493aca020ae8bc authored by Ben Bolker on 21 November 2013, 06:48:23 UTC
version 1.0.15
version 1.0.15
Tip revision: 95d3784
controleval.R
require(bbmle)
mle2a <- function(...)
mle2(...)
mle2b <- function(...)
mle2a(...)
## some data
d <- data.frame(x=0:10,y=c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8))
ym <- mean(d$y)
## some fits
(fit0 <- mle2(y~dpois(lambda=ymean),start=list(ymean=ym),data=d)) # okay
predict(fit0)
(fit0.2 <- mle2(y~dpois(lambda=ymean),start=list(ymean=ym),data=d,
control=list(parscale=2))) # okay
predict(fit0.2)
(fit1 <- mle2a(y~dpois(lambda=ymean),start=list(ymean=ym),data=d)) # okay
(fit1.2 <- mle2a(y~dpois(lambda=ymean),start=list(ymean=ym),data=d,
control=list(parscale=2))) # FAILS
(fit1.3 <- mle2b(y~dpois(lambda=ymean),start=list(ymean=ym),data=d,
control=list(parscale=2))) # FAILS
### NOT WORKING:
if (FALSE) {
predict(fit1)
predict(fit1.2)
predict(fit1.3)
}