LLQuadFormDiagCPP {statgenQTLxT} | R Documentation |
Compute tYPY as in Zhou and Stephens eqn. 50.
Description
Compute t(y) * P * y
, part of the log-likelihood functions from
equation 26 and 27 in Zhou and Stephens using equation 50. Equation 56, 57
and 58 are used to do the actual computations.
Usage
LLQuadFormDiagCPP(y, vInv, size_param_x = NULL)
Arguments
vInv |
A n x p x p cube containing for each genotype l the
p x p matrix |
size_param_x |
An optional c x n covariate matrix, c being the number of covariates and n being the number of genotypes. c has to be at least one (typically an intercept). No missing values are allowed. |
Details
It is assumed that X and Y have already been rotated by Uk, where Uk is such
that the kinship matrix K equals K = Uk * Dk * t(Uk)
.
The original X and Y are right multiplied by Uk, e.g. Y <- Y * Uk
.
See Zhou and Stephens (2014), supplement.
It is these rotated versions that are the input of this function.
Value
A numerical value for the t(y) * P * y
part of the
log-likelihood function.
References
Zhou, X. and Stephens, M. (2014). Efficient multivariate linear mixed model algorithms for genome-wide association studies. Nature Methods, February 2014, Vol. 11, p. 407–409