The company I work for is testing the forecasting ability of new software. One package takes the orders for a single product from multiple locations, sums them at each period, then develops a model, which it then uses on each location. For example, if in a 6 month period location A orders the product as follows (1,0,2,3,0,3), and B orders the same product as (2,3,4,2,5,1), then the software will develop a model based on the data A+B=(3,3,6,5,5,4) and apply that model to the data in A and B separately to determine the value at month 7.
I want to try and validate (or invalidate) their approach, by using R. I've created a series of Single Exponential Smoothing models (called ssforecasts) and want to use the models on new location data as follows:
ss<-c(29,36,36,48,93,28,35,28,37,50,37,3,25,28,40,45,38,43,34,44,43,25,33,34)
ss2<-t(ss)
for (i in 1:12){
sseries<-ts(ss2[c(i:(11+i))],frequency=12)
ssforecasts <- HoltWinters(sseries, beta=FALSE, gamma=FALSE)
newss <- ts(c(3,3,1,4,1,3,8,0,4,3,3,0),frequency=12)
predict(ssforecasts,t(newss))
}
where newss is the location data that I want the model (ssforecasts) to act on. The problem is I get the following error, which I can't interpret.
Error in rep(as.vector(object$coefficients[1L]), n.ahead) : invalid 'times' argument