ccross: ccross

Description Usage Arguments Value Examples

View source: R/ctools.R

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 positive definite square matrix:
## Not run: 
# generate random data
rand_data(500,5000)

W <- ccross(M)

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

## End(Not run)

cpgen documentation built on May 2, 2019, 8:15 a.m.