# Flat forecast of trended time series data in r

I have a monthly time series of online visits for last 3 years starting from Jan 2016 to Dec 2018 and need to forecast for 2019. The data clearly has an upward trend although no seasonal lags significant. I assumed i will get a forecast where there is an upward trend as there is trend historically along with some variations but what i got is flat forecast.

Various answers in earlier post suggests flat forecast is acceptable either for white noise or random walk series but that is not the case here.

Time plot of my series:

acf and pacf plot shows correlation exist although no seasonal lags significant

 model <- auto.arima(data_ts) #,lambda = best.lambda
summary(model)


The residual analysis is perfect and no serial correlation exists

On forecasting for next 12 months of 2019 these is what i got

forecasts <- forecast(model,12)
plot(forecasts)


If i go with the seasonal plot of both historical data along with 2019 forecast these is how it looks

The series seems to be forecastable and therefore shouldn't my 2019 forecast bit higher if i go by the past pattern? I did transformation also and values are nearby giving almost flat line. Is there anything that i need to take care off? Any suggestion is highly appreciated!

Here is my data:

 library(forecast)

a <- c(1056839, 1326049, 1042199, 1738067, 1647886, 1400829, 1268237, 2146656, 1036955, 1118508,
1287044, 1501017, 3143967, 2092133, 2576878, 3184591, 2803422, 3064013, 4235912, 1573469,
1962265, 2044005, 3820864, 1995260, 5441314, 2406231, 4009222, 4402667, 4717253, 4564327,
6128167, 7649497, 3919549, 3408183, 4677126, 3202102)
data_ts <- ts(a,start = c(2016,01),frequency = 12)
autoplot(data_ts)


Your residual plot clearly supports your concern about your model. I took the 36 values into the R version of AUTOBOX ( a time series package that I helped to develop) and it was able to extract a model that has seasonal structure .. two seasonal pulses January and July reflecting assignable cause.

The Actual,Fit and Forecast is here

The acf of the observed data is here

The acf of the residual series is here

The equation is here

with statistics here and here

The cleansed data shows the onset of the two seasonal pulses and one anomaly (2018/9 ) here

The Forecast plot is here with bootstrapped prediction intervals for the period 2019/1 - 2019/12

In summary the software you are using does not 1) identify the need for seasonal deterministic structure as is needed here and 2) identify and adjust for pulses as is needed here and 3) incorrectly uses the "flawed" acf of the original series rather than the acf of an adjusted series that is conditioned for the three deterministic effects ( 2 seasonal pulses and 1 pulse) 4) does not consider the presence of level shifts or deterministic time trends and only considers differencing as the appropriate remedy for non-stationarity in the expected value. See How to make a time series stationary? AND specifically https://stats.stackexchange.com/users/3411/tom-reilly guidance on this.

"The correlogram should be calculated from residuals using a model that controls for intervention administration, otherwise the intervention effects are taken to be Gaussian noise, underestimating the actual autoregressive effect." was wisely pointed out by @Adam0 in Interrupted Time Series Analysis - ARIMAX for High Frequency Biological Data?

The correctly identified arima structure is a (1,0,0) with one coefficient of lag2 . This could be restated as (2.0.0) with the first lag omitted.

To summarize ... test there is clearly seasonal structure BUT at this point in time no provable persistent trend thus the FLAT forecast that is not quite flat but seasonal without trend.