make_Q_alpha_tau2: Title

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

make_Q_alpha_tau2R Documentation

Title

Description

Title

Usage

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

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)


jtipton25/BayesMRA documentation built on Feb. 28, 2024, 1:27 p.m.