# Variance

Variance is Standard Deviation squared, i.e. $σ_{2}$. $σ_{2}=Var(X)=E[X−E(X)]_{2}=E(X_{2})−[E(X)]_{2}=E(X_{2})−μ_{2}$ I just realized that this is kind of the formula for Squared Euclidean Distance, and this was talked about the Curse of Dimensionality, which is $σ_{2}→0$ as the dimensionality increases.

From the Standard Deviation formula, I guess we can say the variance of a sample can also be expressed as $σ_{2}$ represents the variance of a population, $σ_{2}=n1 ∑_{i=1}(x_{i}−xˉ)_{2}$

If you are looking the variance of a sample, this would be given by $s_{2}=n−11 ∑_{i=1}(x_{i}−xˉ)_{2}=n−11 (∑x_{i}−n(∑x_{i})_{2} )$

I think variance of a Distribution vs. variance of a sample is very different. I don’t know how the later is derived.

- $Var(x)=E(x_{2})−(E(x))_{2}$
- $Var(x)=∫_{−∞}x_{2}f(x)dx−[∫_{−∞}x(f(x)]_{2}$ “average of squares” and the square of sums

Properties:

- If $X$ is a constant, then $Var(X)=0$
- Standard Deviation $σ=Var(X) $
- $Var(aX)=a_{2}Var(X)$
- $Var(aX+b)=a_{2}Var(X)$
- $Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)$ see Covariance

### Incremental Variance

Learning about this as I am on Ericsson’s team for an AI study. The problem is that when we have memory constraints, we cannot store all of it and then compute it afterwards, using the standard equation.

We want a recurrence relation. https://math.stackexchange.com/questions/374881/recursive-formula-for-variance

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

I used Welford’s Online Algorithm, just check out the wikipedia article.

### Sample Variance vs. Population Variance

The act of dividing by $n−1$ instead of $n$ to calculate the sample is known as Bessel’s Correction