A call to rw() can be used in the formula argument of model
construction functions in the epinowcast package such as
enw_formula(). Mathematically a Gaussian random walk is exactly
an ARIMA(0, 1, 0) process; rw(time, by, type) is now a thin
wrapper over arima() with p = 0, d = 1, q = 0. It is kept
as a user-facing convenience because random walks are the most
common time-series structure in epinowcast formulas.
Arguments
- time
Defines the random walk time period.
- by
Defines the grouping parameter used for the random walk. If not specified no grouping is used. Currently this is limited to a single variable. Each group draws an independent shock series; the latent standard deviation is shared across groups (per-group standard deviations are a planned extension).
Value
A list of class enw_arima_term (with p = 0, d = 1,
q = 0) that can be interpreted by construct_arima().
Details
Does not evaluate arguments but instead simply passes information for use in model construction.
See also
Functions used to help convert formulas into model designs
ar(),
arima(),
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_terms(),
split_formula_to_terms()
Examples
rw(time)
#> $time
#> [1] "time"
#>
#> $by
#> NULL
#>
#> $p
#> [1] 0
#>
#> $d
#> [1] 1
#>
#> $q
#> [1] 0
#>
#> attr(,"class")
#> [1] "enw_arima_term"
rw(time, location)
#> $time
#> [1] "time"
#>
#> $by
#> [1] "location"
#>
#> $p
#> [1] 0
#>
#> $d
#> [1] 1
#>
#> $q
#> [1] 0
#>
#> attr(,"class")
#> [1] "enw_arima_term"
rw(time, location)
#> $time
#> [1] "time"
#>
#> $by
#> [1] "location"
#>
#> $p
#> [1] 0
#>
#> $d
#> [1] 1
#>
#> $q
#> [1] 0
#>
#> attr(,"class")
#> [1] "enw_arima_term"
