Forecast timeseries together
By default every timeseries is forecast from its own data alone: the model never
sees the other stores while it forecasts one. Stores in the same city often move
together. cross_inference forecasts timeseries jointly, in groups you choose, so
the model learns across them at inference time (cross-learning): it reads each
group's targets, and any historical and future covariates, side by side.
Code
Post it to https://api.retrocast.com/v1-beta/forecast?model=t0-alpha.
model names the forecasting model and is required — without it the
request is rejected with missing field "model".
What each part does:
selector: { "store": "any" }still asks for one forecast per store.cross_inference: { "group_by": ["city"] }forecasts the stores of each city together:S1andS2in one group,S3andS4in another. Each store still gets its own forecast."group_by": []puts every timeseries the selector picks into one group.
Each level in group_by must be a level the selector picks, or one it rolls
up to in hierarchies — city here, because store sits inside it. Any
other level is rejected with an error naming it. The order of the levels
doesn't matter.
Leave cross_inference out and each timeseries is forecast on its own.
Joint forecasting is supported by the t0 models and chronos-2.
Which timeseries share a group
Timeseries are forecast together when they share a value at every group_by
level and end at the same time: they are forecast from the same cutoff
instant. A group never mixes
cutoffs, so:
- In a backtest, each cutoff forms its own groups. With two cutoffs, the request above makes four groups: each city, at each cutoff. A forecast never sees another timeseries past its own cutoff.
- With
cutoff: "latest"(the default), each timeseries is cut at its own last date. IfS2ended two days beforeS1, they fall at different instants: each is forecast on its own. - With
selectors, each selector's timeseries are grouped separately, and everygroup_bylevel must suit every selector.
Groups are never split. A group with more timeseries than the model can read at once fails with an error.
What comes back
The usual table, one row per (store, time step), with one more column:
cross_inference_group. Rows that share a value were forecast together. Four
stores over seven days make 28 rows, trimmed here to each store's first step:
Code
A group number is only a name for the group within this response: it isn't
stable from one request to the next. A timeseries that was forecast on its own,
with no other timeseries at its cutoff instant, has null. The column is there
whenever the request sets cross_inference, even when no timeseries ended up in
a group.
The other formats carry the same information:
application/x-ndjsonandapplication/vnd.msgpack: each timeseries record has across_inference_groupfield,nullwhen the timeseries was forecast on its own.application/vnd.apache.parquet: a nullablecross_inference_groupcolumn, present whenever the request setscross_inference.

