O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Forecasting using ALL AGES

The following code will perform the following steps:

  1. First, it will filter the data so that it only includes the ALL AGES category.

  2. Then, it creates a time series object.

  3. Finally, it runs a simple exponential model, using the ets() function.

Note that we did not specify a smoothing factor. The ets() function calculates the optimal smoothing factor (alpha, shown via the summary() function (in bold below)), which in this case is .99, which means that model time series takes about 99% of the previous value to incorporate into the next time series prediction:

library(dplyr) > > Attaching package: 'dplyr' > The following objects are masked from 'package:stats':> >     filter, lag > The following objects are masked ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required