Staggered-Combination MIDAS
Mixed-frequency nowcasting and short-horizon forecasting of quarterly targets (e.g. GDP) from monthly indicators, with forecast combination.
Experimental Python implementation of Moreira (2025)
Read the user manual for the full guide.
Features
- MIDAS regression with Almon, exponential-Almon, Beta and unrestricted lag polynomials.
- Quarterly OLS counterpart (
OLS/OLSSpec) for hard quarterly indicators, sharing the same forecasting and dummy interface. - Direct multi-horizon forecasting: one model per horizon
h, fit and stored together. - Outlier dummies on the target (
dummy_periods) absorbed at the target frequency. - End-to-end combination pipeline
MidasCombo:- Average, inverse-error (
mae,mse,rmse) and regression weights across indicators. - Rolling-window and discounted-error variants.
- Combinations of combinations (a
ComboSpeccan reference otherComboSpecs as sources).
- Average, inverse-error (
- NLS estimation of non-linear weight schemes (Almon-exp, Beta).
Project Structure
├── src/nowcast_midas/ # Source code
├── docs/ # Zensical documentation site
├── examples/ # Example scripts
├── tests/midas/ # Unit tests
└── ...
Installation
From PyPi:
pip install nowcast-midas
Dev version:
git clone https://github.com/bank-of-england/nowcast-midas.git
cd nowcast-midas
pip install -e . # runtime
pip install -e ".[dev]" # + test / lint / docs tooling
pip install -e ".[realtime]" # + real-time (vintage) analysis stack
Python ≥ 3.10.
Quick start
from nowcast_midas import ComboSpec, MidasCombo, MidasSpec, OLSSpec
from nowcast_midas.utils import sample_combo_data
# Simulated mixed-frequency data: three monthly series, one quarterly
# regressor, one quarterly target, plus one injected outlier.
target_df, regressors_df, info = sample_combo_data(n_quarters=60, seed=42)
outlier = info["outlier_date"]
midas_monthly_1 = MidasSpec(
"monthly_1", method="almon", n_lags=6, dummy_periods=[outlier]
)
midas_monthly_2 = MidasSpec(
"monthly_2", method="almon", n_lags=6, dummy_periods=[outlier]
)
midas_monthly_3 = MidasSpec(
"monthly_3", method="unrestricted", n_lags=3, dummy_periods=[outlier]
)
ols_quarterly_1 = OLSSpec("quarterly_1", n_lags=1, dummy_periods=[outlier])
soft = ComboSpec(
"soft",
sources=[midas_monthly_1, midas_monthly_2, midas_monthly_3],
method="mse", # inverse mean-squared-error weights — see docs/methods/combo.md
window=8,
discount_rate=0.95,
)
final = ComboSpec("final", sources=[soft, ols_quarterly_1], method="regression")
model = MidasCombo(combo_specs=final, horizons=3) # horizons is a COUNT, not an index
model.fit(target=target_df, regressors=regressors_df)
oos = model.forecast() # long format: one row per (spec, horizon step);
# columns horizon, spec, value, date
print(oos.head())
model.summary(horizon=0) # prints and returns the text
This is the same example as docs/index.md; runnable end-to-end scripts are in examples/ and rendered in
Worked examples.
Selected documentation
Selected examples
Contributing
- See CONTRIBUTING.md for details on how to contribute to the code.
- Open an issue with questions or ideas.
Main references
Data Classification
Bank of England Data Classification: OFFICIAL BLUE
Release files for nowcast-midas 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nowcast_midas-0.0.3.tar.gz | 57.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nowcast_midas-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 120.0 kB
Release files / nowcast_midas-0.0.3.tar.gz
| Download URL | nowcast_midas-0.0.3.tar.gz |
|---|---|
| Size | 57.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4631d984f37a6663fcd5852d3766d1f69001615931063537de9207acd8c4499b
|
|
BLAKE2b-256 checksum How to use checksums |
27d159dd1e986c1845c129704874dfadd905ef843d0b81d7e8b57a46b323cbf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency logRelease files / nowcast_midas-0.0.3-py3-none-any.whl
| Download URL | nowcast_midas-0.0.3-py3-none-any.whl |
|---|---|
| Size | 62.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90a560b1b7a3c4751054022514646c5a58000c79cc0748222eb8cb71a7cc45b6
|
|
BLAKE2b-256 checksum How to use checksums |
aede82dea87565fc0fa11961fb7e5ced559aaa5d813e7039cdead3bf73b5fe21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency log