Skip to main content

Decomposing ML Forecast Gains in Macroeconomic Forecasting

Project description

macroforecast

Decomposing ML Forecast Gains in Macroeconomic Forecasting.

An open-source Python (+ R) framework for systematic evaluation of machine learning methods in macroeconomic forecasting, with built-in support for the FRED-MD, FRED-QD, and FRED-SD database ecosystem.

CI Docs PyPI License: MIT


Status

Layer Version Status
Data (FRED-MD/QD/SD) v0.1.0 Complete
Forecasting Pipeline v0.2.0 Complete
Evaluation v0.3.0 Complete

Installation

pip install macroforecast
# or with all extras
pip install macroforecast[all]

Quick Start

import macroforecast as mc

# Load and transform FRED-MD (latest vintage, cached locally)
md = mc.load_fred_md()
md_t = md.transform()

print(md_t)
# MacroFrame(dataset='FRED-MD', vintage='current', T=790, N=128,
#            period=1959-01-01 to 2024-10-01, status=transformed)

# Subset by variable group
output = md_t.group("output_income")   # INDPRO, RPI, ...
prices = md_t.group("prices")          # CPI, PPI, ...

# Check missing values
report = md.missing_report()
print(report[["n_leading", "n_trailing", "n_intermittent"]].head())

# Method chaining
md_ready = (
    mc.load_fred_md()
    .trim(start="1970-01", end="2023-12")
    .handle_missing("trim_start")
    .transform()
)

# Load a specific vintage
md_2020 = mc.load_fred_md(vintage="2020-01")

# FRED-QD (quarterly)
qd = mc.load_fred_qd()

# FRED-SD (state-level)
sd = mc.load_fred_sd(states=["CA", "TX"], variables=["UR"])

Documentation

Full documentation is available at macroforecast.github.io/macroforecast.


License

MIT

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

macroforecast-0.1.0.tar.gz (122.8 kB view details)

Uploaded Source

Built Distribution

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

macroforecast-0.1.0-py3-none-any.whl (154.6 kB view details)

Uploaded Python 3

File details

Details for the file macroforecast-0.1.0.tar.gz.

File metadata

  • Download URL: macroforecast-0.1.0.tar.gz
  • Upload date:
  • Size: 122.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for macroforecast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1bafa39170b2d2feac75f1b1023483a10a8c2fc0ed4ce2dd6778395aa03f1c9
MD5 8e926823a131305576ef8ef44c7ceb93
BLAKE2b-256 3597a776d44aead8f31ef15a9bc4b63aaa5723fa7e7a1356f056758a8872bcf6

See more details on using hashes here.

File details

Details for the file macroforecast-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for macroforecast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6b28e7ec27528278043bb1b767521c861016be5cdb4737011b8f86d2d3df65
MD5 bb121d6bff3832dcc1faef251fbad0f6
BLAKE2b-256 7d6e8908416580fceb6a3f8a955fdc3a0ad3f9460b8c1ce2c822f6e41e131cfe

See more details on using hashes here.

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