scipy.stats.Uniform.

variance#

Uniform.variance(*, method=None)[source]#

Variance (central second moment)

Parameters:
method{None, ‘formula’, ‘transform’, ‘normalize’, ‘quadrature’, ‘cache’}

Method used to calculate the central second moment. Not all methods are available for all distributions. See moment for details.

References

Examples

Instantiate a distribution with the desired parameters:

>>> from scipy import stats
>>> X = stats.Normal(mu=1., sigma=2.)

Evaluate the variance:

>>> X.variance()
4.0
>>> X.variance() == X.moment(order=2, kind='central') == X.sigma**2
True