ccross: ccross

Description Usage Arguments Value Examples

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
# Computing the matrix-square-root of a positive definite square matrix:
# generate random data
rand_data(100,500)

W <- ccross(M)

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

cheuerde/cpgen documentation built on May 13, 2019, 3:57 p.m.