Skip to contents

Multi-trait mixed models, their ridge-penalised form, and the Bayesian multi-trait multi-environment (BMTME) conditionals.

Usage

morie_multitrait(Y, Z, G, Sigma_T, R_T, X = NULL) 

morie_multitrait(Y, Z, G, Sigma_T, R_T, X = NULL) 

morie_multitrait_ridge(Z1, G) 

morie_gxe_multitrait(Y, Z_L, Z_EL, G, Sigma_T, Sigma_E, Sigma_2T, R_T, X = NULL) 

morie_gxe_blup(y, X_E, Z_L, Z_EL, G, sigma2_g, Sigma_E, sigma2_e = 1) 

morie_bmtme_conditionals(Y, Z1, Z2, G, Sigma_T, Sigma_E, R, b1 = NULL,
  b2 = NULL, nu_T = NULL, S_T = NULL, nu_E = NULL, S_E = NULL)

Arguments

Y

response matrix, one column per trait

X

fixed-effect design matrix

Z

random-effect design matrix

G

argument G; not described in the source.

Sigma_T

argument Sigma_T; not described in the source.

R_T

argument R_T; not described in the source.

Z1

argument Z1; not described in the source.

Z_L

argument Z_L; not described in the source.

Z_EL

argument Z_EL; not described in the source.

Sigma_E

argument Sigma_E; not described in the source.

Sigma_2T

argument Sigma_2T; not described in the source.

y

argument y; not described in the source.

X_E

argument X_E; not described in the source.

sigma2_g

argument sigma2_g; not described in the source.

sigma2_e

argument sigma2_e; not described in the source.

Z2

argument Z2; not described in the source.

R

argument R; not described in the source.

b1

argument b1; not described in the source.

b2

argument b2; not described in the source.

nu_T

argument nu_T; not described in the source.

S_T

argument S_T; not described in the source.

nu_E

argument nu_E; not described in the source.

S_E

argument S_E; not described in the source.

Value

A list holding the fitted quantities for the method called: point estimates, fitted values and any diagnostics it produces. See the individual method descriptions above for the components each returns.

Details

These functions mirror, in R, the implementations in the Python package morie; the two are checked against each other by the parity tests in tests/testthat/.

Examples

set.seed(1)
n <- 12
A <- matrix(rnorm(n * 6), nrow = n)
G <- morie_grm(A) + diag(0.3, n)
rmorie:::morie_chol_lower(G)
#>              [,1]        [,2]        [,3]        [,4]         [,5]        [,6]
#>  [1,]  1.15201549  0.00000000  0.00000000  0.00000000  0.000000000  0.00000000
#>  [2,]  0.12838618  1.04034457  0.00000000  0.00000000  0.000000000  0.00000000
#>  [3,] -0.01283583 -0.36341511  1.01846129  0.00000000  0.000000000  0.00000000
#>  [4,] -0.63896371 -0.08711234 -0.20288008  1.03282532  0.000000000  0.00000000
#>  [5,] -0.22919210  0.13341694 -0.14076774 -0.07552165  0.655886686  0.00000000
#>  [6,]  0.35277750 -0.39106219  0.06254605 -0.26199216  0.137970198  0.90340303
#>  [7,] -0.46184761  0.04658816  0.22680111 -0.65419087 -0.068579321 -0.12767445
#>  [8,] -0.07904839 -0.02070600  0.21022231 -0.06330491 -0.197044817 -0.63644010
#>  [9,]  0.12297173 -0.24743122 -0.42165046 -0.23933193  0.100865298  0.21665318
#> [10,]  0.67486673 -0.43406532 -0.21240411  0.01563658  0.042589084  0.31570296
#> [11,] -0.49790276  0.03005544 -0.21694855  0.48962580 -0.002048928 -0.35316306
#> [12,] -0.25081406  0.54961617  0.06589384  0.30590258 -0.026528804  0.05705384
#>              [,7]         [,8]         [,9]       [,10]       [,11]     [,12]
#>  [1,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [2,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [3,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [4,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [5,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [6,]  0.00000000  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [7,]  1.09272048  0.000000000  0.000000000  0.00000000  0.00000000 0.0000000
#>  [8,]  0.09633511  0.834576279  0.000000000  0.00000000  0.00000000 0.0000000
#>  [9,]  0.06378849 -0.026367093  0.706601299  0.00000000  0.00000000 0.0000000
#> [10,] -0.39348624 -0.007635104  0.191664941  0.67989568  0.00000000 0.0000000
#> [11,] -0.20176392  0.190378384  0.009946306 -0.01193821  0.65337673 0.0000000
#> [12,]  0.04859924 -0.300125091 -0.265698462 -0.19196973 -0.06950237 0.7085324
morie_multitrait(Y = G, Z = G, G = G, Sigma_T = G, R_T = G)
#> $mu
#>  [1] 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025
#> 
#> $beta
#>  [1] 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025
#> 
#> $b
#>   [1]  0.380139444  0.134967215 -0.016108910 -0.234721021 -0.109428190
#>   [6]  0.018685845 -0.189331634  0.053177373 -0.035765111  0.182439736
#>  [11] -0.146979613 -0.037075135  0.134967215  0.416483336 -0.200269229
#>  [16] -0.140645230  0.040151989 -0.144675313 -0.036225425 -0.026449129
#>  [21] -0.092610170 -0.120560659 -0.056547746  0.226380359 -0.016108910
#>  [26] -0.200269229  0.510303575 -0.023835236 -0.113841548  0.095779156
#>  [31]  0.037686937  0.089578205 -0.231200077 -0.038074417 -0.093862082
#>  [36] -0.016156376 -0.234721021 -0.140645230 -0.023835236  0.443683728
#>  [41]  0.014697829 -0.070593215 -0.182640757 -0.085401978 -0.037212325
#>  [46] -0.036026082  0.253217678  0.099476610 -0.109428190  0.040151989
#>  [51] -0.113841548  0.014697829  0.134831203  0.014778395  0.041585384
#>  [56] -0.092301895  0.073736776 -0.044230750  0.026415647  0.013605160
#>  [61]  0.018685845 -0.144675313  0.095779156 -0.070593215  0.014778395
#>  [66]  0.325267166  0.008919381 -0.259748452  0.098760867  0.143836808
#>  [71] -0.193886133 -0.037124505 -0.189331634 -0.036225425  0.037686937
#>  [76] -0.182640757  0.041585384  0.008919381  0.629701845  0.070462632
#>  [81]  0.078805605 -0.270526494 -0.146223579 -0.042213896  0.053177373
#>  [86] -0.026449129  0.089578205 -0.085401978 -0.092301895 -0.259748452
#>  [91]  0.070462632  0.477308908 -0.091043255 -0.064451618  0.133001647
#>  [96] -0.204132438 -0.035765111 -0.092610170 -0.231200077 -0.037212325
#> [101]  0.073736776  0.098760867  0.078805605 -0.091043255  0.303667804
#> [106]  0.123035533 -0.009831775 -0.180343873  0.182439736 -0.120560659
#> [111] -0.038074417 -0.036026082 -0.044230750  0.143836808 -0.270526494
#> [116] -0.064451618  0.123035533  0.335324935 -0.031792261 -0.178974731
#> [121] -0.146979613 -0.056547746 -0.093862082  0.253217678  0.026415647
#> [126] -0.193886133 -0.146223579  0.133001647 -0.009831775 -0.031792261
#> [131]  0.312313250 -0.045825033 -0.037075135  0.226380359 -0.016156376
#> [136]  0.099476610  0.013605160 -0.037124505 -0.042213896 -0.204132438
#> [141] -0.180343873 -0.178974731 -0.045825033  0.402383856
#> 
#> $b_by_line
#> $b_by_line$`1`
#>  [1]  0.38013944  0.13496722 -0.01610891 -0.23472102 -0.10942819  0.01868585
#>  [7] -0.18933163  0.05317737 -0.03576511  0.18243974 -0.14697961 -0.03707513
#> 
#> $b_by_line$`2`
#>  [1]  0.13496722  0.41648334 -0.20026923 -0.14064523  0.04015199 -0.14467531
#>  [7] -0.03622542 -0.02644913 -0.09261017 -0.12056066 -0.05654775  0.22638036
#> 
#> $b_by_line$`3`
#>  [1] -0.01610891 -0.20026923  0.51030358 -0.02383524 -0.11384155  0.09577916
#>  [7]  0.03768694  0.08957821 -0.23120008 -0.03807442 -0.09386208 -0.01615638
#> 
#> $b_by_line$`4`
#>  [1] -0.23472102 -0.14064523 -0.02383524  0.44368373  0.01469783 -0.07059322
#>  [7] -0.18264076 -0.08540198 -0.03721232 -0.03602608  0.25321768  0.09947661
#> 
#> $b_by_line$`5`
#>  [1] -0.10942819  0.04015199 -0.11384155  0.01469783  0.13483120  0.01477840
#>  [7]  0.04158538 -0.09230190  0.07373678 -0.04423075  0.02641565  0.01360516
#> 
#> $b_by_line$`6`
#>  [1]  0.018685845 -0.144675313  0.095779156 -0.070593215  0.014778395
#>  [6]  0.325267166  0.008919381 -0.259748452  0.098760867  0.143836808
#> [11] -0.193886133 -0.037124505
#> 
#> $b_by_line$`7`
#>  [1] -0.189331634 -0.036225425  0.037686937 -0.182640757  0.041585384
#>  [6]  0.008919381  0.629701845  0.070462632  0.078805605 -0.270526494
#> [11] -0.146223579 -0.042213896
#> 
#> $b_by_line$`8`
#>  [1]  0.05317737 -0.02644913  0.08957821 -0.08540198 -0.09230190 -0.25974845
#>  [7]  0.07046263  0.47730891 -0.09104326 -0.06445162  0.13300165 -0.20413244
#> 
#> $b_by_line$`9`
#>  [1] -0.035765111 -0.092610170 -0.231200077 -0.037212325  0.073736776
#>  [6]  0.098760867  0.078805605 -0.091043255  0.303667804  0.123035533
#> [11] -0.009831775 -0.180343873
#> 
#> $b_by_line$`10`
#>  [1]  0.18243974 -0.12056066 -0.03807442 -0.03602608 -0.04423075  0.14383681
#>  [7] -0.27052649 -0.06445162  0.12303553  0.33532494 -0.03179226 -0.17897473
#> 
#> $b_by_line$`11`
#>  [1] -0.146979613 -0.056547746 -0.093862082  0.253217678  0.026415647
#>  [6] -0.193886133 -0.146223579  0.133001647 -0.009831775 -0.031792261
#> [11]  0.312313250 -0.045825033
#> 
#> $b_by_line$`12`
#>  [1] -0.03707513  0.22638036 -0.01615638  0.09947661  0.01360516 -0.03712450
#>  [7] -0.04221390 -0.20413244 -0.18034387 -0.17897473 -0.04582503  0.40238386
#> 
#>