A call to arima() can be used in the formula argument
of model construction functions in the epinowcast package such as
enw_formula(). It declares an ARIMA(p, d, q) latent series indexed
by time (and optionally a grouping variable by) whose value at
each observation is added to the linear predictor. As with rw(),
arguments are not evaluated; they are passed by name for use in
model construction. Setting p = d = q = 0 is not allowed; use
rw() (equivalent to arima(time, d = 1)) for a random walk.
Arguments
- time
Defines the time index of the ARIMA process.
- by
Optional grouping variable. If supplied, an independent ARIMA series is fitted for each level of
by. Currently limited to a single variable.- p
Non-negative integer. Order of the autoregressive part. Defaults to 1.
- d
Non-negative integer. Order of differencing (
d = 1gives an integrated series, equivalent torw()whenp = q = 0). Defaults to 0.- q
Non-negative integer. Order of the moving-average part. Defaults to 0.
Value
A list of class enw_arima_term describing the ARIMA term,
interpretable by construct_arima(). Each group draws an independent
shock series; phi, theta, and sigma are shared across groups
(per-group parameters are a planned extension).
See also
Functions used to help convert formulas into model designs
ar(),
arima_terms(),
arma(),
as_string_formula(),
construct_arima(),
construct_gp(),
construct_re(),
construct_rw(),
enw_formula(),
enw_manual_formula(),
gp(),
gp_terms(),
ma(),
parse_formula(),
re(),
remove_arima_terms(),
remove_gp_terms(),
remove_rw_terms(),
rw(),
rw_terms(),
split_formula_to_terms()
Examples
arima(time)
#> $time
#> [1] "time"
#>
#> $by
#> NULL
#>
#> $p
#> [1] 1
#>
#> $d
#> [1] 0
#>
#> $q
#> [1] 0
#>
#> attr(,"class")
#> [1] "enw_arima_term"
arima(time, location)
#> $time
#> [1] "time"
#>
#> $by
#> [1] "location"
#>
#> $p
#> [1] 1
#>
#> $d
#> [1] 0
#>
#> $q
#> [1] 0
#>
#> attr(,"class")
#> [1] "enw_arima_term"
arima(time, location, p = 2, d = 1, q = 1)
#> $time
#> [1] "time"
#>
#> $by
#> [1] "location"
#>
#> $p
#> [1] 2
#>
#> $d
#> [1] 1
#>
#> $q
#> [1] 1
#>
#> attr(,"class")
#> [1] "enw_arima_term"
