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.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

bayesfm-0.2.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bayesfm-0.2.1.tar.gz
  • Upload date:
  • Size: 5.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c4edec719f2464d55e6e2e61485c67d078534704b57715472a56557b67213d89
MD5 bb1427f5fa0b91e96a8e73d9bdcb7796
BLAKE2b-256 e9383c13ca88ef1e1ed1cc166d472621956f5200f09ff159c58840f63f7bcbc8

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on gusamarante/bayesfm

Attestations:

File details

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

File metadata

  • Download URL: bayesfm-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3195023519ce4ccab45b5e31197a8737fb88b955509fdd4e75a6776a39ced36
MD5 1347f214f9f37cd3f8675dab9cc922b5
BLAKE2b-256 0baa880c29792e4daaf2ac97118e1105a7e386bc6f3ecd746ffc232b167d4e2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bayesfm-0.2.1-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