variance — SciPy v1.15.3 Manual (original) (raw)

scipy.stats.Uniform.

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. Seemoment 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