I have used MLE2 from BBMLE package to get a slope parameter. In the example code for the package copied as below a deviance chart is produced. However, when I use the same code on my MLE2 object I initially got for the same set of inputs a correct deviance chart, then I got a chart with wrong x-scales, then I got a completely empty chart and finally I got no chart at all. Te MLE2 produced a slope parameter and it is only the deviance chart bit that doesnt work for me. I looked at the object in rstudio to check the parameters and data stored in it and note that I looks quite different to the equivalent set of data allbeit for a different type of model.
Is there any further advice on how to use the MLE2 object and how to get the deviance chart to work?
The MLE2 seems to be pretty odd but at least it gets me result which MLE did not..
Example from package Vignette that gives deviance plot:
use as.data.frame and lattice to plot profiles
x <- 0:10
y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
library(bbmle)
LL <- function(ymax=15, xhalf=6) {
-sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
}
uses default parameters of LL
fit1 <- mle2(LL)
p1 <- profile(fit1)
d1 <- as.data.frame(p1)
library(lattice)
xyplot(abs(z)~focal|param,data=d1,
subset=abs(z)<3,
type="b",
xlab="",
ylab=expression(paste(abs(z),
" (square root of ",Delta," deviance)")),
scale=list(x=list(relation="free")))