calc_qi: Calculate Qi (inverse of Q) and log determinant of Q

Description Usage Arguments Value Examples

View source: R/calc_XHiY.R

Description

Calculate Qi (inverse of Q) and log determinant of Q

Usage

1
calc_qi(eval, D_l, X)

Arguments

eval

vector of eigenvalues from decomposition of relatedness matrix

D_l

vector of length d_size

X

design matrix

Value

a list of length two. First entry in the list is a symmetric numeric matrix, Qi, the inverse of the Q matrix. The second entry in the outputted list is the log determinant of the matrix Q for use in likelihood calculations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
as.matrix(readr::read_tsv(system.file("extdata",
"mouse100.cXX.txt",
package = "gemma2"),
col_names = FALSE)[, 1:100]) -> kinship
eigen2(kinship) -> e2_out
e2_out$values -> eval
e2_out$vectors -> U
eigen_proc(V_g = diag(c(1.91352, 0.530827)),
V_e = diag(c(0.320028, 0.561589))) -> ep_out

calc_qi(eval = eval,
D_l = ep_out[[4]],
X = t(rep(1, 100)) %*% U)

gemma2 documentation built on Oct. 24, 2020, 5:06 p.m.