[R] Fitting a Weibull/NaNs

Eric Rescorla ekr at rtfm.com
Mon Oct 20 02:00:14 CEST 2003


I'm trying to fit a Weibull distribution to some data via maximum
likelihood estimation. I'm following the procedure described by Doug
Bates in his "Using Open Source Software to Teach Mathematical
Statistics" but I keep getting warnings about NaNs being converted to
maximum positive value:

> llfunc <- function (x) { -sum(dweibull(AM,shape=x[1],scale=x[2], log=TRUE))}
> mle <- nlm(llfunc,c(shape=1.5,scale=40), hessian=TRUE)
Warning messages: 
1: NaNs produced in: dweibull(x, shape, scale, log) 
2: NA/Inf replaced by maximum positive value 
3: NaNs produced in: dweibull(x, shape, scale, log) 
4: NA/Inf replaced by maximum positive value 
> 

Can someone offer some advice here?

Thanks,
-Ekr

--
[Eric Rescorla                                   ekr at rtfm.com]
                      http://www.rtfm.com/




More information about the R-help mailing list