bbmle
bbmle copied to clipboard
confint() environment issues
library(bbmle)
y <- rnorm(100)
d <- data.frame(y)
mlefun <- function(fixed=NULL) {
m <- mle2(y ~ dnorm(mean=mu, sd=sigma),
data=d,
fixed=fixed,
start=list(mu=0, sigma=1))
confint(m)
}
## this breaks
mlefun()
## need to define 'fixed' in the global environment
fixed <- NULL
## this runs now
mlefun()