add_noise_bias {topolow} | R Documentation |
Add Noise and Bias to Matrix Data
Description
Creates noisy versions of a distance matrix by adding random noise and/or systematic bias. Useful for testing robustness of algorithms to measurement errors and systematic biases.
Usage
add_noise_bias(matrix_data)
Arguments
matrix_data |
Numeric matrix to add noise to |
Details
The function generates three variants of the input matrix:
n1: Matrix with random Gaussian noise
n2: Different realization of random noise
nb: Matrix with both random noise and systematic negative bias
The noise level is scaled relative to the data mean to maintain realistic error magnitudes.
Value
A list
containing three noisy matrix
objects:
n1 |
Matrix with the first realization of random Gaussian noise. |
n2 |
Matrix with a second, different realization of random Gaussian noise. |
nb |
Matrix with both random noise and a systematic negative bias. |
Examples
# Create sample distance matrix
dist_mat <- matrix(runif(100), 10, 10)
dist_mat[lower.tri(dist_mat)] <- t(dist_mat)[lower.tri(dist_mat)]
diag(dist_mat) <- 0
# Generate noisy versions
noisy_variants <- add_noise_bias(dist_mat)
[Package topolow version 1.0.0 Index]