ccross

Description

Computation of the following matrix-product: \mathbf{XDX}' Where \mathbf{D} is a diagonal matrix, which is being passed to the function as a vector.

Usage

1

Arguments

X

matrix

D

numeric vector, will be used as a weighting diagonal matrix of dimension ncol(X). If omitted an identity matrix will be assigned.

Value

Square matrix of dimension nrow(X)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Computing the matrix-square-root of a genomic relationship matrix:
## Not run: 
# generate random data
rand_data(500,5000)

A <- cgrm.A(M,lambda=0.01)

# this is the implementation of the matrix power-operator '%**%'
A_sqrt <- with(eigen(A), ccross(vectors,values**0.5))

## End(Not run)