This function generates background noise data with specified parameters such as the number of samples, number of dimensions, mean, and standard deviation.
Arguments
- n
Number of samples to generate.
- num_dims
Number of dimensions (columns) of the data.
- mean
Mean of the normal distribution used to generate noise (default is 0).
- sd
Standard deviation of the normal distribution used to generate noise (default is 1).
Examples
# Generate background noise with custom mean and standard deviation
set.seed(20240412)
gen_bkg_noise(n = 50, num_dims = 3, mean = 5, sd = 2)
#> [,1] [,2] [,3]
#> [1,] 7.635531 10.037518 1.292495
#> [2,] 3.715683 5.483040 7.456922
#> [3,] 2.415887 7.175448 5.392385
#> [4,] 7.569624 3.788400 4.513048
#> [5,] 5.755002 7.298743 10.601484
#> [6,] 4.691712 4.376551 2.787309
#> [7,] 1.935748 5.351451 6.788723
#> [8,] 5.781366 2.118594 6.608606
#> [9,] 4.071065 2.998375 4.881167
#> [10,] 10.958479 4.780378 5.959907
#> [11,] 5.724177 5.462357 2.943693
#> [12,] 4.956438 6.080202 6.750636
#> [13,] 5.507636 5.374392 2.562168
#> [14,] 4.855293 4.282226 5.279027
#> [15,] 3.980759 2.482610 3.342656
#> [16,] 5.760223 6.003400 5.325136
#> [17,] 4.376727 8.140154 6.354585
#> [18,] 5.681875 6.139086 7.107791
#> [19,] 5.815919 6.616105 7.024455
#> [20,] 6.960276 6.320212 8.371258
#> [21,] 7.675015 4.006200 4.887007
#> [22,] 3.005959 4.303653 2.737309
#> [23,] 4.697547 6.658578 4.123089
#> [24,] 2.344723 5.581362 8.613646
#> [25,] 5.695303 7.340288 5.139200
#> [26,] 5.744492 2.461405 4.926796
#> [27,] 5.220763 5.547385 5.350338
#> [28,] 5.271393 5.160677 7.293827
#> [29,] 3.242984 7.635102 2.667537
#> [30,] 7.509159 5.929393 4.273409
#> [31,] 4.608606 6.609514 1.566371
#> [32,] 3.209056 2.180772 6.178835
#> [33,] 5.725237 5.165021 4.623872
#> [34,] 6.335796 5.656328 7.121541
#> [35,] 5.541793 5.284546 3.879901
#> [36,] 4.150795 3.361770 9.522660
#> [37,] 4.566437 3.853464 8.282124
#> [38,] 7.000616 4.294237 4.797790
#> [39,] 6.093445 8.901827 6.905468
#> [40,] 3.246655 8.315616 7.166919
#> [41,] 3.738327 3.308575 2.781573
#> [42,] 2.500154 3.215103 2.874195
#> [43,] 8.812362 7.008436 3.795285
#> [44,] 7.534683 4.155437 5.174475
#> [45,] 2.466038 3.223680 3.174031
#> [46,] 6.614562 3.962873 -0.761985
#> [47,] 4.644544 4.439052 4.704260
#> [48,] 7.197077 2.669747 3.499666
#> [49,] 5.659864 3.934118 4.061197
#> [50,] 6.411732 7.543840 8.805822