Ben Bolker wrote: > Matthew B. <mtthw.bt <at> gmail.com> writes: > > >> Dear R users, >> >> This is a basic question. >> >> I want to fit a Weibull distribution. fitdistr(data, "weibull") works and it >> is a maximum likelihood fitting. Is it a good method ? Or is it better to >> write a function for the log-likelihood and the gradient and to use a >> numerical routine ? >> >> Fitdistr works for uncensored data, but what can I use for censored (and >> uncensored) data ? >> >> > > fitdistr() is just fine for simple data. > for censored data you will indeed have to make up > your own negative log-likelihood function, using > dweibull() for uncensored data and pweibull() for > censored data. You don't need to write a function > for the gradient (R will compute derivatives by > finite differences automatically) unless you are > very concerned with speed and stability. > You shouldn't need anything beyond pweibull, > dweibull, and optim (or mle in the stats4 package). > > Ben Bolker > ______________________________________________ > > > Do You have a example for how to make this??
TIA Cleber ______________________________________________ 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.