Function factory to apply white noise to a vector proportional to the spread of the data

adaptive_noise(sd.ratio = 1/10)

Arguments

sd.ratio

the level of noise to apply relative to the vectors standard deviation.

Value

a function

Examples


f <- adaptive_noise(0.2)
f(1:10)
#>  [1] 0.6647184 2.3808675 4.2504347 3.0123869 5.3102899 4.8718905 6.6839057
#>  [8] 7.9681480 9.3288006 9.4465002