Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-12-19 09:52:51


Hi John, thanks for your reply. Your answer is basically what the
documentation describes. But, it still leaves me with question marks
in my head.

Let me ask differently. How do I construct the the red curve in the
second image? Parameters here are: Shape = 1 and Scale = 1. BTW,
shouldn't be the "scale" box in the second image be called "rate"?

Thanks again,
Christian

On Dec 19, 2007 4:46 AM, John Maddock <john_at_[hidden]> wrote:
>
> Christian Henning wrote:
> > Hi there, the documention of the gamma distribution talks about two
> > different forms. How can can generate the second one with shape=1 and
> > scale=1? I know how to get the first form:
> >
> > boost::math::gamma_distribution<> dist( 1, 1 );
> >
> > I don't see how to get the second one?
>
> Right, the distribution takes two parameters: shape and *scale*, so the
> construction is always:
>
> boost::math::gamma_distribution<> d(myshape, myscale);
>
> If instead you have parameters shape and *rate* then it's constructed as:
>
> boost::math::gamma_distribution<> d(myshape, 1/myrate);
>
> Or as noted in the docs "Therefore to construct a Gamma Distribution from a
> rate parameter, you should pass the reciprocal of the rate as the scale
> parameter."
>
> In other words the a rate parameter is simply the reciprocal of the scale,
> and vice versa.
>
> Any clearer?
>
> HTH, John.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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