0
$\begingroup$

This is a follow up to my question here. I've spent some time refining my data at work, and after deciding to go with the TBATS model, I'd like to generate a forecast value.

Here's my code so far:

> library(forecast)
> tbats_model = tbats(=v01$Units, seasonal.periods = 12)
> tbats_model
TBATS(1, {0,0}, 0.876, {<12,4>})

Call: tbats(y = v01$Units, seasonal.periods = 12)

Parameters
  Alpha: 0.2368047
  Beta: -0.03752523
  Damping Parameter: 0.87555
  Gamma-1 Values: -2.291151e-05
  Gamma-2 Values: 0.0001845991

Seed States:
             [,1]
 [1,]  7.62233435
 [2,]  0.13206172
 [3,] -0.25982157
 [4,] -0.09500239
 [5,] -0.11444555
 [6,] -0.10093089
 [7,]  0.01024328
 [8,] -0.04703836
 [9,] -0.03714637
[10,] -0.08204049

Sigma: 0.2195671
AIC: 57.93646

Now that I have this output, I'd like to actually forecast the next month (each point in my time series corresponds to a month, so I assume that each subsequent point also corresponds to a month).

Here's where my question arises: when I execute the following,

> forecast(tbats_model, h = 1)
      Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
Jun 4       8.855421 8.574035 9.136808 8.425078 9.285765

I become a little puzzled- why is the forecast for June 4th? Shouldn't it be for June 2017? Did I ask for the prediction correctly?

If anyone needs example data, you can click here.

$\endgroup$
  • $\begingroup$ You should move this to stackoverflow since it's in regards to programming. $\endgroup$ – AnscombesGimlet Jun 1 '17 at 21:38
2
$\begingroup$

Unfortunately I can't access your data set, but I think you can solve this problem by defining the start date when feeding tbats the time series. For instance:

tbats_model <- tbats(ts(v01$Units, start=c(2016,1), f=12))
tbats_forecast <- forecast(tbats_model, h=1)
tbats_forecast

The c(2016,1) can be whatever date your data begins. Note: avoid useage of = in R. <- is the standard for defining variables.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.