Hi all,

what is wrong with this code? I am trying to estimate the model parameters by 
maximizing the likelihood function and I am getting this warning 


Warning message:
In nlm(fn, p = c(-50, 20), hessian = TRUE) :
  NA/Inf replaced by maximum positive value




x <- c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839)
y <- c( 6, 13, 18, 28, 52, 53, 61, 60)
n <- c(59, 60, 62, 56, 63, 59, 62, 60)
fn <- function(p)
    sum( - (y*(p[1]+p[2]*x) - n*log(1+exp(p[1]+p[2]*x))
            + log(choose(n, y)) ))
out <- nlm(fn, p = c(-50,20), hessian = TRUE)


Thanks
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to