【发布时间】:2020-10-22 07:27:33
【问题描述】:
我正在尝试获取 MLE。
loglike <- function(theta) {
ll <- 14 * log(1 - theta) + 12216 * log(theta)
ll
}
neg.loglike <- function(theta) -loglike(theta)
mle(neg.loglike, start = list(theta = 0.5))
我收到了错误
Error in optim(start, f, method = method, hessian = TRUE, ...) :
non-finite finite-difference value [1]
In addition: There were 37 warnings (use warnings() to see them)
我通常使用上面的代码,但我发现了另一个功能:
mle2(neg.loglike, start = list(theta = 0.5))
它奏效了。为什么另一个不工作?
【问题讨论】: