Repeated point in time forecasting with tidy and fable

I'm working on time series modeling with 10000+ groups over a period of 300+ months. I'd like to train time series models (either separate for each group or somehow linked across groups). I've been able to use fable and a variety of its included models (ets, arima and various options for each) to successfully do this modeling. Its a great package and I quite appreciate all the time and effort that went into it. I have a specific use case that I can't seem to unlock, however.

Specifically I'd like to know what a model would have predicted for (1, 3, 6, 12, 24, 36) months ahead at each month in its history. I'd like this rolling training to all be out of sample, so the model must only be trained on previous data before it is queried for each month.

A first pass on this is to retrain from scratch each model for each group every month in history, before asking it to forecast "the future". However this seems inefficient as I'm adding only a single data point to each group each month. Is there a way to add a point to a model and have the retrain be much faster?

Alternatively, I've considered only retraining every year or 2 (for speed and efficiency reasons) and simply applying this model to the new data each month. I've tried the forecast function from fable_tools, but can't seem to get this functionality to work, as the new_data input invalidates the horizon input.

Can anyone offer a suggestion on how to get the best use out of this package for my use case? Its really a question of efficiency in retraining and/or reuse of trained model. I'm happy to provide more information.

I do not fully understand the question but this may be a case for refit. In the last chapter of FPP3, there is a discussion of 1-step aheads that may help you solve this using refit and that should generalize to your case.

In a more hacky way, you could write something to pass the prior result as starting values to speed things up but you will have to be careful about handling the auto features of the models; it is not impossible for the auto-selected model to change with the addition of even one data point.

1 Like

Thanks for suggesting refit. At first glance it appears to be what I want. I'll integrate it before my forecast step and report back on results.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.