Implementation of "Bayesian Fama-MacBeth Regressions" from Bryzgalova, Huang and Julliard (2024). As presented by the authors, this methodology provides reliable risk premia estimates for both tradable and nontradable factors, detects those weakly identified, delivers valid credible intervals for all objects of interest, and is intuitive, fast and simple to implement.
pip install bayesfm
There is a self-contained example file using the Fama-French 25 sorted portfolios and their 5 factors.
There are 3 classes available:
BFM
: Bayesian Fama-MacBethBFMGLS
: Bayesian Fama-MacBeth with the GLS precision matrix for the cross-sectional stepBFMOMIT
: Bayesian Fama-MacBeth with omitted factors- As noted by the authors, the use of this model requires us to include a sufficient number of latent factors in the cross-sectional step, which is chosen with the
p
argument of this class
- As noted by the authors, the use of this model requires us to include a sufficient number of latent factors in the cross-sectional step, which is chosen with the
All three class save the draws of all elements of interest as attributes, and have a method called plot_lambda
, which plots the posteriors of the risk premia parameters.
This method outputs the chart below, where the blue density are the posterior draws and the orange lines are the canonical Fama-MacBeth two-pass OLS regression estiamtes.