Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Create a Continuous Random Variable with a U-quadratic distribution.

The density of the U-quadratic distribution is given by

.. math::
    f(x) := \alpha (x-\beta)^2

with :math:`x \in [a,b]`.

Parameters(more...)

        def QuadraticU(name, a, b):
    r"""
    Create a Continuous Random Variable with a U-quadratic distribution.

    The density of the U-quadratic distribution is given by

    .. math::
        f(x) := \alpha (x-\beta)^2

    with :math:`x \in [a,b]`.

    Parameters
    ==========

    a : Real number
    b : Real number, :math:`a < b`

    Returns
    =======

    A RandomSymbol.

    Examples
    ========

    >>> from sympy.stats import QuadraticU, density, E, variance
    >>> from sympy import Symbol, simplify, factor, pprint

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

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

    >>> D = density(X)(z)
    >>> pprint(D, use_unicode=False)
    /                2
    |   /  a   b    \
    |12*|- - - - + z|
    |   \  2   2    /
    <-----------------  for And(a <= z, z <= b)
    |            3
    |    (-a + b)
    |
    \        0                 otherwise

    References
    ==========

    .. [1] http://en.wikipedia.org/wiki/U-quadratic_distribution
    """

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


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_quadratic_u():
    a = Symbol("a", real=True)
    b = Symbol("b", real=True)
 
    X = QuadraticU("x", a, b)