Conversation
JadHay8
left a comment
There was a problem hiding this comment.
just merge main and fix conflicts. Make sure you don't overwrite new changes.
| logger.warning("Market variance is zero, cannot calculate market factor") | ||
| return 0.0 | ||
|
|
||
| beta_market = covariance / market_variance |
There was a problem hiding this comment.
Correct me if I'm wrong but isn't the point of importing and using the famafrench library that it can calculate all these factors when you give it the data and you just basically do ff.getFFfactors(...). It seems like we're not really leveraging the library much in general in this PR.
There was a problem hiding this comment.
FF library is to get the 3 factors since they are universal to the market and not specific to our portfolio. There is a database and its easier to pull data using the getFamaFrench module. From the above image, we are fetching rm-rf (expected market risk premium), SMB (small - big cap), and HML (high minus low). We then need to apply these factors specifically to our portfolio values. To find each beta, we take the covariance / variance for each.
There was a problem hiding this comment.
I'm looking into this some more, I will probably need to do some sort of regression instead of just finding out each of the betas for this portfolio, since apparently when you have more than 1 factor, cov / var isn't as accurate as it could be. Have to do something like this: https://www.youtube.com/watch?v=V0DbIRx2Prg

Basic FF3 factors calculated.
Closes #113