Skip to main content

Bayesian Fama-MacBeth Regressions (DEPRECATED — use empfin instead)

Project description

bayesfm - Bayesian Fama-MacBeth

⚠️ DEPRECATED: bayesfm is no longer maintained. The same classes (BFM, BFMGLS, BFMOMIT) are now available in empfin. Please migrate by running pip install empfin and replacing import bayesfm with import empfin.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bayesfm-0.3.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bayesfm-0.3.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bayesfm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1cc7c13c84da96a2d207de739df502985a4462496ad09ba5d2f8c9f49b48f400
MD5 f4a3a14768a65e9d10ed1f6df4af01a2
BLAKE2b-256 c8e49443d05d1d57f88fec12f8fe67c1399c7101680e6970bf1f6bc19ad16e11

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on gusamarante/bayesfm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: bayesfm-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bayesfm-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23287db08ef461dec42f7b27ba084bf3496416090fac03c8aa3a7134b0c18089
MD5 1d8fe697d988c42c8d48a0f15fe0f878
BLAKE2b-256 12df346f0a3b1a7b3bfae6f8f698b1a0c383460fc0c2f630d077dcb32301151d

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on gusamarante/bayesfm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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