Skip to main content

Bayesian Fama-MacBeth Regressions

Project description

bayesfm - Bayesian Fama-MacBeth

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.

Installation

pip install bayesfm

Usage

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-MacBeth
  • BFMGLS: Bayesian Fama-MacBeth with the GLS precision matrix for the cross-sectional step
  • BFMOMIT: 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

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.

Risk Premia Posterior

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bayesfm-0.2.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

bayesfm-0.2.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file bayesfm-0.2.2.tar.gz.

File metadata

  • Download URL: bayesfm-0.2.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for bayesfm-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2cc040dced74a59b6ea53112b361eb02722983072c3c6adfbcbead9c7dbccf1d
MD5 2f61a47829c404be09f633634656ec74
BLAKE2b-256 0436759b38fbcb2ea2dc08502992c2464541eb12a1c60d7db448156a877046e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayesfm-0.2.2.tar.gz:

Publisher: publish.yml on gusamarante/bayesfm

Attestations:

File details

Details for the file bayesfm-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: bayesfm-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for bayesfm-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97fb217d7797029be2224648a2fec3853be85c90c0d1bf04990fd0b5ffb7ad05
MD5 5ee97a3169e62fdef2ecacc2185da28e
BLAKE2b-256 cee0dff20d608010597de58284b24f05ff19af463bd7db4eadf49211bf662842

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayesfm-0.2.2-py3-none-any.whl:

Publisher: publish.yml on gusamarante/bayesfm

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page