naive: Naive and Random Walk models.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/naive.R

Description

naive is the model constructor for a random walk model applied to y. This is equivalent to an ARIMA(0,1,0) model. naive() is simply a wrapper to maintain forecast package similitude. seasonal returns the model constructor for a seasonal random walk equivalent to an ARIMA(0,0,0)(0,1,0)m model where m is the seasonal period.

Usage

1
naive(ts,seasonal = FALSE,m = 0)

Arguments

ts

a numeric or ts object with the univariate time series.

seasonal

a Boolean value for select a seasonal random walk instead.

m

an optional integer value for the seasonal period.

Details

The random walk with drift model is

Y[t]= mu_0 +Y[t-1] + epsilon[t]

where epsilon[t] is a normal iid error.

The seasonal naive model is

Y[t]= mu_0 +Y[t-m] + epsilon[t]

where epsilon[t] is a normal iid error.

Value

The function returns a list with the data for running stan() function of rstan package.

Author(s)

Asael Alonzo Matamoros

References

Hyndman, R. & Khandakar, Y. (2008). Automatic time series forecasting: the forecast package for R. Journal of Statistical Software. 26(3), 1-22.doi: 10.18637/jss.v027.i03.

Box, G. E. P. and Jenkins, G.M. (1978). Time series analysis: Forecasting and control. San Francisco: Holden-Day. Biometrika, 60(2), 297-303. doi:10.1093/biomet/65.2.297.

Kennedy, P. (1992). Forecasting with dynamic regression models: Alan Pankratz, 1991. International Journal of Forecasting. 8(4), 647-648. url: https://EconPapers.repec.org/RePEc:eee:intfor:v:8:y:1992:i:4:p:647-648.

See Also

Sarima

Examples

1
2
3
4
library(astsa)
# A seasonal Random-walk model.
model = naive(birth,seasonal = TRUE)
model

bayesforecast documentation built on June 17, 2021, 5:14 p.m.