Refresh model card (drop TempoPFN-Tiny naming; expand details)
Browse files
README.md
CHANGED
|
@@ -13,22 +13,25 @@ pipeline_tag: time-series-forecasting
|
|
| 13 |
# MacroCast
|
| 14 |
|
| 15 |
**MacroCast** is a compact (~1.2M-parameter) time-series foundation model for
|
| 16 |
-
macroeconomic forecasting. It
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
**entirely on synthetic data** (no real macro data).
|
| 20 |
-
2. **MacroCast** — Forge **fine-tuned** on FRED-MD via an expanding-window,
|
| 21 |
-
real-time-vintage procedure, using a mixture of macro-calibrated synthetic
|
| 22 |
-
panels (block-bootstrap, AR, Dynamic Factor Model, and Minnesota BVAR).
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
## Vintages
|
| 28 |
-
This repo ships **one checkpoint per fine-tuning vintage** (`models/`). Each
|
| 29 |
-
MacroCast fine-tuned on the FRED-MD data available *through that
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
|
| 33 |
## Usage
|
| 34 |
|
|
@@ -37,22 +40,34 @@ from huggingface_hub import snapshot_download
|
|
| 37 |
import sys
|
| 38 |
|
| 39 |
local = snapshot_download(repo_id="shubhranshu/MacroCast")
|
| 40 |
-
sys.path.insert(0, local) # for forecast.py
|
| 41 |
from forecast import MacroCastForecaster
|
| 42 |
|
| 43 |
-
#
|
|
|
|
| 44 |
f = MacroCastForecaster.from_pretrained(local, year=2023)
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
```
|
| 49 |
|
| 50 |
-
- `point`: `[horizon, N]` median forecast.
|
| 51 |
- `quantiles`: `[horizon, N, 9]` forecasts for quantiles 0.1 … 0.9.
|
| 52 |
|
| 53 |
-
## Details
|
| 54 |
-
- Architecture: GatedDeltaProduct linear-RNN, `embed=128`, 3 layers, 9-quantile pinball loss.
|
| 55 |
-
- Fine-tuned on monthly, FRED-MD-transformed (stationary) series.
|
| 56 |
-
- Each checkpoint stores the exact variable list it was trained on.
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# MacroCast
|
| 14 |
|
| 15 |
**MacroCast** is a compact (~1.2M-parameter) time-series foundation model for
|
| 16 |
+
**macroeconomic forecasting**. It forecasts a full panel of monthly
|
| 17 |
+
indicators in a **single forward pass** (no autoregressive windowing) and returns
|
| 18 |
+
**probabilistic** (9-quantile) forecasts.
|
| 19 |
|
| 20 |
+
It is trained in two stages:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
1. Base model: A ~1.2M-parameter linear-RNN backbone (architecture inspired by
|
| 23 |
+
TempoPFN), trained from scratch **entirely on synthetic data** (no real macro data).
|
| 24 |
+
2. **MacroCast** — Base model **fine-tuned** on FRED-MD via an expanding-window,
|
| 25 |
+
real-time-vintage procedure, using a mixture of macro-calibrated synthetic
|
| 26 |
+
panels (block-bootstrap, per-variable AR, Dynamic Factor Model, and BVAR).
|
| 27 |
|
| 28 |
+
## Vintages (real-time fine-tuning)
|
| 29 |
+
This repo ships **one checkpoint per fine-tuning vintage** (in `models/`). Each
|
| 30 |
+
checkpoint is MacroCast fine-tuned on only the FRED-MD data available *through that
|
| 31 |
+
cutoff* — e.g. the 2010 vintage has never seen post-2010 data — so you can choose how
|
| 32 |
+
much history the model has seen and run **leak-free real-time / backtesting**
|
| 33 |
+
experiments. The available vintages, their data cutoffs, and per-vintage variable
|
| 34 |
+
counts are listed in `manifest.json` (`default_year` is used when no year is given).
|
| 35 |
|
| 36 |
## Usage
|
| 37 |
|
|
|
|
| 40 |
import sys
|
| 41 |
|
| 42 |
local = snapshot_download(repo_id="shubhranshu/MacroCast")
|
| 43 |
+
sys.path.insert(0, local) # for forecast.py
|
| 44 |
from forecast import MacroCastForecaster
|
| 45 |
|
| 46 |
+
# List vintages, then load MacroCast for one (year=None -> latest):
|
| 47 |
+
print(MacroCastForecaster.available_years(local)) # e.g. [1998, ..., 2023]
|
| 48 |
f = MacroCastForecaster.from_pretrained(local, year=2023)
|
| 49 |
|
| 50 |
+
# history: np.ndarray of shape [T, N] (T monthly steps, N FRED-MD variables)
|
| 51 |
+
point, quantiles = f.predict(history, horizon=12, freq="M")
|
| 52 |
```
|
| 53 |
|
| 54 |
+
- `point`: `[horizon, N]` median (0.5-quantile) forecast.
|
| 55 |
- `quantiles`: `[horizon, N, 9]` forecasts for quantiles 0.1 … 0.9.
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
## Model details
|
| 59 |
+
- **Architecture**: GatedDeltaProduct linear-RNN, `embed=128`, 3 layers, ~1.2M params.
|
| 60 |
+
- **Objective**: 9-quantile (0.1…0.9) pinball loss.
|
| 61 |
+
- **Pre-training**: synthetic priors only (GP, kernel, Ornstein–Uhlenbeck,
|
| 62 |
+
ForecastPFN, CauKer, sine/sawtooth/step, …) — no real macro data.
|
| 63 |
+
- **MacroCast fine-tuning**: FRED-MD real-time vintages expanded into a synthetic
|
| 64 |
+
mixture — `real` + `block-bootstraps`, `arima` (per-variable AR), `dfm`
|
| 65 |
+
(Dynamic Factor Model), and `bvar_clust` / `bvar_full` (Minnesota BVAR).
|
| 66 |
+
|
| 67 |
+
## Intended use and limitations
|
| 68 |
+
- Built for **monthly macroeconomic** panels. Feed transformed/stationary inputs.
|
| 69 |
+
- Forecasts are statistical outputs, **not financial or policy advice**.
|
| 70 |
+
|
| 71 |
+
## Acknowledgements
|
| 72 |
+
Architecture inspired by [TempoPFN](https://huggingface.co/AutoML-org/TempoPFN)
|
| 73 |
+
(Apache-2.0); the vendored model code under `tempopfn/` derives from that project.
|