search for: lik1b

Displaying 1 result from an estimated 1 matches for "lik1b".

2007 Oct 24
1
vectorized mle / optim
.../ optim lead to an annoying bug: the "minuslogl" function cannot have "computed" default parameters, because all of them must be specified either as "fixed" or "start". -------------------------------- example 3 ------------ 8< ---------------------- lik1b <- function(m, v=var(data), data) { N <- length(data) lik.mean <- dnorm(mean(data), m, sqrt(v/N), log=T) lik.var <- dchisq(N*var(data)/v, N-1, log=T) return(-lik.mean - lik.var) } ml.result.1 <- mle(lik1b, start=list(m=2, v=2), fixed=list(data=data)) ml.result.2 <- mle(lik...