scipy.stats.Mixture.
variance#
- Mixture.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.
See also
References
[1]Variance, Wikipedia, https://en.wikipedia.org/wiki/Variance#Absolutely_continuous_random_variable
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