California Scientific

California Scientific
4011 Seaport Blvd
West Sacramento, CA 95691

Mark's Market Blog

Part 2: Average and Standard Deviation

By Mark Lawrence

• If you need a windshield, consider ours.
• Contribute to our site maintenance fund:
• Support our advertisers. Thanks, Mark  Standard Deviations Percentage Enclosed Percentage Above 1σ 2σ 3σ 4σ 5σ 6σ 7σ 68% 95% 99.7% 99.97% 99.999997% 99.99999999% 99.99999999999% 16% 2% 1.3/K 32/M 285/G 1/G 1/T

In part 1 we saw that if there's a bell shaped distribution curve, then we can calculate once we know the standard deviation. Here we'll learn how to calculate the standard deviation. In part 1, we measured the height of 100 men. Our results:

 Graph: Height Count 5'2" 5'3" 5'4" 5'5" 5'6" 5'7" 5'8" 5'9" 5'10" 5'11" 6' 6'1" 6'2" 6'3" 1 3 4 6 7 12 17 17 12 7 6 4 3 1

If we add up all the heights and divide by 100, we get the average height, 69" or 5'9".

 Height Difference Diff Squared 62 63 63 63 64 64 64 64 65 65 65 65 65 65 66 66 66 66 66 66 66 67 67 67 67 67 67 67 67 67 67 67 67 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 70 70 70 70 70 70 70 70 70 70 70 70 71 71 71 71 71 71 71 72 72 72 72 72 72 73 73 73 73 74 74 74 75 Sum: 6850 -6.5 -5.5 -5.5 -5.5 -4.5 -4.5 -4.5 -4.5 -3.5 -3.5 -3.5 -3.5 -3.5 -3.5 -2.5 -2.5 -2.5 -2.5 -2.5 -2.5 -2.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -1.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 3.5 3.5 3.5 3.5 3.5 3.5 4.5 4.5 4.5 4.5 5.5 5.5 5.5 6.5 Sum: 0 42.25 30.25 30.25 30.25 20.25 20.25 20.25 20.25 12.25 12.25 12.25 12.25 12.25 12.25 6.25 6.25 6.25 6.25 6.25 6.25 6.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 2.25 6.25 6.25 6.25 6.25 6.25 6.25 6.25 12.25 12.25 12.25 12.25 12.25 12.25 20.25 20.25 20.25 20.25 30.25 30.25 30.25 42.25 Sum: 725

In the table above, I've put all the height measurements in inches in the first row. At the end of the row is the sum of all the heights, 6850 inches. We divide 6850 by the number of measurements, 100, and we get the average height, 68.5.

In the next row, I've subtracted 68.5 from each height to get the difference from average. Someone who is 5'2" or 62 inches tall is -6.5" taller than average; someone who is 6'3" or 75 inches is 6.5" taller than average.

In the third row, I've squared each number in the second row. 6.5*6.5 = 42.25. At the end of the row, I've summed up the squared differences, the total is 725.

Now we find the average squared difference, that is we divide 725 by 100 to get 7.25. This number, the average squared difference, has a very important name. It's called the Variance. In investment theory we'll use variance as a measure of risk.

Finally we take the square root of the variance. The square root of 7.25 is about 2.7. The square root of the variance is the standard deviation. This number is also very important in investment theory. We're going to spend most of out time trying to maximize the return and minimize the risk, which we'll do by minimizing the standard deviation.

In a spread sheet you just load the price history in one column, and then at the bottom of the column average the column. The next column over is the price column minus the average, which gets you the difference. The next column, the variance column, is the square of the difference column. At the bottom of the variance column you again put the average of the column. This is the variance of the stock price. In the cell below that you put the square root of the variance, which is the standard deviation.

In math, if your price is p(i) and you have n prices, then the average A, the variance V and the standard deviation σ are:

Average = Σ p(i) / n.

Variance = Σ (p(i) - A)² / n.

Standard Deviation = σ = √V.

We can perform these calculations on any list of numbers. If we had the closing price of GM stock for each of the last 100 or so trading days, we could easily find the average price. We can then subtract the average price from each daily price and find the difference. We can then find the squared differences, and the average squared difference, which is the variance. Finally, the square root of the variance is the standard deviation of GM stock price. The standard deviation is also the rms difference, or root-mean-square difference. The standard deviation is also sometimes called the second moment of the distribution. The average price is called the first moment of the distribution. These words, the first and second moment, come from physics.

That's it for average and standard deviation. Next we'll look at covarience and correlation. These are measures of how well two prices track each other. We'll find out that this is key to constructing a low risk high return portfolio.