Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# crv_types.UniformSum

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Create a continuous random variable with an Irwin-Hall distribution.

The probability distribution function depends on a single parameter
n which is an integer.

The density of the Irwin-Hall distribution is given by

.. math ::
f(x) := \frac{1}{(n-1)!}\sum_{k=0}^{\lfloor x\rfloor}(-1)^k
\binom{n}{k}(x-k)^{n-1}(more...)


        def UniformSum(name, n):
r"""
Create a continuous random variable with an Irwin-Hall distribution.

The probability distribution function depends on a single parameter
n which is an integer.

The density of the Irwin-Hall distribution is given by

.. math ::
f(x) := \frac{1}{(n-1)!}\sum_{k=0}^{\lfloor x\rfloor}(-1)^k
\binom{n}{k}(x-k)^{n-1}

Parameters
==========

n : A positive Integer, n > 0

Returns
=======

A RandomSymbol.

Examples
========

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

>>> n = Symbol("n", integer=True)
>>> z = Symbol("z")

>>> X = UniformSum("x", n)

>>> D = density(X)(z)
>>> pprint(D, use_unicode=False)
floor(z)
___
\
\         k         n - 1 /n\
)    (-1) *(-k + z)     *| |
/                         \k/
/__,
k = 0
--------------------------------
(n - 1)!

References
==========

..  http://en.wikipedia.org/wiki/Uniform_sum_distribution
..  http://mathworld.wolfram.com/UniformSumDistribution.html
"""

return rv(name, UniformSumDistribution, (n, ))



`