Skip to contents

Thin wrapper around arima() that fixes d = 0 and q = 0. Matches the in-formula ar() helper that brms users will be familiar with. Equivalent to arima(time, by, p = p, d = 0, q = 0).

Usage

ar(time, by, p = 1)

Arguments

time

Time variable for the latent series; numeric.

by

Optional grouping variable. Each group draws an independent shock series; AR/MA parameters and the latent standard deviation are shared across groups.

p

Autoregressive order. Defaults to 1.

Value

An enw_arima_term interpretable by construct_arima().

Examples

ar(time)
#> $time
#> [1] "time"
#> 
#> $by
#> NULL
#> 
#> $p
#> [1] 1
#> 
#> $d
#> [1] 0
#> 
#> $q
#> [1] 0
#> 
#> attr(,"class")
#> [1] "enw_arima_term"
ar(time, location, p = 2)
#> $time
#> [1] "time"
#> 
#> $by
#> [1] "location"
#> 
#> $p
#> [1] 2
#> 
#> $d
#> [1] 0
#> 
#> $q
#> [1] 0
#> 
#> attr(,"class")
#> [1] "enw_arima_term"