So I'm getting:

Error in nlm(neglikhood, p = c(0.1, 0.1), hessian = T, x = elinajat) :
  non-finite value supplied by 'nlm'
In addition: There were 50 or more warnings (use warnings() to see the first 50)

with the following (neglikelihood of 1-param. Weibull):

neglikhood <- function(theta,x) {
  n <- length(x)
-(n*log(theta[2])+n*log(theta[1])+(theta[1]-1)*sum(log(x))-theta[2]*sum(x^theta[1]))
}

elinajat
[1] 17.88 28.92 33.00 41.52 42.12 45.60 48.48 51.84 51.96 54.12 55.56 67.80 [13] 68.64 68.64 68.88 84.12 93.12 98.64 105.12 105.84 127.92 128.04 173.40

I read somewhere that I might need to constrain my parameters to the range (0,1). Is this correct?

For example:

neglikhood(c(0.1,0.1),elinajat)
[1] 195.3213

______________________________________________
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