spectralG.cpp {RAINBOWR}R Documentation

Perform spectral decomposition (inplemented by Rcpp)

Description

Perform spectral decomposition for G = ZKZ' or SGS where S = I - X(X'X)^{-1}X.

Usage

spectralG.cpp(
  ZETA,
  ZWs = NULL,
  X = NULL,
  weights = 1,
  return.G = TRUE,
  return.SGS = FALSE,
  spectral.method = NULL,
  tol = NULL,
  df.H = NULL
)

Arguments

ZETA

A list of variance (relationship) matrix (K; m \times m) and its design matrix (Z; n \times m) of random effects. You can use only one kernel matrix. For example, ZETA = list(A = list(Z = Z, K = K)) Please set names of list "Z" and "K"!

ZWs

A list of additional linear kernels other than genomic relationship matrix (GRM). We utilize this argument in RGWAS.multisnp function, so you can ignore this.

X

n \times p matrix. You should assign mean vector (rep(1, n)) and covariates. NA is not allowed.

weights

If the length of ZETA >= 2, you should assign the ratio of variance components to this argument.

return.G

If thie argument is TRUE, spectral decomposition results of G will be returned. (G = ZKZ')

return.SGS

If this argument is TRUE, spectral decomposition results of SGS will be returned. (S = I - X(X'X)^{-1}X, G = ZKZ')

spectral.method

The method of spectral decomposition. In this function, "eigen" : eigen decomposition and "cholesky" : cholesky and singular value decomposition are offered. If this argument is NULL, either method will be chosen accorsing to the dimension of Z and X.

tol

The tolerance for detecting linear dependencies in the columns of G = ZKZ'. Eigen vectors whose eigen values are less than "tol" argument will be omitted from results. If tol is NULL, top 'n' eigen values will be effective.

df.H

The degree of freedom of K matrix. If this argument is NULL, min(n, sum(nrow(K1), nrow(K2), ...)) will be assigned.

Value

$spectral.G

The spectral decomposition results of G.

$U

Eigen vectors of G.

$delta

Eigen values of G.

$spectral.SGS

Estimator for \sigma^2_e

$Q

Eigen vectors of SGS.

$theta

Eigen values of SGS.


[Package RAINBOWR version 0.1.35 Index]