Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

GeneralizedBetaDistribution.ProbabilityDensityFunction does not have an area of 1 #630

Closed
arubiomoreno opened this issue Jun 5, 2017 · 1 comment

Comments

@arubiomoreno
Copy link

arubiomoreno commented Jun 5, 2017

The PDF should have an area of 1 by definition. The current implementation has an area of Support.Length. The fix is as simple as changing this line:
return constant * Math.Pow(z, alpha - 1) * Math.Pow(1 - z, beta - 1);
for this line:
return constant * Math.Pow(z, alpha - 1) * Math.Pow(1 - z, beta - 1) / Support.Length;

Edit: check also GeneralizedBetaDistribution.LogProbabilityDensityFunction

@cesarsouza
Copy link
Member

Hi Arubio,

Huge thanks! I will commit the fix in a moment, after all the unit tests finish passing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants