Which One is riskier? Assessing Stock Risk with the F-Test
If you’re choosing between two stocks, you don’t just want to know which one has a higher return. you want to know which one is more likely to give you a heart attack. In Chapter 9 of Data Analytics for Finance Using Python, we look at the F-Test as a way to compare risk.
Variance = Risk
In finance, risk is often measured by “variance”—basically, how much the price swings around its average. The F-Test is a statistical tool that compares the variances of two different samples to see if they’re significantly different.
The Experiment
The authors took two different stocks and looked at their daily closing prices over a 12-day period. They set up two hypotheses:
- Null Hypothesis: Both stocks have the same variance (same risk).
- Alternative Hypothesis: One stock is riskier than the other.
The Results
Using the scipy.stats library in Python, they ran the test and got a p-value of 0.13.
Here’s the thing: in statistics, we usually look for a p-value less than 0.05 to call something “significant.” Since 0.13 is much higher than 0.05, the authors couldn’t reject the null hypothesis.
What does that mean?
It means that, statistically speaking, there was no real difference in the risk levels of these two stocks over that 12-day period. They were basically equally “risky” or “safe.”
And that’s why it matters. Before you move your money from one stock to another because it “feels” more stable, you can run an F-Test to see if that stability is actually real or just a short-term fluke.
But here’s the problem: the F-Test assumes your data follows a normal distribution (the bell curve). If your stock is prone to “black swan” events or weird spikes, the F-Test might lead you astray.
Next: Assessing Stock Risk with the T-Test | Previous: Stock Prediction with Multiple Regression