Boost logo

Boost Users :

Subject: Re: [Boost-users] [Math Toolkit] Gamma Distribution
From: John Maddock (john_at_[hidden])
Date: 2009-07-21 04:34:32


> I am confused about the graphs in Gamma Distribution documentation page:
> http://www.boost.org/doc/libs/1_39_0/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html
>
> The first (blue) curve in the first graph suggests that Gamma PDF(0.0,
> 0.5, 1.0)
> == 1.0. Is this correct? Shouldn't it go to infinity as x approaches 0?

It does: the graph is generated automagically, and it just so happens that
for that choice of parameters the smallest value sampled is 0.94 giving a
misleading looking graph, I'll try and tweak things so it's clear that the
curve goes to infinity for shape < 1.

> PDF(x, k, theta) = x^(k-1)*exp(-x/theta)/(theta^k*gamma(k))
> PDF(0.0, 0.5, 1.0) = 0^(-0.5)*1/gamma(0.5) = 1/(0^0.5 * gamma(0.5)) = Inf
>
> In the second graph both first and third curves have scale = 2 and shape =
> 2,
> yet they look different.

Ooops, the labels are wrong: should be scale = 0.5, 1 and 2, will fix in SVN
shortly.

Apologies for the confusion, and thanks for the feedback!

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net