Skip to main content

ACM Term Premium

Project description

pyacm

Implementation of "Pricing the Term Structure with Linear Regressions" from Adrian, Crump and Moench (2013).

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

Instalation

pip install pyacm

Usage

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

Examples

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.

DI Term Premium Observed VS Risk Neutral

Original Article

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, Available at SSRN: https://ssrn.com/abstract=1362586 or http://dx.doi.org/10.2139/ssrn.1362586

I would like to thank Emanuel Moench for sharing his original MATLAB code in order to perfectly 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

pyacm-1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

pyacm-1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file pyacm-1.2.tar.gz.

File metadata

  • Download URL: pyacm-1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyacm-1.2.tar.gz
Algorithm Hash digest
SHA256 a37490204efc7d48fa3817882c6feba6ed21d58259f4ce4818767ac93b0ac4b6
MD5 5b90bc4ed22124bb014240cbe1b7d2bd
BLAKE2b-256 19b4e9c354f8867cb7f6fdae787050df2e02c70a3e4e26a417635cdb6b31d81d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyacm-1.2.tar.gz:

Publisher: publish.yml on gusamarante/pyacm

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

File details

Details for the file pyacm-1.2-py3-none-any.whl.

File metadata

  • Download URL: pyacm-1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyacm-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 447cb8446395b58c110941d91ef7cd8270cc47974fc197c727e1c0c6a1db2773
MD5 acd34ebdf153fda3572d6a13d4ce8a7b
BLAKE2b-256 5e031b10d6f369d56ba12847572e70a591517c08663d78cfc14842e62933e809

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyacm-1.2-py3-none-any.whl:

Publisher: publish.yml on gusamarante/pyacm

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