STATISTICS

# Standard Deviation

## Overview

The standard deviation is a metric which is used to measure the amount of variation in a set of data values.

The standard deviation has the same units as the data.

## Equation

$$\sigma = \sqrt{\frac{ \sum{(x - \bar{x})?^2}}{n}}$$

where:
$$\bar{x}$$ is the mean (average) of the samples
$$n$$ is the number of samples

For example,

4, 8, 7, 3, 12

\begin{align} \bar{x} &= \frac{1}{5} * (4+8+7+3+12)\\ &= 6.8\\ \\ \sum{(x - \bar{x})} = (4-6.8)^2+(8-6.8)^2+(7-6.8)^2+(3-6.8)^2+(12-6.8)^2\\ = \end{align}

## Software

You can calculated the standard deviation of an array in Numpy with np.std():

np.std(my_array)


By default, the array is flattened. However, you can specify an axis on which to calculate the standard deviation.