autocor-terms: Autocorrelation structures

Description Details See Also Examples

Description

Specify autocorrelation terms in brms models. Currently supported terms are arma, ar, ma, cosy, sar, car, and fcor. Terms can be directly specified within the formula, or passed to the autocor argument of brmsformula in the form of a one-sided formula. For deprecated ways of specifying autocorrelation terms, see cor_brms.

Details

The autocor term functions are almost solely useful when called in formulas passed to the brms package. They do not evaluate its arguments – but exist purely to help set up a model with autocorrelation terms.

See Also

brmsformula, acformula, arma, ar, ma, cosy, sar, car, fcor

Examples

1
2
3
4
5
6
7
8
# specify autocor terms within the formula
y ~ x + arma(p = 1, q = 1) + car(M)

# specify autocor terms in the 'autocor' argument
bf(y ~ x, autocor = ~ arma(p = 1, q = 1) + car(M))

# specify autocor terms via 'acformula'
bf(y ~ x) + acformula(~ arma(p = 1, q = 1) + car(M))

Example output

Loading required package: Rcpp
Loading 'brms' package (version 2.14.4). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package:brmsThe following object is masked frompackage:stats:

    ar

Warning message:
In file(con, "r") : cannot open file '/proc/stat': Permission denied
y ~ x + arma(p = 1, q = 1) + car(M)
y ~ x 
autocor ~ arma(p = 1, q = 1) + car(M)
y ~ x 
autocor ~ arma(p = 1, q = 1) + car(M)

brms documentation built on Aug. 23, 2021, 5:08 p.m.