Closed cgled closed 4 years ago
If I'm not mistaken, the gamma distribution has positive support, so the density function should not be negative when called on negative numbers.
However:
g: breeze.stats.distributions.Gamma = Gamma(1.0,0.1) scala> g.pdf(-.1) res0: Double = 9.999999999999998
on the other hand, the cdf is as I'd expect:
scala> g.cdf(-.10) res3: Double = 0.0
Looking at the source, there are some special cases for the density function returning a positive value when the argument is negative; I'm not sure what the rationale is for these.
(Sorry for the slow response. it appears I stopped receiving github notifications.)
Good catch. I don't know why it's like this. I'll fix soon
If I'm not mistaken, the gamma distribution has positive support, so the density function should not be negative when called on negative numbers.
However:
on the other hand, the cdf is as I'd expect:
Looking at the source, there are some special cases for the density function returning a positive value when the argument is negative; I'm not sure what the rationale is for these.