Skip to content

Gamma.InvCDF #825

Answered by cdrnet
bojtib asked this question in Q&A
Feb 23, 2017 · 1 comment
Discussion options

You must be logged in to vote

The Gamma distribution can be parameterized either by a shape (alpha) and a rate (beta) or a shape (alpha) and a scale (theta), where the scale is the inverse of the rate. Math.NET offers both when using an instance of the distribution, but the static members offer only the default one, which is shape and rate.

Given your numbers it seems to me what you refer to as beta is actually a scale, not a rate as hinted by the name. You can either convert your scale to a rate by inverting it, or use an instance to make it explicit:

Gamma.InvCDF(2.0, 1/3.0, 0.12) // static function
Gamma.WithShapeScale(2.0, 3.0).InverseCumulativeDistribution(0.12) // instance method

Both return 1.78264358009477.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cdrnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #479 on July 24, 2021 07:37.