Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats for invgamma (Trac #1340) #1866

Closed
scipy-gitbot opened this issue Apr 25, 2013 · 4 comments
Closed

stats for invgamma (Trac #1340) #1866

scipy-gitbot opened this issue Apr 25, 2013 · 4 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected good first issue Good topic for first contributor pull requests, with a relatively straightforward solution Migrated from Trac scipy.stats
Milestone

Comments

@scipy-gitbot
Copy link

Original ticket http://projects.scipy.org/scipy/ticket/1340 on 2010-12-04 by @josef-pkt, assigned to unknown.

invgamma does not contain _stats, and no information that the moments might only exist or be finite if alpha is large enough.

From the wikipedia description
http://en.wikipedia.org/wiki/Inverse-gamma_distribution
it looks relatively easy to add explicit formulas for _stats().

parameterization alpha is a, beta is scale

incorrect skew at a=2.99 (skew requires a>3 )

>>> stats.invgamma.stats(2.99, moments='mvsk')
(array(0.50251256281407031), array(0.2550695715009747), array(390.05497509454568), array(-789.86454653467047))
>>> stats.invgamma.stats(3., moments='mvsk')
(array(0.5), array(0.25), array(1.#INF), array(-1.#IND))
>>> stats.invgamma.stats(3.1, moments='mvsk')
(array(0.47619047619047616), array(0.20614306328592044), array(41.952353926806026), array(-73.619999999999919))

incorrect variance at a=1.99 (variance requires a > 2)

>>> stats.invgamma.stats(1.99, moments='mvsk')
(array(1.0101010101010102), array(99.989796959493844), array(-0.20405122222445857), array(-2.9739028311131137))
>>> stats.invgamma.stats(2., moments='mvsk')
(array(1.0), array(1.#INF), array(-1.#IND), array(-1.#IND))
>>> stats.invgamma.stats(2.1, moments='mvsk')
(array(0.90909090909090906), array(8.2644628099173456), array(-0.55515541145178238), array(-2.8299415204678362))
@scipy-gitbot
Copy link
Author

Milestone changed to Unscheduled by @rgommers on 2011-06-12

@ev-br
Copy link
Member

ev-br commented Sep 9, 2013

Ha been fixed in #2841.

@pv
Copy link
Member

pv commented Sep 9, 2013

Fixed then.

@pv pv closed this as completed Sep 9, 2013
@pv pv reopened this Sep 10, 2013
@rgommers
Copy link
Member

Fixed by gh-2849. Thanks @EvgeniBurovski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected good first issue Good topic for first contributor pull requests, with a relatively straightforward solution Migrated from Trac scipy.stats
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants