Forecasting multiple time series with tsintermittent

By | September 17, 2015

I uploaded a new version (1.7) of tsintermittent on CRAN. Apart from fixing a couple of minor issues, a new function has been added to help scaling up forecasting. Recently I had a few requests to add a functionality to use data frames with multiple time series as inputs. I have included a new wrapper function data.frc that does exactly that.

Here is an example. Let us first create some data (10 series of 20 observations each) and call the new function:
> y <- simID(10,20)
> yhat <- data.frc(y,"crost")

The output has two parts, yhat$frc.out will is a data frame with the forecasts for all time series, while yhat$out will be a list with the detailed output for each time series.

Currently all forecasting methods in tsintermittent are supported: crost,, tsb, sexsm and imapa.

You can also pass other arguments that are relevant to each function that each called, for example:
> yhat <- data.frc(y,"crost",h=15,type="sba",na.rm=TRUE)
These additional options are documented in each forecasting method.

You may have also noticed that there is a new option for all forecasting methods, na.rm, which removes any NA values from each series in the data frame.

Note that if you call crost(y), only the first time series in the data frame will be used, as the individual functions are designed to deal with individual time series. Only the wrapper function will through the complete set.

Hope you find the new function useful! Other minor changes concern the function simID which now outputs the generated series as a data frame, resolving an inconsistency in the output of that function with the rest of the package functions.

Leave a Reply

Your email address will not be published. Required fields are marked *