From 38322f475dfa96fe0e06fdf772fec17e088c20ac Mon Sep 17 00:00:00 2001 From: Roger Labbe Date: Sat, 7 Mar 2015 19:52:25 -0800 Subject: [PATCH] Added equation for standard deviation --- 04_Gaussians.ipynb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/04_Gaussians.ipynb b/04_Gaussians.ipynb index 1a47eae..1ed8ba9 100644 --- a/04_Gaussians.ipynb +++ b/04_Gaussians.ipynb @@ -386,7 +386,14 @@ "\n", "**The standard deviation is defined as the square root of the average of the squared differences from the mean.**\n", "\n", - "That's a mouthful; let's just work through that with the data from three classes. We just subtract the mean of x from each value of x, square it, take the average of those, and then take the square root of the result. The mean of $[1.8, 2.0, 1.7, 1.9, 1.6]$ is 1.8, so we compute the standard deviation as\n", + "That's a mouthful; as an equation this is stated as\n", + "\n", + "$$\\sigma = \\sqrt{\\frac{1}{N}\\sum_{i=1}^N(x_i - \\mu)^2}$$\n", + "\n", + "where $\\sigma$ is the notation for the standard deviation.\n", + "\n", + "\n", + "Let's just work through that with the data from three classes. We just subtract the mean of x from each value of x, square it, take the average of those, and then take the square root of the result. The mean of $[1.8, 2.0, 1.7, 1.9, 1.6]$ is 1.8, so we compute the standard deviation as\n", "\n", "$$ \n", "\\begin{aligned}\n", @@ -1001,7 +1008,7 @@ "Both ways of thinking about it are equivalent. We use the notation $\\sigma^2$ for the variance, and the equation for the variance is\n", "\n", "\n", - "$$\\sigma = \\frac{1}{N}\\sum_{i=1}^N(x_i - \\mu)^2$$\n", + "$$\\sigma^2 = \\frac{1}{N}\\sum_{i=1}^N(x_i - \\mu)^2$$\n", "\n", "\n", "To make sure we understand this let's compute the variance for $x$:\n", @@ -9093,7 +9100,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.4.3" + "version": "3.4.2" } }, "nbformat": 4,