add_noise {errorlocate} | R Documentation |
Add (a small amount of) noise
Description
Utility function to add some small positive noise to weights. This is mainly done to randomly choose between solutions of equal weight. Without adding noise to weights lp solvers may return an identical solution over and over while there are multiple solutions of equal weight. The generated noise is positive to prevent that weights will be zero or negative.
Usage
add_noise(x, max_delta = NULL, ...)
Arguments
x |
|
max_delta |
when supplied noise will be drawn from |
... |
currently not used |
Details
When no max_delta
is supplied, add_noise will use the minimum difference
larger than zero divided by the length(x)
.
Value
numeric
vector/matrix with noise applied.
[Package errorlocate version 1.1.1 Index]