Variation of a parameter, such as price data, is an important factor in risk management. A commodity with high price variation is considered a high-risk investment. Consequently, variation and measures of dispersion are among the useful information for traders and investors.
As we learned in the previous section, variance and standard deviation (square root of the variance) indicate variation in the data. Standard deviation measures the amount of variability or dispersion around the average. Standard deviation is more useful than variance, because it has the same unit as the parameter that it is representing, which makes it easier to compare and interpret the changes in price.
Standard deviation of the price
Standard deviation can be used as a measure of volatility. Volatility is a term for measuring the dispersion (in the prices, returns, …), which is widely used in the financial arena. Intuitively, when prices are volatile, it means prices have been changing a lot. Volatility is calculated based on the standard deviation. Volatility substantially affects the value of many financial instruments such as options (we will get to this in future lessons).
Note that standard deviation is dependent on the price level; commodities with higher price levels could have a higher standard deviation. So, calculated standard deviations have to be compared appropriately.
Example: The following table includes 10 prices for the NYMEX crude oil February futures contracts in January 2018 extracted from EIA. We are going to calculate the 10-period mean, variance, and standard deviation of these prices:
Date | Price | 10-period Average |
Difference (distance) |
Squared Difference |
10-period Sample daily Variance |
10-period Sample daily Standard Deviation |
---|---|---|---|---|---|---|
Jan 02, 2018 | 60.37 | -2.19 | 4.77 | |||
Jan 03, 2018 | 61.61 | -0.95 | 0.89 | |||
Jan 04, 2018 | 61.98 | -0.58 | 0.33 | |||
Jan 05, 2018 | 61.49 | -1.07 | 1.13 | |||
Jan 08, 2018 | 61.73 | -0.83 | 0.68 | |||
Jan 09, 2018 | 62.92 | 0.36 | 0.13 | |||
Jan 10, 2018 | 63.6 | 1.04 | 1.09 | |||
Jan 11, 2018 | 63.81 | 1.26 | 1.58 | |||
Jan 12, 2018 | 64.22 | 1.66 | 2.77 | |||
Jan 16, 2018 | 63.82 | 62.56 | 1.26 | 1.60 | 1.67 | 1.29 |
Note that the equation to calculate the sample variance is where is the average (10-period moving average) and represents the observations (each price data).
So, in order to calculate the sample variance, we need to calculate the summation of the fifth column and divide the summation by 9 (n-1).
Note that standard deviation is just the square root of the variance (the last column).
Note: Excel functions STDEV() or STDEV.S() can conveniently calculate the standard deviation of a price vector.
Moving Standard Deviation
We can calculate the standard deviation for a moving window of prices. In that case, we include a new price data each time and remove the oldest price data for calculating the new standard deviation. This is called moving (rolling or running) standard deviation.
Example: The following table shows the price data for the NYMEX crude oil February futures contracts in January 2018 extracted from EIA. We are going to calculate the 10-period moving mean, variance, and standard deviation:
Calculating the moving standard deviation, like what we did in the previous example, is not very straightforward. So, we will just use the Excel function STDEV() or STDEV.S() to calculate the 10-period moving standard deviation.
Date | Price | 10-period Sample daily Standard Deviation |
---|---|---|
2-Jan-18 | 60.37 | |
3-Jan-18 | 61.61 | |
4-Jan-18 | 61.98 | |
5-Jan-18 | 61.49 | |
8-Jan-18 | 61.73 | |
9-Jan-18 | 62.92 | |
10-Jan-18 | 63.6 | |
11-Jan-18 | 63.81 | |
12-Jan-18 | 64.22 | |
16-Jan-18 | 63.82 | 1.29 |
17-Jan-18 | 63.92 | 1.10 |
18-Jan-18 | 63.96 | 1.04 |
19-Jan-18 | 63.38 | 0.95 |
22-Jan-18 | 63.66 | 0.72 |
23-Jan-18 | 64.45 | 0.43 |
24-Jan-18 | 65.69 | 0.65 |
25-Jan-18 | 65.62 | 0.79 |
26-Jan-18 | 66.27 | 1.00 |
29-Jan-18 | 65.71 | 1.06 |
30-Jan-18 | 64.64 | 1.02 |
31-Jan-18 | 64.82 | 0.98 |