My Digital Garden

Mean and Variance

Basics

Given nn values of xx

X={x1,x2,...xn}\begin{alignedat}{1} & X = \lbrace x_1, x_2, ... x_n\rbrace \end{alignedat}

Mean of xx:

μx=1ni=1nxi\begin{alignedat}{1} & \mu_x = \frac 1 n \sum_{i=1}^{n}x_i \end{alignedat}

Variance of xx:

σx2=1n[i=1n(xiμx)2]\begin{alignedat}{1} & \sigma_x\,^2 = \frac 1 n \bigg[ \sum_{i=1}^{n}(x_i - \mu_x )^2 \bigg] \end{alignedat}

Standard Deviation of xx:

σx=1n[i=1n(xiμx)2]\begin{alignedat}{1} & \sigma_x = \sqrt{\frac 1 n \bigg[ \sum_{i=1}^{n}(x_i - \mu_x )^2 \bigg]} \end{alignedat}

Mean centring

Example

Given this set of values:

Z={1,5,12}μz=6σz2=13(25+1+36)=20.667\begin{alignedat}{1} Z &= \lbrace 1,5,12\rbrace \\ \\ \mu_z &= 6 \\ \\ \sigma_z\,^2 &= \frac 1 3 \centerdot (25 + 1 + 36 ) \\ \\ &= 20.667 \end{alignedat}

Now subtract the mean from each value:

Z={16,56,126}={5,1,6}μz=0σz2=13(25+1+36)=20.667\begin{alignedat}{1} \\ Z' &= \lbrace 1-6,5-6,12-6\rbrace \\ & = \lbrace -5,1,6\rbrace \\ \\ \mu_z' &= 0 \\ \\ \sigma_z\,^2 &= \frac 1 3 \centerdot (25 + 1 + 36 ) \\ \\ &= 20.667 \end{alignedat}

So mean-centring shifts the data horizontally along R\R but doesn't change the variance

Based on course material by Paul Bendich and Daniel Egger from Data Science Maths Skills

Referred in


Copyright

Unless otherwise noted all content on this site is (c) copyright Julian Elve 2020 onwards, released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence.

Mean and Variance