fable (version 0.0.0.9100)

RW: Random walk models

Description

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.

Usage

RW(formula)

NAIVE(formula)

SNAIVE(formula)

Arguments

formula

Model specification.

Details

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.

Examples

Run this code
# NOT RUN {
library(tsibbledata)
elecdemand %>% 
  model(rw = RW(Demand ~ drift()))


Nile %>% as_tsibble %>% model(NAIVE())

library(tsibbledata)
elecdemand %>% model(snaive = SNAIVE(Temperature ~ lag("day")))

# }

Run the code above in your browser using DataLab