ets_model: ETS model

Description Usage Arguments Value Note Examples

View source: R/ets.R

Description

Creates an exponential smoothing state space (ETS) model that is then fitted to the data as a univariate time series.

Usage

1
ets_model(model = "ZZZ", ...)

Arguments

model

Model type according to ets. Default is "ZZZ" which performs auto-fitting.

...

Further arguments used when fitting ETS model.

Value

Model definition that can then be insered into train.

Note

ETS model does not support exogenous variables. Yet, we need to supply some sample data when making predictions in order to work with caret. However, these values are ignored.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(caret)

library(forecast)
data(WWWusage) # from package "forecast"

data_train <- WWWusage[1:80]
data_test <- WWWusage[81:100]

lm <- train(data_train, method = "lm", trControl = trainDirectFit())
summary(lm)
RMSE(predict(lm, data_test), data_test)

ets <- train(data_train, method = ets_model(), trControl = trainDirectFit())
summary(ets)
RMSE(predict(ets, data_test), data_test)

sfeuerriegel/caret.ts documentation built on May 29, 2019, 8:01 p.m.