Now this is really specific. I think the cause of the error is a small sample size. For example. The following both fail:
fit <- fitdistr(c(120), "weibull") fit <- fitdistr(jiitter(c(120,120), amount=0.5), "weibull") As it is hard for me to control the sample size or the proximity of data values in the sample I was wondering how I can tell what the error modes for 'fitdistr' are? If I knew that 'fitdistr' will error out with a sample of of one or a sample of two values that are close then I could put a conditional statement an make a "reasonable" guess (something that I would expect 'fitdistr' to do). For example I could" if(length(templist) > 1) { fit <- fitdistr(templist, "weibull") } The problem is that I don't know all the possible error conditions. I know that having a sample size of 1 is bad and a sample of two "close" values is bad. Are there others? Thank you. Kevin ---- Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > See ?traceback > > /Henrik > > On Wed, Aug 13, 2008 at 7:33 PM, <[EMAIL PROTECTED]> wrote: > > This is both a specific question and a general one. First, I am running > > 'fitdistr' from library(MASS) and I get the following: > > > > Error in fitdistr(templist, "weibull") : optimization failed > > > > What is the cause of the error? How can I tell? Can I just catch this > > error, report it and move to the next set of data (eat the exception)? > > > > Thank you. > > > > Kevin > > > > ______________________________________________ > > R-help@r-project.org mailing list > > 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. > > ______________________________________________ R-help@r-project.org mailing list 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.