rm.denoise.mat {RMThreshold}R Documentation

Remove noise from a random matrix by applying a threshold

Description

Matrix elements with an absolute value below the given threshold are set to zero.

Usage

 rm.denoise.mat(mat, threshold, keep.diag = TRUE)

Arguments

mat

The noisy input matrix.

threshold

Numerical value of the threshold.

keep.diag

A logical variable that determines if the diagonal of the matrix is thresholded or not. The default is keep.diag = T. In that case, diagonal matrix elements are not touched.

Details

The function outputs the number of non-zero matrix elements before and after thresholding.

Value

The thresholded matrix.

Author(s)

Uwe Menzel <uwemenzel@gmail.com>

See Also

Estimate an objective threshold for signal-noise separation in random matrices: rm.matrix.validation

Examples


set.seed(777)
random.matrix <- create.rand.mat(size = 1000, distrib = "norm")$rand.matr
dim(random.matrix)


## After identification of a proper candidate threshold:
cleaned.matrix <- rm.denoise.mat(random.matrix, threshold = 3.2, keep.diag = TRUE)	  
  

[Package RMThreshold version 1.1 Index]