Did I find the right examples for you? yes no

# sympy.stats.BetaPrime

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Create a continuous random variable with a Beta prime distribution.

The density of the Beta prime distribution is given by

.. math::
f(x) := \frac{x^{\alpha-1} (1+x)^{-\alpha -\beta}}{B(\alpha,\beta)}

with :math:x > 0.

Parameters(more...)


        def BetaPrime(name, alpha, beta):
r"""
Create a continuous random variable with a Beta prime distribution.

The density of the Beta prime distribution is given by

.. math::
f(x) := \frac{x^{\alpha-1} (1+x)^{-\alpha -\beta}}{B(\alpha,\beta)}

with :math:x > 0.

Parameters
==========

alpha : Real number, \alpha > 0, a shape
beta : Real number, \beta > 0, a shape

Returns
=======

A RandomSymbol.

Examples
========

>>> from sympy.stats import BetaPrime, density
>>> from sympy import Symbol, pprint

>>> alpha = Symbol("alpha", positive=True)
>>> beta = Symbol("beta", positive=True)
>>> z = Symbol("z")

>>> X = BetaPrime("x", alpha, beta)

>>> D = density(X)(z)
>>> pprint(D, use_unicode=False)
alpha - 1        -alpha - beta
z         *(z + 1)             *gamma(alpha + beta)
---------------------------------------------------
gamma(alpha)*gamma(beta)

References
==========

.. [1] http://en.wikipedia.org/wiki/Beta_prime_distribution
.. [2] http://mathworld.wolfram.com/BetaPrimeDistribution.html
"""

return rv(name, BetaPrimeDistribution, (alpha, beta))


from sympy.stats import (P, E, where, density, variance, covariance, skewness,
given, pspace, cdf, ContinuousRV, sample,
Arcsin, Benini, Beta, BetaPrime, Cauchy,
Chi, ChiSquared,
ChiNoncentral, Dagum, Erlang, Exponential,

def test_betaprime():
alpha = Symbol("alpha", positive=True)
beta = Symbol("beta", positive=True)

X = BetaPrime('x', alpha, beta)