I am having trouble relating how forecasts are calculated in the R packages forecast::croston and tsintermittent::crost. I understand the concept of croston, such as in the example posted here (www.robjhyndman.com/papers/MASE.xls), but the output from the R packages produces very different results.
I used the values from the Excel example (by R. Hyndman) in the following code:
library (tsintermittent)
library (forecast)
x=c(0,1,0,11,0,0,0,0,2,0,6,3,0,0,0,0,0,7,0,0,0,0) # from Hyndman Excel example
x_crost = crost(x,h=5, w=0.1, init = c(1,1) ) # from the tsintermittent package
x_croston=croston(x,h=5, alpha = 0.1) # from the forecast package
x_croston$fitted
y=data.frame(x,x_crost$frc.in,x_croston$fitted)
y
plot(x_croston)
lines(x_croston$fitted, col="blue")
lines(x_crost$frc.in,col="red")
x_crost$initial
x_crost$frc.out # forecast
x_croston$mean # forecast
The forecast from the Excel example is 1.36, crost gives 1.58 and croston gives 1.15. Why are they not the same? Also note that the in-sample (fitted) values are very different.