Sergey Goriatchev wrote:
>
>
> [snip]
>
> I cannot run this because I always get an error message:
>
> Error in optim(par = 1, poisson.loglik, lower = 0, method = "L-BFGS-B", :
> non-finite finite-difference value [1]
>
> Could someone enlighten me what that means and why this happens?
>
Dear R users,
I have following code, estimating Poisson log-likelihood a number of times:
poisson.loglik <- function(mu, y){
n <- NROW(y)
logl <- sum(y)*log(mu)-n*mu
return(-logl)
}
estimates <- numeric(1e5)
for(i in seq_along(estimates)){
estimates[i] <- optim(par=1, poisson.lo
2 matches
Mail list logo