Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# crv_types.GammaInverse

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Create a continuous random variable with an inverse Gamma distribution.

The density of the inverse Gamma distribution is given by

.. math::
f(x) := \frac{\beta^\alpha}{\Gamma(\alpha)} x^{-\alpha - 1}
\exp\left(\frac{-\beta}{x}\right)

with :math:x > 0.
(more...)


        def GammaInverse(name, a, b):
r"""
Create a continuous random variable with an inverse Gamma distribution.

The density of the inverse Gamma distribution is given by

.. math::
f(x) := \frac{\beta^\alpha}{\Gamma(\alpha)} x^{-\alpha - 1}
\exp\left(\frac{-\beta}{x}\right)

with :math:x > 0.

Parameters
==========

a : Real number, a > 0 a shape
b : Real number, b > 0 a scale

Returns
=======

A RandomSymbol.

Examples
========

>>> from sympy.stats import GammaInverse, density, cdf, E, variance
>>> from sympy import Symbol, pprint

>>> a = Symbol("a", positive=True)
>>> b = Symbol("b", positive=True)
>>> z = Symbol("z")

>>> X = GammaInverse("x", a, b)

>>> D = density(X)(z)
>>> pprint(D, use_unicode=False)
-b
---
a  -a - 1   z
b *z      *e
---------------
gamma(a)

References
==========

..  http://en.wikipedia.org/wiki/Inverse-gamma_distribution
"""

return rv(name, GammaInverseDistribution, (a, b))