update_u: Update U matrix

Description Usage Arguments See Also Examples

View source: R/update_u.R

Description

Update U matrix

Usage

1
update_u(OmegaE, UltVehiY, UltVehiBX)

Arguments

OmegaE

the OmegaE matrix, calculated in calc_omega

UltVehiY

matrix

UltVehiBX

matrix

See Also

Other expectation-maximization functions: UpdateRL_B(), update_e(), update_v()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
readr::read_tsv(system.file("extdata",
"mouse100.pheno.txt",
package = "gemma2"),
col_names = FALSE) -> pheno
phe16 <- as.matrix(pheno[, c(1, 6)])
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
UltVehi <- ep_out[[3]]
calc_omega(eval, ep_out$D_l) -> co_out
update_u(OmegaE = co_out[[2]],
        UltVehiY = UltVehi %*% t(phe16),
        UltVehiBX = matrix(c(-0.71342, -0.824482),
        ncol = 1) %*% t(rep(1, 100))
)

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