Did I find the right examples for you? yes no

# sympy.stats.Dagum

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

The density of the Dagum distribution is given by

.. math::
f(x) := \frac{a p}{x} \left( \frac{\left(\tfrac{x}{b}\right)^{a p}}
{\left(\left(\tfrac{x}{b}\right)^a + 1 \right)^{p+1}} \right)

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


        def Dagum(name, p, a, b):
r"""
Create a continuous random variable with a Dagum distribution.

The density of the Dagum distribution is given by

.. math::
f(x) := \frac{a p}{x} \left( \frac{\left(\tfrac{x}{b}\right)^{a p}}
{\left(\left(\tfrac{x}{b}\right)^a + 1 \right)^{p+1}} \right)

with :math:x > 0.

Parameters
==========

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

Returns
=======

A RandomSymbol.

Examples
========

>>> from sympy.stats import Dagum, density
>>> from sympy import Symbol, simplify

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

>>> X = Dagum("x", p, a, b)

>>> density(X)(z)
a*p*(z/b)**(a*p)*((z/b)**a + 1)**(-p - 1)/z

References
==========

.. [1] http://en.wikipedia.org/wiki/Dagum_distribution
"""

return rv(name, DagumDistribution, (p, a, b))


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,

    a = Symbol("a", positive=True)

X = Dagum('x', p, a, b)
assert density(X)(x) == a*p*(x/b)**(a*p)*((x/b)**a + 1)**(-p - 1)/x