depthfirst: depthfirst

Description Usage Arguments Value Examples

View source: R/depthfirst.R

Description

This function returns the sequence which permutes the rows and columns of the precision matrix for a centered 2- or 3-level gaussian hierarchical model which has been labelled lexicographically (that is, for a 2-level model with i nodes in the first level and j child nodes per node in the first level so that the columns and rows of the precision matrix are labelled B_11, ..., B_ij, B_1, ..., B_i, B) into a depth-first labelling (for example, for a 2-level model, B_11, B_12, ..., B_1J, B_1, B_21, ..., B_2J, B_2, ...)

Usage

1
depthfirst(i, j, k = NA, levels)

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

levels

the number of levels in chosen model

Value

a sequence of indices which permutes the original matrix

Examples

1
2
3
4
5
i <- 2
j <- 3
k <- 2
levels <- 3
depthfirst(i = i, j = j, k = k, levels = levels)

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