half.inv: Half-inverse matrix operation

Description Usage Arguments Details Value Author(s) Examples

Description

Return square root of an inverse matrix.

Usage

1
half.inv(W, symmetric = TRUE, inverse = TRUE)

Arguments

W

positive definite matrix

Details

Note W must be strictly positive definite. For a matrix with negative eigen values the error is thrown. However, the problem might arise for matrices with eigen values close to zero.

Value

Matrix A such that t(A)%*%A is the inverse of W.

Author(s)

Riyan Cheng, copied from QTLRel

Examples

1
2
3
W <- matrix(c(1,1/2,1/2,1),2,2)
A <- HPQTL:::half.inv(W)
max(abs(t(A)%*%A%*%W) - diag(2))

simecek/HPQTL documentation built on May 29, 2019, 10 p.m.