California Scientific
4011 Seaport Blvd
West Sacramento, CA 95691
Sales@CalSci.com
800-284-8112
916-372-6800

Mark's Market Blog

Part 2: Average and Standard Deviation

By Mark Lawrence

Please help support this web site

  • If you need a windshield, consider ours.
  • Contribute to our site maintenance fund:
  • Support our advertisers. Thanks, Mark

gaussian

Standard Deviations
Percentage Enclosed68%95%99.7%99.97%99.999997%99.99999999%99.99999999999%
Percentage Above16%2%1.3/K32/M285/G1/G1/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:

Measuring the height of 100 American men
Graph:gaussian
Height5'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"
Count134671217171276431

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

Height62636363646464646565656565656666 666666666667676767676767676767676768 686868686868686868686868686868686969 696969696969696969696969696969707070 707070707070707070717171717171717272 727272727373737374747475Sum: 6850
Difference-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.50.50.50.50.50.5 0.50.50.50.50.50.50.50.50.50.50.50.51.51.51.51.51.5 1.51.51.51.51.51.51.52.52.52.52.52.52.52.53.53.53.5 3.53.53.54.54.54.54.55.55.55.56.5Sum: 0
Diff Squared42.2530.2530.2530.2520.2520.2520.2520.2512.2512.25 12.2512.2512.2512.256.256.256.256.256.256.256.252.252.252.25 2.252.252.252.252.252.252.252.252.250.250.250.250.250.25 0.250.250.250.250.250.250.250.250.250.250.250.250.250.25 0.250.250.250.250.250.250.250.250.250.250.250.250.250.25 0.252.252.252.252.252.252.252.252.252.252.252.252.256.25 6.256.256.256.256.256.2512.2512.2512.2512.2512.2512.2520.25 20.2520.2520.2530.2530.2530.2542.25Sum: 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.


Next Page