Update U matrix
update_u(OmegaE, UltVehiY, UltVehiBX)
OmegaE | the OmegaE matrix, calculated in calc_omega |
---|---|
UltVehiY | matrix |
UltVehiBX | matrix |
Other expectation-maximization functions:
UpdateRL_B()
,
update_e()
,
update_v()
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#> #> ── Column specification ──────────────────────────────────────────────────────── #> #> #> col_logical() #> #> ℹ Use `spec()` for the full column specifications.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)) )#> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] -9.908911e-12 0.2461160 0.04298754 -0.0421756 -0.04342257 -0.04461315 #> [2,] -2.444506e-11 0.7718073 0.14777929 -0.2975836 -0.30399454 -0.76035525 #> [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 0.08323637 0.2260749 0.07418004 -0.04958329 -0.04416809 -0.05166512 #> [2,] 0.87645493 0.7551364 -0.81735080 -0.33425643 -0.10317700 -0.34398163 #> [,13] [,14] [,15] [,16] [,17] [,18] #> [1,] -0.0519308 0.02110372 -0.2237671 -0.05530237 -0.05664449 0.1319567 #> [2,] 1.4081631 0.01367726 0.1741608 -0.36040757 -0.36629445 0.5541177 #> [,19] [,20] [,21] [,22] [,23] [,24] #> [1,] -0.05833684 0.1065272 -0.06098682 -0.06347804 -0.06444943 -0.0647078 #> [2,] 1.93034129 -0.3794845 -0.38473130 0.42495391 -0.00793931 -0.3998274 #> [,25] [,26] [,27] [,28] [,29] [,30] #> [1,] 0.0435344 -0.06729572 -0.06903608 0.2939944 -0.07132697 -0.1166892 #> [2,] 0.8809533 -0.40996642 -0.41662592 1.3103133 -0.42520394 -0.4296176 #> [,31] [,32] [,33] [,34] [,35] [,36] #> [1,] -0.07328797 -0.07469817 -0.07550346 -0.07676854 0.1599921 0.2893433 #> [2,] -0.43238231 -0.43745346 -0.44031593 -0.44476465 1.2126099 -0.4535943 #> [,37] [,38] [,39] [,40] [,41] [,42] #> [1,] -0.08002198 -0.1451221 0.2079267 0.10467191 -0.0869796 -0.08898879 #> [2,] -0.62294537 -0.4608911 0.6710927 -0.08148882 -0.4786480 -0.48491878 #> [,43] [,44] [,45] [,46] [,47] [,48] #> [1,] -0.09002557 -0.01178874 0.4314496 -0.09522728 -0.09774101 -0.09963928 #> [2,] 1.66687547 -0.07767626 -0.5023537 -0.50363139 3.13627061 -0.09701223 #> [,49] [,50] [,51] [,52] [,53] [,54] #> [1,] -0.1946018 -0.04514685 0.4835308 -0.1068046 0.1750753 -0.1110476 #> [2,] -2.2840966 -0.11111982 -0.6490259 1.9093548 1.0419833 -0.5464868 #> [,55] [,56] [,57] [,58] [,59] [,60] #> [1,] -0.1129854 -0.1141988 0.1490842 -0.1168613 0.2821238 0.1874973 #> [2,] -0.5513302 -0.5543216 -0.5583149 1.2155607 1.8000413 -1.3891720 #> [,61] [,62] [,63] [,64] [,65] [,66] #> [1,] 0.4553419 -0.124560 -0.4384133 -0.1304234 0.4390797 -0.1391742 #> [2,] -1.6923167 0.151626 -0.5867933 -0.5914955 -0.6033227 -0.6095878 #> [,67] [,68] [,69] [,70] [,71] [,72] #> [1,] -0.1421239 -0.1436444 0.05280936 -0.1513346 -0.1538385 -0.1588561 #> [2,] -0.6154105 -0.6183604 0.90223625 -0.6327670 -0.6372812 -1.1677294 #> [,73] [,74] [,75] [,76] [,77] [,78] [,79] #> [1,] -0.1605188 -0.07974105 0.494331 0.5925347 -0.1776119 -0.1781952 -0.1860005 #> [2,] 0.6462120 0.60976903 2.570292 0.6636563 -0.6763114 1.2795926 -0.6886197 #> [,80] [,81] [,82] [,83] [,84] [,85] #> [1,] -0.1892363 -0.1903142 -0.1956206 -0.2744663 0.067223 0.01165348 #> [2,] -0.6931871 -0.6946872 -0.7019207 -0.7081686 -1.492503 1.08345459 #> [,86] [,87] [,88] [,89] [,90] [,91] #> [1,] -0.2224528 -0.2321725 -0.2451794 -0.2503196 -0.2572294 -0.2717377 #> [2,] -0.7350314 1.2854139 0.5077868 -0.7642925 -0.7708730 -0.7839280 #> [,92] [,93] [,94] [,95] [,96] [,97] #> [1,] -0.2754296 -0.2306931 -0.2356469 0.9957282 -0.3360918 0.66115869 #> [2,] 2.4196950 -1.4604510 -0.3353955 0.1347909 -0.8317475 -0.09289825 #> [,98] [,99] [,100] #> [1,] -0.3612252 0.1538093 0.9953924 #> [2,] -0.1098927 0.5347717 1.4641424