error in dweibull (PR#405)

Prof Brian Ripley Prof Brian Ripley <ripley@stats.ox.ac.uk>
Thu, 27 Jan 2000 17:10:23 +0000 (GMT)


> From: setzer.woodrow@epa.gov
> Date: Thu, 27 Jan 2000 16:37:08 +0100 (MET)

> dweibull(0,1,1) evaluates to 0; it should be 1.  

Is that not a matter of opinion?  Note the help page says

     The Weibull distribution with `shape' parameter a and
     `scale' parameter b has density given by

             f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)

     for x > 0.


> Note that dweibull(.Machine$double.eps) evaluates to 1.
> 
> > dweibull(.01,1,1)
> [1] 0.9900498
> > dweibull(.00001,1,1)
> [1] 0.99999
> > dweibull(.Machine$double.eps,1,1)
> [1] 1
> > dweibull(0,1,1)
> [1] 0

I would say the Weibull density was defined to be non-zero on (0, Inf),
and S-PLUS agrees with me, as does the help page.  I don't see a bug in
the results you present which are consistent with the documentation.


-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._