"What I cannot create, I do not understand" (Richard Feynman)
A python toolkit for empirical asset pricing models and risk premia estimation. The currently available models for estimation of risk premia are:
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
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
This library is in active development and aims to implement models from all corners of the literature.
This is a Python implementation of the ACM term premium models from the New York Fed. The nominal version follows "Pricing the Term Structure with Linear Regressions" from Adrian, Crump and Moench (2013). The real version follows "Decomposing Real and Nominal Yield Curves" by Abrahams, Adrian, Crump and Moench (2016), jointly pricing nominal and inflation-linked yield curves. This extension decomposes nominal yields into expected real rates, expected inflation, real term premia, inflation risk premia, and a liquidity premium.
I would like to thank Emanuel Moench for sharing his replication files of the original paper. Each computational step was carefully verified against the authors' implementation of the nominal version.
This is a Python library to specify, calibrate, solve, simulate, estimate and analyze linearized DSGE models. The specification interface is inspired by dynare, which allows for symbolic declarations of parameters, variables and equations. Once a model is calibrated or estimated, it is solved using Sims (2002) methodology. Estimation uses Bayesian methods, specifically Markov Chain Monte Carlo (MCMC), to simulate the posterior distributions of the parameters. Analysis tools include simulation, impulse-response functions, historical decomposition and extraction of latent variables.
This is my first published python library. I started this project during the COVID pandemic with the objective of refreshing and consolidating my studies on DSGEs.