[S] bug in the rate parameter for gamma dist.?

Leslie Foldager (leslie@constat.dk)
Thu, 4 Jun 1998 15:15:38 +0200


Hi,

The rate parameter of a gamma distribution should (as far as I know) be
positive, but it is possible to set the rate in the rgamma, qgamma etc.
functions to a negative value. This gives negative values from for example
rgamma

ex.:
> rgamma(3,1,-1)
[1] -3.2084157638 -0.5094224287 -0.7898035442
>

To me this seems to be a bug - correct me if I'm wrong.

If instead we try to let the shape parameter be negative, we get the
following:

> rgamma(3,-1,1)
[1] NA NA NA
Warning messages:
One or more nonpositive parameters in: rgamma(3, -1, 1)
>

as we would expect.

Leslie.

-----------------------------------------
Leslie Foldager
ConStat
The North Sea Centre
P.O. Box 104
DK-9850 Hirtshals
Denmark
Tel: +45 98 94 35 52
Fax: +45 98 94 48 33
E-mail: leslie@constat.dk
WEB: www.constat.dk
---------------------------------------------------

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news