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:
If we add up all the heights and divide by 100, we get the average height, 69" or 5'9".
|Diff Squared||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.