Description Usage Arguments Details Value Note Author(s) References See Also Examples
The function adds Gaussian (i.e. normally distributed) noise to a matrix.
1 | add.Gaussian.noise(mat, mean = 0, stddev = 1, symm = TRUE)
|
mat |
Input matrix. |
mean |
Mean of the Gaussian noise to be added. |
stddev |
Standard deviation of the Gaussian noise to be added. |
symm |
A logical variable that determines if the matrix is to be symmetrized after adding the noise. |
The function uses the rnorm
function to create the normally distributed noise and adds it to the input matrix. Optionally, the matrix is symmetrized by adding it's transpose and dividing by √ 2.
The input matrix with noise added, optionally symmetrized.
The matrix can not be symmetrized if it is not quadratic.
Uwe Menzel <uwemenzel@gmail.com>
https://en.wikipedia.org/wiki/Gaussian_noise
Random generation for the normal distribution: rnorm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
N = 500
some.mat = matrix(rep(1, N*N), nrow = N)
some.mat[1:3, 1:10]
res <- rm.matrix.validation(some.mat) # not really a proper matrix for this approach.
## End(Not run)
## It can help to add Gaussian noise to an improper matrix
## Not run:
noisy.matrix <- add.Gaussian.noise(some.mat, mean = 0, stddev = 1, symm = TRUE)
noisy.matrix[1:3, 1:10]
res <- rm.matrix.validation(noisy.matrix) # better!
res <- rm.get.threshold(noisy.matrix) # about 4.3
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.