Did I find the right examples for you? yes no

sympy.stats.WignerSemicircle

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

The density of the Wigner semicircle distribution is given by

.. math::
f(x) := \frac2{\pi R^2}\,\sqrt{R^2-x^2}

with :math:x \in [-R,R].

Parameters(more...)


        def WignerSemicircle(name, R):
r"""
Create a continuous random variable with a Wigner semicircle distribution.

The density of the Wigner semicircle distribution is given by

.. math::
f(x) := \frac2{\pi R^2}\,\sqrt{R^2-x^2}

with :math:x \in [-R,R].

Parameters
==========

R : Real number, R > 0, the radius

Returns
=======

A RandomSymbol.

Examples
========

>>> from sympy.stats import WignerSemicircle, density, E
>>> from sympy import Symbol, simplify

>>> R = Symbol("R", positive=True)
>>> z = Symbol("z")

>>> X = WignerSemicircle("x", R)

>>> density(X)(z)
2*sqrt(R**2 - z**2)/(pi*R**2)

>>> E(X)
0

References
==========

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

return rv(name, WignerSemicircleDistribution, (R,))


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_wignersemicircle():
R = Symbol("R", positive=True)

X = WignerSemicircle('x', R)
assert density(X)(x) == 2*sqrt(-x**2 + R**2)/(pi*R**2)
assert E(X) == 0