centered_precgen3: centered_precgen3

Description Usage Arguments Details Value Examples

View source: R/centered_precgen3.R

Description

This function generates a precision matrix for a centered (every node in level 1 has the same number of children nodes) 3-level Gaussian hierarchical model (level 0 being the root, and level 4 being the observations) given the variances for each level tau, tau_a, tau_b, tau_c, and sigma_2. It takes advantage of the sparse structure of the precision matrix for centered 2-level gaussian hierarchical models and returns only the non-zero entries of the precision matrix together with its corresponding indices.

Usage

1
2
centered_precgen3(i, j, k, flat_prior = TRUE, tau = 1, tau_a = 1,
  tau_b = 1, tau_c = 1, sigma_2 = 1)

Arguments

i

number of nodes at level 1

j

number of children nodes in level 2 per node at level 1

k

number of children nodes in level 3 per node at level 2

flat_prior

determines whether to use the density with flat prior

tau

variance of the root (level 0)

tau_a

variance for parameters in level 1

tau_b

variance for parameters in level 2

tau_c

variance for parameters in level 3

sigma_2

variance of the observations

Details

Assumptions: - variances are constant for parameters within the same level - all observations y_ijk are equal to 0 - the mean of the root parameter B is mu = 0

Value

list of non-zero entries of the precision matrix together with its corresponding indices

Examples

1
2
3
4
i <- 2
j <- 3
k <- 2
centered_precgen3(i = i, j = j, k = k)

kwajiehao/ghInf documentation built on May 7, 2019, 10:58 a.m.