Over a million developers have joined DZone.

The R Language and Flat Forecasts

DZone's Guide to

The R Language and Flat Forecasts

· Big Data Zone
Free Resource

Learn best practices according to DataOps. Download the free O'Reilly eBook on building a modern Big Data platform.

About once a week some­one will tell me there is a bug in my fore­cast pack­age for R because it gives fore­casts that are the same for all future hori­zons. To save answer­ing the same ques­tion repeat­edly, here is my response.

A point fore­cast is (usu­ally) the mean of the dis­tri­b­u­tion of a future obser­va­tion in the time series, con­di­tional on the past obser­va­tions of the time series. It is pos­si­ble, even likely in some cir­cum­stances, that the future obser­va­tions will have the same mean and then the fore­cast func­tion is flat.

  • A ran­dom walk model will return a flat fore­cast func­tion (equal to the last observed value of the series).
  • An ETS(A,N,N) model will return a flat fore­cast function.
  • An iid model will return a flat fore­cast func­tion (equal to the mean of the observed data).

This is not a bug. It is telling you some­thing about the time series — namely that there is no trend, no sea­son­al­ity, and insuf­fi­cient tem­po­ral dynam­ics to allow the future obser­va­tions to have dif­fer­ent con­di­tional means.

I dis­cussed this once with another con­sul­tant and he told me that he some­times adds some ran­dom noise to his fore­casts, just to stop his clients ques­tion­ing the flat fore­cast func­tions. Unfor­tu­nately, that increases the fore­cast error, but he thought it was bet­ter to give them what they wanted rather than what was best!



Find the perfect platform for a scalable self-service model to manage Big Data workloads in the Cloud. Download the free O'Reilly eBook to learn more.


Published at DZone with permission of Rob J Hyndman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}