Re: [R] Weibull

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 15 Apr 2008 20:32:19 +0100 (BST)

For (possibly) censored data, survreg() in package survival can be used (just regress on a constant). The parametrization is slightly different from [dpqr]weibull, but it is easy to do the translation.

On Tue, 15 Apr 2008, 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
>
> ______________________________________________
> R-help_at_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.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_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.
Received on Tue 15 Apr 2008 - 19:40:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Apr 2008 - 20:31:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive