make_Q_alpha_tau2: Title

Description Usage Arguments Value Examples

View source: R/make-Q-alpha_tau2.R

Description

Title

Usage

1
make_Q_alpha_tau2(Q_alpha, tau2, use_spam = TRUE)

Arguments

Q_alpha

a list of length M composed of matrices that are the correlation structure of the CAR prior on beta.

tau2

a vector of length M that contains the CAR prior precision matrices.

use_spam

a boolean that determines if the output matrix is of class "spam" (use_spam = TRUE) or of class "dgCMatrix" (use_spam = FALSE; see Matrix package for details).

Value

A sparse block diagonal matrix representing the precision matrices for all of the resolutions of the random effects.

Examples

1
2
3
4
5
6
7
n_dims <- c(4, 8)
phi <- c(0.8, 0.9)
tau2 <- c(3, 4)
Q_alpha <- make_Q_alpha_2d(n_dims, phi)
Q_alpha_tau2 <- make_Q_alpha_tau2(Q_alpha, tau2)
## plot the full precision matrix structure
spam::display(Q_alpha_tau2)

BayesMRA documentation built on Aug. 18, 2020, 5:08 p.m.