bbmle icon indicating copy to clipboard operation
bbmle copied to clipboard

confint() environment issues

Open parksw3 opened this issue 5 years ago • 0 comments

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()

parksw3 avatar Jul 19 '19 18:07 parksw3