Forecasting

Run statistical forecasts on macroeconomic indicators.

The forecasting engine lets you run time-series models on any registered indicator directly through the API. Forecast runs and exports require a signed-in Research or Pro session.

Available models

ModelFamilyBest for
ARIMAClassicalUnivariate series with trend and seasonality
ETSClassicalExponential smoothing with error/trend/season decomposition
VARMultivariateJoint forecasting of related series
Holt-WintersClassicalStrong seasonal patterns

Running a forecast

curl -X POST https://macrobymark.com/api/forecast/run \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "us-cpi-all-items",
    "model": "arima",
    "horizon": 12,
    "vintage": { "mode": "latest" }
  }'

The response includes point forecasts, confidence bands, model diagnostics, and a cache key you can use to export results.

Model Expected Values

Calendar and release surfaces may show a Model expected value. This is the platform's one-period-ahead forecast generated from the indicator's own observation history. It is not a survey estimate and it is not a licensed consensus feed.

When available, release payloads include:

FieldMeaning
forecastValueNumeric model expected value.
expectationSourcemodel today; consensus is reserved for a future licensed feed.
expectationModelIdSelected model id such as ensemble, arima, ridge, or ets.
expectationModelLabelHuman-readable model label.
expectationObservationCountNumber of observations used by the model.
expectationSelectionNoteModel-selection note from the forecasting engine.

The expectation engine tries ensemble first, then ARIMA, ridge, and ETS when a series has enough observations. If no model can be fit, the field is omitted and the UI says the model expected value is unavailable.

Vintage-aware forecasting

You can run forecasts against historical data vintages to backtest how a model would have performed in real time:

curl -X POST https://macrobymark.com/api/forecast/run \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "us-cpi-all-items",
    "model": "arima",
    "horizon": 6,
    "vintage": { "mode": "specific", "date": "2024-01-15" }
  }'

FRED series support native vintage retrieval. BLS and BEA use simulated vintages derived from revision history. Other providers fall back to the current snapshot with a disclaimer in the audit metadata.

Exporting results

Use the cache key from the forecast response to download results:

# CSV
curl -G "https://macrobymark.com/api/forecast/run/{cacheKey}/csv"

# JSON
curl -G "https://macrobymark.com/api/forecast/run/{cacheKey}/json"