Skip to contents

This function extracts ARIMA terms from a formula so that they can be processed on their own. Matches all four user-facing helpers that produce an enw_arima_term: arima(), plus the convenience aliases ar(), ma(), and arma().

Usage

arima_terms(formula)

Arguments

formula

A model formula that may use standard fixed effects, random effects using lme4 syntax (see re()), and random walks defined using the rw() helper function. See the Details section below for a comprehensive explanation of the supported syntax.

Value

A character vector containing the ARIMA terms identified in the supplied formula.

Examples

epinowcast:::arima_terms(~ 1 + age_group + arima(week))
#> [1] "arima(week)"
epinowcast:::arima_terms(~ 1 + ar(week, p = 2))
#> [1] "ar(week, p = 2)"
epinowcast:::arima_terms(~ 1 + arma(week, location, p = 1, q = 1))
#> [1] "arma(week, location, p = 1, q = 1)"