eigen_rotation: eigen decomposition + rotation

View source: R/lmm.R

eigen_rotationR Documentation

eigen decomposition + rotation

Description

Do eigen decomposition of kinship matrix and rotate X and y by that, i.e., pre-multiply by the transpose of the matrix of eigenvectors. If Kva and Kve_t provided, just do the "rotation".

Usage

eigen_rotation(K, y, X = NULL, Kva = NULL, Kve_t = NULL,
  use_cpp = TRUE)

Arguments

K

Kinship matrix (required if use_cpp=TRUE)

y

Phenotypes

X

Numeric matrix with covariates. If NULL, use a column of 1's (for intercept).

Kva

Eigenvalues of K (optional, ignored if use_cpp=TRUE)

Kve_t

= transposed eigenvectors of K (optional, ignored if use_cpp=TRUE)

use_cpp

= if TRUE, use c++ version of code

Value

List containing Kva, Kve_t and rotated y and X.

Examples

data(recla)
e <- eigen_rotation(recla$kinship, recla$pheno[,1], recla$covar)

kbroman/lmmlite documentation built on May 10, 2023, 6:05 p.m.