ACM Term Premium
Project description
pyacm
Python implementation of the ACM Term Premium models
- Nominal version from "Pricing the Term Structure with Linear Regressions" from Adrian, Crump and Moench (2013).
- Real version from "Decomposing Real and Nominal Yield Curves" from Abrahams, Adrian, Crump and Moench (2015).
The NominalACM class prices the time series and cross-section of the term
structure of interest rates using a three-step linear regression approach.
Computations are fast, even with a large number of pricing factors. The object
carries all the relevant variables as atributes:
- The yield curve itself
- The excess returns from the synthetic zero coupon bonds
- The principal components of the curve used as princing factors
- Risk premium parameter estimates
- Yields fitted by the model
- Risk-neutral yields
- Term premium
- Historical in-sample expected returns
- Expected return loadings
The RealACM class extends the nominal model to jointly price nominal and real
(inflation-linked) yield curves. It decomposes nominal yields into expected real
rates, expected inflation, real term premia, inflation risk premia, and a
liquidity premium. The state vector combines nominal PCs, orthogonalized real
PCs, and an observable liquidity factor. Key attributes include:
- Nominal and real model-implied yields (
miy_n,miy_r) - Nominal and real risk-neutral yields (
rny_n,rny_r) - Nominal and real term premia (
tp_n,tp_r) - Breakeven inflation and inflation risk premium (
breakeven,irp) - Forward rate decompositions via
forward_rates_tsandforward_rates_cs
Instalation
pip install pyacm
Usage
Nominal
from pyacm import NominalACM
acm = NominalACM(
curve=yield_curve,
n_factors=5,
)
The tricky part of using this model is getting the correct data format. The
yield_curve dataframe in the expression above requires:
- Annualized log-yields for zero-coupon bonds
- Observations (index) must be in either monthly or daily frequency
- Maturities (columns) must be equally spaced in monthly frequency and start at month 1. This means that you need to construct a bootstraped curve for every date and interpolate it at fixed monthly maturities
Real / Inflation-Linked
from pyacm import RealACM
acm = RealACM(
nominal_curve=nominal_curve,
real_curve=real_curve,
liquidity=liquidity,
cpi=cpi,
n_factors_n=3,
n_factors_r=2,
selected_maturities_n=[6, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120],
selected_maturities_r=[24, 36, 48, 60, 72, 84, 96, 108, 120],
)
In addition to the nominal curve requirements above, the RealACM class needs:
real_curve: annualized log-yields for real (inflation-linked) zero-coupon bonds. Columns must be consecutive integers in monthly maturities (e.g. 24 to 120)liquidity: a positivepd.Serieswith an observable liquidity proxy (e.g. fitting errors, relative trading volumes, or a composite index)cpi: a monthlypd.Serieswith the consumer price index level, used to compute realized inflationselected_maturities_nandselected_maturities_rcontrol which maturities enter the return regressions for the nominal and real curves, respectively
Examples
Nominal
Updated estimates for the US are available on the NY FED website.
The file example_us reproduces the original outputs using the same
dataset as the authors.
The jupyter notebook example_br
contains an example application to the Brazilian DI futures curve that
showcases all the available methods and attributes.
Real
The file example_real_us
replicates the joint Treasury-TIPS decomposition from Abrahams, Adrian, Crump
and Moench (2016) using US data.
The jupyter notebook example_real_br
applies the RealACM model to Brazilian nominal (LTN/NTN-F) and
inflation-linked (NTN-B) yield curves, decomposing yields into expected real
rates, expected inflation, real term premia, inflation risk premia, and a
liquidity premium.
Original Articles
Adrian, Tobias and Crump, Richard K. and Moench, Emanuel, Pricing the Term Structure with Linear Regressions (April 11, 2013). FRB of New York Staff Report No. 340
Abrahams, Michael and Adrian, Tobias and Crump, Richard K. and Moench, Emanuel, Decomposing Real and Nominal Yield Curves (February, 2015). FRB of New York Staff Report No. 570
I would like to thank Emanuel Moench for sharing his original MATLAB code in order to replicate these results.
Citation
Gustavo Amarante (2025). pyacm: Python Implementation of the ACM Term Premium Model. Retrieved from https://github.com/gusamarante/pyacm
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyacm-2.1.tar.gz.
File metadata
- Download URL: pyacm-2.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e6eabc56d847f5093f7a3936476cc071f43ec029a24f6c2d01f1d8eeaee536c
|
|
| MD5 |
fca1a143e5237078bf9d2fa05ff5c4c4
|
|
| BLAKE2b-256 |
263ae43ba0a89e3acdb73a89daaa6f21cff5bf9f2c6f3979d1c9848da8003cb1
|
Provenance
The following attestation bundles were made for pyacm-2.1.tar.gz:
Publisher:
publish.yml on gusamarante/pyacm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyacm-2.1.tar.gz -
Subject digest:
9e6eabc56d847f5093f7a3936476cc071f43ec029a24f6c2d01f1d8eeaee536c - Sigstore transparency entry: 1249360774
- Sigstore integration time:
-
Permalink:
gusamarante/pyacm@1eae88c53f2957ef1be5eee02cbd96ed7c672c3f -
Branch / Tag:
refs/tags/V2.1 - Owner: https://github.com/gusamarante
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1eae88c53f2957ef1be5eee02cbd96ed7c672c3f -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyacm-2.1-py3-none-any.whl.
File metadata
- Download URL: pyacm-2.1-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31931973afd2092f8e968e93cee8517aa0f47314987424992e1d980213ad5735
|
|
| MD5 |
8607731415dd51cca80c4c1bc29e2ea0
|
|
| BLAKE2b-256 |
0f88a5be38f393ed52ea6f9f20207544213511d15dd3c0d5b52af5b1b3a27ff9
|
Provenance
The following attestation bundles were made for pyacm-2.1-py3-none-any.whl:
Publisher:
publish.yml on gusamarante/pyacm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyacm-2.1-py3-none-any.whl -
Subject digest:
31931973afd2092f8e968e93cee8517aa0f47314987424992e1d980213ad5735 - Sigstore transparency entry: 1249360938
- Sigstore integration time:
-
Permalink:
gusamarante/pyacm@1eae88c53f2957ef1be5eee02cbd96ed7c672c3f -
Branch / Tag:
refs/tags/V2.1 - Owner: https://github.com/gusamarante
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1eae88c53f2957ef1be5eee02cbd96ed7c672c3f -
Trigger Event:
release
-
Statement type: