fcor: Fixed residual correlation (FCOR) structures

Description Usage Arguments Value See Also Examples

View source: R/formula-ac.R

Description

Set up a fixed residual correlation (FCOR) term in brms. The function does not evaluate its arguments – it exists purely to help set up a model with FCOR terms.

Usage

1
fcor(M)

Arguments

M

Known correlation/covariance matrix of the response variable. If a vector is passed, it will be used as diagonal entries (variances) and correlations/covariances will be set to zero. The actual covariance matrix used in the likelihood is obtained by multiplying M by the square of the residual standard deviation parameter sigma estimated as part of the model.

Value

An object of class 'fcor_term', which is a list of arguments to be interpreted by the formula parsing functions of brms.

See Also

autocor-terms

Examples

1
2
3
4
5
6
## Not run: 
dat <- data.frame(y = rnorm(3))
V <- cbind(c(0.5, 0.3, 0.2), c(0.3, 1, 0.1), c(0.2, 0.1, 0.2))
fit <- brm(y ~ 1 + fcor(V), data = dat, data2 = list(V = V))

## End(Not run)

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