From bolker at zoo.ufl.edu  Fri Nov  4 16:05:19 2005
From: bolker at zoo.ufl.edu (Ben Bolker)
Date: Fri, 04 Nov 2005 10:05:19 -0500
Subject: [Rd] dgamma error condition?
Message-ID: <436B78AF.9010602@zoo.ufl.edu>


   There's an apparent inconsistency between the
behavior of d(pqr)gamma and other distribution
functions for "bad" parameter values.  Specifically,
most distributions give NaN and a warning for bad
parameters (e.g. probabilities <0 or >1).  In contrast,
d(pqr)gamma actually gives an error and stops when shape<0.
I don't see why it has to be this way -- the internal
C code is set up to detect shape<0 (or scale<0) and
return NaN and a warning, and none of the other
distribution functions in that bit of the code have
similar behavior.

   It would seem more consistent (and would be more
convenient for me -- the error-instead-of-warning
is making me have to jump through additional hoops)
if dgamma just returned NaN and a warning.

    Any thoughts?

   cheers
     Ben Bolker



[Rd] dgamma error condition?
Ben Bolker