[Scipy-tickets] [SciPy] #1340: stats for invgamma

SciPy Trac scipy-tickets@scipy....
Sat Dec 4 09:30:09 CST 2010


#1340: stats for invgamma
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  scipy.stats  |     Version:  0.8.0   
 Keywords:               |  
-------------------------+--------------------------------------------------
Description changed by josefpktd:

Old description:

> 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

New description:

 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))
 }}}

--

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1340#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list