# Forecasting large set of time series in R

I have a data set with ~1,000,000 time series which I want to forecast using R. It is monthly data and I have 36 observations of each, and I want to forecast for one year (h=12). Each time series represents the demand for a certain product in a certain country. Several countries together form a region, so this is hierarchial. But over the products, I think it is grouped, so I think I should use gts then?

I'm not sure what method I want to use yet for forecasting. For now, I'm just interested in how I can produce forecasts for all these time series in a fast way..

• Is China in your country list? If so, beware that seasonality will drift due to Chinese New Year. – user64106 Feb 15 '18 at 16:30
• You want hierarchical forecasting. Look through stats.stackexchange.com/search?q=hierarchical+forecasting+ – kjetil b halvorsen Feb 15 '18 at 21:19
• Thank you both. @StatMan, No I don't have china in. @kjetil b halvorsen, okay so no gts. I know how to use the hts, but it has been running for a day now because of the many data series I have. Is there no possible way to do it faster? I use forecast(hts.object, h=12, parallel=TRUE, fmethod='arima') – pk_22 Feb 20 '18 at 9:36