Hi, I want to estimate parameters of weibull distribution. For this, I am using fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I get a Error as follows:- Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L, : non-finite value supplied by optim Any help or suggestions are most welcomed -- View this message in context: http://n4.nabble.com/Problems-with-fitdistr-tp1334772p1334772.html Sent from the R help mailing list archive at Nabble.com.
Try to pass a start value to help optim (see ?fitdistr) Ciao! mario vikrant wrote:> Hi, > I want to estimate parameters of weibull distribution. For this, I am using > fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I > get a Error as follows:- > Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L, > : > non-finite value supplied by optim > Any help or suggestions are most welcomed-- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
Do you have any zeros in your data? fitdistr() will need start values (see the code), but even with start values, optim() will have problems. x <- rweibull(100, 2, 10) fitdistr(x, "weibull") ## no problem fitdistr(c(0,x), "weibull") ## your error message fitdistr(c(0,x), "weibull",start=list(shape=2,scale=10)) ## still an error message from optim() -Peter Ehlers vikrant wrote:> Hi, > I want to estimate parameters of weibull distribution. For this, I am using > fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I > get a Error as follows:- > Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L, > : > non-finite value supplied by optim > Any help or suggestions are most welcomed-- Peter Ehlers University of Calgary
vikrant wrote:> Hi, > I want to estimate parameters of weibull distribution. For this, I am using > fitdistr() function in MASS package.But when I give fitdistr(c,"weibull") I > get a Error as follows:- > Error in optim(x = c(4L, 41L, 20L, 6L, 12L, 6L, 7L, 13L, 2L, 8L, 22L, > : > non-finite value supplied by optim > Any help or suggestions are most welcomedUse function pelwei() in package lmom. J. R. M. Hosking
Yes I do have zeros in my data. But I m not able to understand y inclusion of zeros results in error messages, because range for x in weibull distribution is x>=0. Can you please clarify this doubt? -- View this message in context: http://n4.nabble.com/Problems-with-fitdistr-tp1334772p1401513.html Sent from the R help mailing list archive at Nabble.com.
Possibly Parallel Threads
- Adding gamma and 3-parameter log normal distributions to L-moments ratio diagram lmrd()
- MASS fitdistr with plyr or data.table?
- threshold distribution
- weibull fitdistr problem: optimization failed
- Optimization failed in fitting mixture 3-parameter Weibull distri bution using fitdistr()