Displaying 1 result from an estimated 1 matches for "minuslogl2".
Did you mean:
minuslogl
2010 Jul 31
2
Is profile.mle flexible enough?
...manage to get profile-based
confidence intervals when some parameters of the likelihood function are
fixed:
-----------8<--------------------------------
library(stats4)
minusLogL1 <- function(mu, logsigma2) { N*log(2*pi*exp(logsigma2))/2 +
N*(var(x)+(mean(x)-mu)^2)/(2*exp(logsigma2)) }
minusLogL2 <- function(mu) { logsigma2 <- 0;
N*log(2*pi*exp(logsigma2))/2 +
N*(var(x)+(mean(x)-mu)^2)/(2*exp(logsigma2)) }
N <- 100
x <- rnorm(N, 0, 1)
fit <- mle(minusLogL1, start=list(mu=0, logsigma2=0))
confint(fit)
fit2 <- mle(minusLogL1, start=list(mu=0), fixed=list(logsigma2=0))
c...