Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
Create a continuous random variable with the Pareto distribution.

The density of the Pareto distribution is given by

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

with :math:`x \in [x_m,\infty]`.

Parameters(more...)

        def Pareto(name, xm, alpha):
    r"""
    Create a continuous random variable with the Pareto distribution.

    The density of the Pareto distribution is given by

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

    with :math:`x \in [x_m,\infty]`.

    Parameters
    ==========

    xm : Real number, `x_m > 0`, a scale
    alpha : Real number, `\alpha > 0`, a shape

    Returns
    =======

    A RandomSymbol.

    Examples
    ========

    >>> from sympy.stats import Pareto, density
    >>> from sympy import Symbol

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

    >>> X = Pareto("x", xm, beta)

    >>> density(X)(z)
    beta*xm**beta*z**(-beta - 1)

    References
    ==========

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

    return rv(name, ParetoDistribution, (xm, alpha))
        


src/s/y/sympy-HEAD/sympy/stats/tests/test_continuous_rv.py   sympy(Download)
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_pareto():
    xm, beta = symbols('xm beta', positive=True, bounded=True)
    alpha = beta + 5
    X = Pareto('x', xm, alpha)
 
    dens = density(X)
def test_pareto_numeric():
    xm, beta = 3, 2
    alpha = beta + 5
    X = Pareto('x', xm, alpha)
 
    assert E(X) == alpha*xm/S(alpha - 1)