# Forecasting a time series without significant autocorrelation

I have a time series without significant autocorrelation.

http://pastebin.com/xZJnZs7k

Autocorrelation plot.

Partial autocorrelation plot.

Here you can find a year worth of data and a forecast produced by auto.arima from the forecast package: observed and predicted values

I have tried multiple models, for example ANNs and SVR, but they seem to always predict the most frequent values of the series. In other words the forecasts are nearly straight lines near the series mean value. Also I tried to use the ets R framework, but the forecasts were not much different from All models were validated using rolling out of sample forecasts.

No model achieved an R2 score over 0.1. I aim to minimize the mean absolute error, the best I got was 1. My question is: What methods are there for forecasting such time series?

• Have you considered the possibility that the series is (mostly) unpredictable? E.g. if it is an ordered sequence of independent random shocks, the best forecast is the mean value. – Richard Hardy Dec 5 '16 at 12:32

Your data is discrete and as such ARIMA modelling can be useful but tentative at best. See this post What are the consequences of not meeting the assumptions for the residuals of ARIMA model? which discusses discrete data analysis with a slightly different twist.

I took your daily data (365 values) and used AUTOBOX to detect structure. There is no identifiable autoregressive memory structure (ARIMA) . There is no significant day of the week effect in the observations but curiously outliers are not equally distributed across days suggesting a possible special cause. There is however two months of the year that appear to be statistically significant although with only 1 year of data that could be proxying something else. No particular day of the month appeared to be significant. There are a number of days that appear to be "unusual" i.e. outliers. You might examine those dates in order to find a possible assignable cause as part of you discovery process.

Here is the Actual data . The equation and the Actual , Fit and Forecast graph is here . Notice that while the expected value is flat for the next 30 days the upper confidence limits (obtained through monte-carlo methods by resampling the decidely non-normal residuals) are not. Standard Box-jenkins confidence limits for forecasts assume perfect kdnowlede of the estimated parameters and normality of the errors providing possibly naive symmetric limits with the proviso that unusal values may have occurred in the past but they won't reoccur. Lower limits are clearly 0.0 by specification and are shown here for generality purposes.

It turns out that while you have a significant # of outliers they are not evenly distributed across days. Since the confidence limits include the very possibility of future shocks (anomalies) they are "jagged" . Here is the forecast plot by itself .

You have an extremely short time series: 16 daily observations. Daily data often exhibit weekly seasonality, but with only 16 observations, detecting weekly seasonality is hopeless. A seasonplot of your series does not show any pattern:

library(forecast)
xx <- ts(c(0,5,2,1,2,2,4,0,1,3,0,2,2,1,1,2),frequency=7)
seasonplot(xx)


(Days of week may not match your actual dates, but this is not overly important.)

The best forecasting method for short time series is typically the historical average.

A word of caution: your data are asymmetrically distributed.

hist(xx)


If you try to minimize the mean absolute error, you may end up with biased forecasts (because the expected MAE is minimized by the median of the distribution, not the mean). I recommend reconsidering your error measure. More info on this in Morlidge (2015, Foresight) and my paper (Kolassa, 2016, International Journal of Forecasting).

• The original data is much longer, ~4000 observations, and here you can find 365: pastebin.com/HQ4016K9 – Euphe Dec 5 '16 at 12:38
• Ah, that does make a difference. 4000 observations of daily data are about 11 years. With this much data, you can indeed attempt to fit intra-weekly and intra-yearly seasonality. I suggest you look through the multiple-seasonalities tag for possible models. But even so, with discrete data, I don't think you will be able to get MADs below 1. There is a limit to forecastability. – Stephan Kolassa Dec 5 '16 at 12:41

I quickly plotted your data. You seem to have strong bi-weekly seasonality. I would do a simple linear regression with a categorical predictor that reflects the day of the week. That will not be perfect since the seasonality doesn't look absolutely regular to me, but it's worth a try. If this doesn't work at all, it can also be that the series is unpredictable as said in the commentary.

Usually, I would also look for time of the year seasonality (for example by regressing on a sinus function with 12 or 6 months period) and for a general trend. However, your data does not seem to have those, so it is possible that the best model you can find is a very simple one.

• I find it interesting that you see "strong bi-weekly seasonality" (what is bi-weekly seasonality?), whereas a seasonplot suggests pretty much zero seasonality to me. I'd be careful in detecting weekly seasonality based on only 16 observations. – Stephan Kolassa Dec 5 '16 at 12:37
• I have plotted the daily data from 1 year, not the 2 weeks. Something that comes and goes twice a week. For example a Monday and a Friday effect. I just quickly counted the peaks and how far they are apart. If you run a regression on weekdays you can see if my intuition was correct or not. – David Ernst Dec 5 '16 at 12:40

Check out TBATS from Hyndman's R forecast package:

https://cran.r-project.org/web/packages/forecast/forecast.pdf

TBATS supports multiple seasonalities, e.g. combinations of daily, weekly, biweekly:

http://robjhyndman.com/papers/ComplexSeasonality.pdf

If a time series problem does not have any significant auto correlation then that means that it cannot be predicted using uni variate time series. For example, if a problem has a high auto correlation, then that means that it's previous values can make a good feature for predicting the future values. And the opposite is true. If a problem has a low auto correlation value, then lag variables are not a very good feature. However, this doesn't necessarily mean that the problem cannot possibly be predicted, it just means that if you want to forecast well, then you can't use just lag variables as a feature. This is called multi variate time series.

So, it sum this up, if there is not a very high auto correlation, then that means that you need more features than just a lag variable.

• Or maybe that there is a non-linear autocorrelation? – kjetil b halvorsen Jan 14 '19 at 17:07