How to forecast many related time series?

Hi everyone,

I was looking into the tutorial and I was interested about the time series forecasting part though I noticed it was for univariate series.

I’d like to forecast many related univariate series instead (a dataframe of sales and past sales for many different products) and I was wondering if there was a way to do this without going over each series one at a time, which would be too slow.

What can I look into? Any advice?


Hi @Neutral, if you want to use the pyro.contrib.forecast framework then I’d start with the multivariate forecasting tutorial and the BART example (which are listed among all forecasting tutorials). If you want to avoid the framework and build Pyro models from scratch, then I’d recommend reading up on pyro.plate and general hierarchical Bayesian modeling.

1 Like

Thanks for that! I thought the multivariate forecasting was aimed at exogenous variable informing the forecast only.

@Neutral if your time series is real-valued you can also consider using one of our pre-built gp models, demo’d e.g. here

Thanks for the reference, I’m not sure GP’s are fast enough because I have lots of time series and my understanding is that they scale O(n^3), is that correct?

it depends a lot on the details. time series are special. this particular code is pretty scalable (e.g. 100 time series with time series of length 1000 should be doable)

It’s sold items for store so we’re looking at something like 100_000 series with 50-80 monthly steps.

this should scale to that regime on a gpu provided that you keep state_dim moderately sized (but i’d only expect it to work reasonably if the time series are pretty highly correlated)

1 Like

Thanks for your help, I’ll look into it

you might start by choosing a particular subset of time series (e.g. electronics) and just fitting a model to that. while sharing information across all time series may be conceptually appealing it can be computationally expensive. then you could e.g. have 8 models with each one covering 10k different items