fit_sarima: Estimate SARIMA model

Description Usage Arguments Details Value

View source: R/estimation.R

Description

Estimate SARIMA model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fit_sarima(
  y,
  ts_frequency,
  transformation = "box-cox",
  bc_gamma = 0.5,
  sarimaTD_d = 0,
  sarimaTD_D = 1,
  d = NA,
  D = NA,
  ...
)

Arguments

y

a univariate time series or numeric vector.

ts_frequency

frequency of time series. Must be provided if y is not of class "ts". See the help for stats::ts for more.

transformation

character specifying transformation type: "box-cox", "log", "forecast-box-cox", or "none". See details for more.

bc_gamma

numeric offset used in Box-Cox transformation; gamma is added to all observations before transforming. Default value of 0.5 allows us to use the Box-Cox transform (which requires positive inputs) in case of observations of 0, and also ensures that the de-transformed values will always be at least -0.5, so that they round up to non-negative values.

sarimaTD_d

integer order of first differencing done before passing to auto.arima

sarimaTD_D

integer order of seasonal differencing done before passing to auto.arima

d

order of first differencing argument to auto.arima.

D

order of seasonal differencing argument to auto.arima.

...

arguments passed on to forecast::auto.arima

Details

This function is a wrapper around forecast::auto.arima, providing some useful defaults for preliminary transformations of the data. Formal and informal experimentation has shown these preliminary transformations to be helpful with a few infectious disease time series data sets. Note that if any transformation was specified or the seasonal_difference argument was TRUE in the call to this function, only prediction/forecast utilities provided by the sarimaTD package can be used! We have found that using the default arguments for transformation, seasonal_difference, d, and D, yields good performance.

Value

a SARIMA model fit


reichlab/sarima-utils documentation built on March 21, 2020, 3:45 a.m.