1
$\begingroup$

Im just starting using R and have been getting through a number of tutorials on Forecasting as need a forecast for next year. I have been using a seasonality of 7 & 365.25 in order to take account of seasonality.

m_tbats = tbats(head(Desktop$Sessions,-1,seasonal.periods=c(7,365.25)))
f_tbats = forecast(m_tbats, h=365)
plot(f_tbats)

Output of the Forecast

As you can see my forecast for next year end in a straight line, what am I doing wrong? Can I get a decent forecast if I only have 1.2 years of data?

$\endgroup$
1
  • $\begingroup$ Might be worth dropping the weekly seasonal element and trying a single seasonal approach first using ARIMA. I'm not convinced from the chart there is a clear weekly seasonal pattern. ARIMA should pick up the seasonal annual peak and apply some for of auto regression (AR) or moving average (MA) or both?! Alternatively you could try ETS or STL. I'd try these simpler approaches before diving into TBats. $\endgroup$ Commented Aug 23, 2019 at 8:32

2 Answers 2

0
$\begingroup$

It appears to me that Desktop$Sessions first needs to be formatted as a time series object using the ts() function. You should try the following and see if that produces more reasonable forecasts:

m_tbats = tbats(ts(Desktop$Sessions, frequency=7),seasonal.periods=c(7,365.25))
f_tbats = forecast(m_tbats, h=365)
plot(f_tbats)
$\endgroup$
0
$\begingroup$

It would appear that you have daily data that might have some buildup between Thanksgiving and Christmas BUT that is just based upon a visual examination and a SWAG (SWA Guess). This can be handled by employing a Transfer Function model incorporating seasonal dummy indicators , day-=of-the-week effects and ARIMA structure all while dealing with anomalies and other unspecified possible deterministic structure. If you post your data,I might be able to help further. Specify country, starting date and the kind of data that this represents.

It is possible with good analytics to get plausible forecasts from as little as 1.2 years of daily data. See this question R Time Series Forecasting: Questions regarding my output as it relates to hybrid models which use both ARIMA and Deterministic structure.

Look at ARIMA - Regressor Effects to illustrate the seasonal buildup approaching Christmas/

$\endgroup$