Sarima: Constructor a Multiplicative Seasonal ARIMA model.

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

View source: R/Sarima.R

Description

Constructor of the SARIMA model for Bayesian estimation in Stan.

Usage

1
Sarima(ts,order = c(1,0,0),seasonal = c(0,0,0),xreg = NULL,period = 0,series.name = NULL)

Arguments

ts

a numeric or ts object with the univariate time series.

order

A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the number of differences, and the MA order.

seasonal

A specification of the seasonal part of the ARIMA model,same as order parameter: the three components (p, d, q) are the seasonal AR order, the degree of seasonal differences, and the seasonal MA order.

xreg

Optionally, a numerical matrix of external regressors, which must have the same number of rows as ts. It should not be a data frame.

period

an integer specifying the periodicity of the time series by default the value frequency(ts) is used.

series.name

an optional string vector with the series names.

Details

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

If xreg option is used, the model by default will cancel the seasonal differences adjusted (D = 0). If a value d > 0 is used, all the regressor variables in xreg will be difference as well.

The default priors used in Sarima are:

For changing the default prior use the function set_prior

Value

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

Author(s)

Asael Alonzo Matamoros

References

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.

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

See Also

garch set_prior

Examples

1
2
3
4
5
6
7
8
9
# Declare a multiplicative seasonal ARIMA model for the birth data.

library(astsa)
model = Sarima(birth,order = c(0,1,2),seasonal = c(1,1,1))
model

#Declare an Dynamic Harmonic Regression model for the birth data.
model = Sarima(birth,order = c(1,0,1),xreg = fourier(birth,K = 2))
model

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