Variance

Variance[list]

gives the sample variance of the elements in list.

Variance[dist]

gives the variance of the distribution dist.

Details

  • Variance measures dispersion of data or distributions.
  • Variance[list] gives the unbiased estimate of variance.
  • Variance[list] is equivalent to Total[(list-Mean[list])^2]/(Length[list]-1) for real-valued data.
  • For complex data, Variance[list] is equivalent to (list-Mean[list]).Conjugate[list-Mean[list]]/(Length[list]-1).
  • Variance handles both numerical and symbolic data.
  • Variance[{{x1,y1,},{x2,y2,},}] gives {Variance[{x1,x2,}],Variance[{y1,y2,}]}.
  • Variance[dist] is equivalent to Expectation[(x-μ)2,xdist] with μ=Mean[dist].

Examples

open allclose all

Basic Examples  (3)

Variance of a list of numbers:

Variance of elements in each column:

Variance of a parametric distribution:

Scope  (13)

Data  (10)

Exact input yields exact output:

Approximate input yields approximate output:

Variance for a matrix gives columnwise variances:

Variance for a tensor gives columnwise variances at the first level:

Works with large arrays:

SparseArray data can be used just like dense arrays:

Find the variance of WeightedData:

Find the variance of EventData:

Find the variance of TemporalData:

Find the variance of a TimeSeries:

The variance depends only on the values:

Find the variance of data involving quantities:

Distributions and Processes  (3)

Find the variance for univariate distributions:

Multivariate distributions:

Variance for derived distributions:

Data distribution:

Variance function for a random process:

Applications  (5)

Variance is a measure of dispersion:

Compute a moving variance for samples of three random processes:

Compare data volatility by smoothing with moving variance:

Find the mean and variance for the number of great inventions and scientific discoveries in each year from 1860 to 1959:

Investigate weak stationarity of the process data by analyzing variance of slices:

Use a larger plot range to see how relatively small the variations are:

Find the variance of the heights for the children in a class:

Properties & Relations  (11)

The square root of Variance is StandardDeviation:

Variance is a scaled squared Norm of deviations from the Mean:

Variance is a scaled CentralMoment:

The square root of Variance is a scaled RootMeanSquare of the deviations:

Variance is a scaled Mean of squared deviations from the Mean:

Variance is a scaled SquaredEuclideanDistance from the Mean:

Variance is less than MeanDeviation if all absolute deviations are less than 1:

Variance is greater than MeanDeviation if all absolute deviations are greater than 1:

Variance of a random variable as an Expectation:

Variance gives an unbiased sample estimate:

Unbiased means that the expected value of the sample variance with respect to the population distribution equals the variance of the underlying distribution:

Variance gives an unbiased weighted sample estimate:

Unbiased means that the expected value of the sample variance with respect to the population distribution equals the variance of the underlying distribution:

Neat Examples  (1)

The distribution of Variance estimates for 20, 100, and 300 samples:

Wolfram Research (2003), Variance, Wolfram Language function, https://reference.wolfram.com/language/ref/Variance.html (updated 2007).

Text

Wolfram Research (2003), Variance, Wolfram Language function, https://reference.wolfram.com/language/ref/Variance.html (updated 2007).

CMS

Wolfram Language. 2003. "Variance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/Variance.html.

APA

Wolfram Language. (2003). Variance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Variance.html

BibTeX

@misc{reference.wolfram_2022_variance, author="Wolfram Research", title="{Variance}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Variance.html}", note=[Accessed: 09-June-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_variance, organization={Wolfram Research}, title={Variance}, year={2007}, url={https://reference.wolfram.com/language/ref/Variance.html}, note=[Accessed: 09-June-2023 ]}