Ten days of statistics (2) - Quatiles, Standard Deviation
Quartiles
The quartiles of an ordered data set are the points that split the data set size into equal groups. is the median of the set, is the median of upper half, is the median of lower half. When odd, the median is not included in the upper half and lower half set.
Example 1
Take a set .
Then
Example 2
Take set .
Then
Standard deviation
Variance of a set is the average magnitude of fluctuations of from its mean . Formally:
The standard deviation of a set is square root of it’s variance. Formally:
Application of standard deviation
High standard deviation means the average data point is far away from the mean. In plain English, we are not very sure about using the mean as an expected value.
Conversely, low standard deviation means the average data point is close to the mean. Which means, we can use the mean as an expected value confidently.
For example, let’s take 2 stock’s historical performance over 10 years:
- Stock A: mean annual return = 7%, standard deviation of annual returns = 7%
- Stock B: mean annual return = 7%, standard deviation of annual returns = 2%
Both stocks have the same average rate of return, but the volatility is much higher with stock A. If you are an adventurous man, you should pick stock A.
Practice
Hackerrank has some exercises for you to test your knowledge:
- https://www.hackerrank.com/challenges/s10-quartiles/problem
- https://www.hackerrank.com/challenges/s10-interquartile-range/problem
- https://www.hackerrank.com/challenges/s10-standard-deviation/problem
Next lesson: Probability