Thresholds the gram matrix

Share:

Description

Thresholds the gram matrix

Usage

1
ThresholdGram(gram.full, delta = 1/log(dim(gram.full)[1]))

Arguments

gram.full

the gram matrix before the elementwise thresholding, a p by p symmetric matrix

delta

the threshold, the default is 1/log(p)

Value

A list with two elements

gram.sd

the threhsolded gram matrix, a sparse matrix

gram.bias

the difference of the orginal matrix and the threholded matrix

Examples

1
2
3
4
5
6
7
p <-10
off.diag<-matrix(runif(p^2),p,p)
omega <- (off.diag+t(off.diag))*0.3
diag(omega) <- 1
omega.omega<-ThresholdGram(omega,0.3)
omega.omega$gram
omega.omega$gram.bias