YF.download() has changed argument auto_adjust default to True
Investment Theory
Fall 2025
Example 1 (Variance Decomposition) Suppose that you have the following regression for stock A: R_{A} = \alpha_{A} + \beta_{A} R_{M} + e_{A}, where \alpha_{A} = 0.02, \beta_{A} = 1.2, \sigma(e_{A}) = 30\% and \sigma_{M} = 25\%. The variance of A can be computed as follows: \sigma_{A}^{2} = 1.2^{2} \times 0.25^{2} + 0.30^{2} = 0.09 + 0.09 = 0.18. In the previous expression, the systematic and idiosyncratic variances are the same. The standard deviation of A is then \sigma_{A} = \sqrt{0.18} = 42.43\%.
Example 2 (Decomposing the Variance) You run the regression R_{B} = \alpha_{B} + \beta_{B} R_{M} + e_{B}. Your regression package reports that \alpha_{B} = -0.01, \beta_{B} = 0.8 and the R-squared is 0.4. If the volatility of the market is 25% per year, the systematic variance is 0.8^{2} \times 0.25^{2} = 0.04. Since 40% of the variance is systematic, we have that \sigma_{B}^{2} = \frac{0.04}{0.4} = 0.10, which implies that \sigma_{B} = \sqrt{0.10} = 31.62\% per year. We also know that 60% of the variance is firm-specific, which means that \sigma^{2}(e_{B}) = 0.6 \times 0.10 = 0.06, so that \sigma(e_{B}) = \sqrt{0.06} = 24.49\% per year.
YF.download() has changed argument auto_adjust default to True
Ticker | MSFT | SPY |
---|---|---|
Mean (%) | 2.175 | 1.002 |
St. Dev. (%) | 6.049 | 4.465 |
OLS Regression Results
==============================================================================
Dep. Variable: MSFT R-squared: 0.522
Model: OLS Adj. R-squared: 0.517
No. Observations: 120 F-statistic: 128.6
Covariance Type: nonrobust Prob (F-statistic): 1.30e-20
==============================================================================
coef std err t P>|t| [0.025 0.975]
------------------------------------------------------------------------------
Intercept 0.0120 0.004 3.040 0.003 0.004 0.020
SPY 0.9784 0.086 11.342 0.000 0.808 1.149
==============================================================================
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
coef
we can see that the estimate for the intercept is 0.0123 whereas the beta estimate for MSFT is 0.9894.The figure plots the excess monthly returns of the market portfolio labeled as RMRF and proxied by SPY, vs. the excess monthly returns of Citigroup (C), BlackRock (BLK), Nvidia (NVDA), and Tesla (TSLA) labeled RETRF, from June-2015 until June-2025.
Alpha | Beta | R-Squared | ||
---|---|---|---|---|
Estimate | P-value | |||
BLK | -0.0011 | 0.792 | 1.353 | 0.668 |
C | -0.0068 | 0.251 | 1.562 | 0.550 |
NVDA | 0.0390 | 0.000 | 1.772 | 0.337 |
TSLA | 0.0190 | 0.217 | 1.859 | 0.206 |
Correlation | Correlation Squared | |
---|---|---|
BLK | 0.818 | 0.668 |
C | 0.741 | 0.550 |
NVDA | 0.580 | 0.337 |
TSLA | 0.454 | 0.206 |
Example 3 (Computing a Covariance) Suppose that you have run regressions of excess returns of two securities A and B on the excess returns of the market. You find that \beta_{A} = 1.2 and beta_{B} = 0.9. If the variance of the market is 25% per year, then \operatorname{Cov}(R_{A}, R_{B}) = 1.2 \times 0.9 \times 0.25^{2} = 0.0675. If in addition we know that \sigma_{A} = 30\% and \sigma_{B} = 35\%, then we also have \rho_{A, B} = \frac{0.0675}{0.30 \times 0.35} = 0.643.