I am trying to estimate the shape and scale of a data set.
I used two different ways and for both I got an error message:
First, I tried by moments using the survey
package:
survreg(Surv(all.ws)~1, dist="weibull")
I got the error message:
invalid survival times for this distribution
Second, I tried using fitdistr()
function:
fitdistr(all.ws, densfun=dweibull, start=list(scale=1, shape=2))
I got an error message:
Error in optim(x=c(2.2, 2.1,1.9....:
initial value in 'vmmin' is not finite
What is wrong with what I am doing?
A google search "fitdistr Weibull Error" shows this exact question was discussed a year ago on the R-help mailing list: http://r.789695.n4.nabble.com/Problems-with-fitdistr-td1334772.html
Some points from that link:
zeros in your data will cause problems
use pelwei() function from package lmom