Skip to main content

Empirical Finance Tools

Project description

empfin - Empirical Finance Tools in Python

empfin is a Python toolkit for empirical asset pricing models and risk premia estimation. This library is in active development and aims to implement models from all corners of the literature.

What's Inside

Currently available models for estimation of risk premia:

  • TimeseriesReg: single-pass OLS time-series regression, described in Cochrane (2005), Section 12.1
  • CrossSectionReg: two-pass cross-sectional regression, described in Cochrane (2005), Section 12.2
  • NonTradableFactors: iterative maximum-likelihood estimator for non-tradable factors, described in Campbell, Lo & MacKinlay (2012), Section 6.2.3
  • FamaMacBeth: classical two-pass Fama-MacBeth regression, with optional rolling-window first pass, Newey-West HAC standard errors, and Shanken (1992) errors-in-variables correction, from Fama & MacBeth (1973)
  • RiskPremiaTermStructure: term structure of risk premia with a single factor, tradable or not, following Bryzgalova, Huang & Julliard (2024). I would like to thank the authors for sharing their replication files.
  • ConditionalRiskPremiaTermStructure: conditional, VAR-augmented version of the term-structure estimator, from Bryzgalova, Huang & Julliard (2024).
  • Bayesian Fama-MacBeth Regressions from Bryzgalova, Huang & Julliard (2024):
    • BFM: Bayesian Fama-MacBeth (BFM-OLS), which replaces the two-pass point estimates with a posterior distribution over the risk premia
    • BFMGLS: GLS variant of the Bayesian Fama-MacBeth, which uses the idiosyncratic-error precision matrix in the cross-sectional step
    • BFMOMIT: variant of the Bayesian Fama-MacBeth that is robust to omitted factors by projecting onto the principal components of the asset-return covariance

Examples

For each model, there is a jupyter notebook with examples of their use.

Installation

pip install empfin

References

Bryzgalova, Huang, and Julliard (2024) Bayesian Fama-MacBeth Regressions) Working Paper

Bryzgalova, Huang, and Julliard (2024) Macro Strikes Back: Term Structure of Risk Premia Working Paper

Cochrane (2005) "Asset Pricing: Revised Edition". Princeton University Press.

Campbell, Lo, and MacKinlay (2012) "The Econometrics of Financial Markets"

Fama and MacBeth (1973) "Risk, Return, and Equilibrium: Empirical Tests" Journal of Political Economy, 81(3), 607-636

Library Citation

Gustavo Amarante (2026). empfin - Empirical Finance Tools in Python. Retrieved from https://github.com/gusamarante/empfin

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

empfin-2.1.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

empfin-2.1-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file empfin-2.1.tar.gz.

File metadata

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

File hashes

Hashes for empfin-2.1.tar.gz
Algorithm Hash digest
SHA256 ab1fc146dd4c8722083afa765871eecd74468e33f25cf7c62cd1812a33391d06
MD5 594383c2c2e6da6e317360f2554fcdc2
BLAKE2b-256 93baf8e869ebfa4037ffa32b95ecee8955c305974ad060e78175a17319535be7

See more details on using hashes here.

Provenance

The following attestation bundles were made for empfin-2.1.tar.gz:

Publisher: publish.yml on gusamarante/empfin

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

File details

Details for the file empfin-2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for empfin-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd22e3776c0521fdf957e04629d9fb228776cc83d85a4129eed0d946ff3f58c2
MD5 f26568fe4345d6643f936498eff780e1
BLAKE2b-256 9605fa47e5806c25e6026eff9b03bcf7cf38b01e47ff74d44201062c7ec281b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for empfin-2.1-py3-none-any.whl:

Publisher: publish.yml on gusamarante/empfin

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