RW() returns a random walk model, which is equivalent to an ARIMA(0,1,0) model with an optional drift coefficient included using drift(). naive() is simply a wrapper to rwf() for simplicity. snaive() returns forecasts and prediction intervals from an ARIMA(0,0,0)(0,1,0)m model where m is the seasonal period.

RW(formula, ...)

NAIVE(formula, ...)

SNAIVE(formula, ...)



Model specification (see "Specials" section).


Not used.


The random walk with drift model is $$Y_t=c + Y_{t-1} + Z_t$$ where \(Z_t\) is a normal iid error. Forecasts are given by $$Y_n(h)=ch+Y_n$$. If there is no drift (as in naive), the drift parameter c=0. Forecast standard errors allow for uncertainty in estimating the drift parameter (unlike the corresponding forecasts obtained by fitting an ARIMA model directly).

The seasonal naive model is $$Y_t= Y_{t-m} + Z_t$$ where \(Z_t\) is a normal iid error.



The lag special is used to specify the lag order for the random walk process. If left out, this special will automatically be included.
lag(lag = NULL)
The lag order for the random walk process. If
lag = m, forecasts will return the observation from
mtime periods ago. This can also be provided as text indicating the duration of the lag window (for example, annual seasonal lags would be "1 year").


The drift special can be used to include a drift/trend component into the model. By default, drift is not included unless drift() is included in the formula.
drift(drift = TRUE)
drift = TRUE, a drift term will be included in the model.


library(tsibbledata) aus_production %>% model(rw = RW(Beer ~ drift()))
#> # A mable: 1 x 1 #> rw #> <model> #> 1 <RW w/ drift>
Nile %>% as_tsibble %>% model(NAIVE())
#> Model not specified, defaulting to automatic modelling of the `value` variable. Override this using the model formula.
#> # A mable: 1 x 1 #> `NAIVE()` #> <model> #> 1 <NAIVE>
library(tsibbledata) aus_production %>% model(snaive = SNAIVE(Beer ~ lag("year")))
#> # A mable: 1 x 1 #> snaive #> <model> #> 1 <SNAIVE>