rm.denoise.mat: Remove noise from a random matrix by applying a threshold

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
 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

1
2
3
4
5
6
7
8
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)	  
  

RMThreshold documentation built on May 2, 2019, 8:51 a.m.