Univariate time series forecasting

With this task, the objective is to produce a univariate forecast for the surface temperature, focusing on choosing either a Holt linear trend model or an ARIMA model. We will train the models and determine their predictive accuracy on an out-of-time test set, just like we've done in other learning endeavors. The following code creates the temperature subset and then the train and test sets, starting after WWII:

    > temp <- climate[, 2]    > temp <- climate[, 2]    > train <- window(temp, start = 1946, end = 2003)    > test <- window(temp, start = 2004)

To build our smoothing model, we will use the holt() function found in the forecast package. We will build two models, one with and one without a damped trend. In ...

Get Mastering Machine Learning with R - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.