wobble: Add random noise to remove ties

View source: R/wobble.R

wobbleR Documentation

Add random noise to remove ties

Description

wobble adds noise from a continuous uniform distribution to the observations to remove ties.

Usage

wobble(x, y, check = TRUE)

Arguments

x

a (non-empty) numeric vector of data values.

y

a (non-empty) numeric vector of data values.

check

a logical value indicating whether the samples should be checked for bindings prior to adding uniform noise or not, defaults to TRUE.

Details

If check = TRUE the function checks whether all values in the two numeric input vectors are distinct. If so, it returns the original values, otherwise the ties are removed by adding noise from a continuous uniform distribution to all observations. If check = FALSE, it simply determines the number of digits and adds uniform noise.

More precisely, we determine the minimum number of digits d_min in the sample and then add random numbers from the U[-0.5 10^(-d_min), 0.5 10^(-d_min)] distribution to each of the observations.

Value

A named list of length two containing the modified input samples x and y.

References

\insertRef

FriGat07rankrobnptests

Examples

x <- rnorm(20); y <- rnorm(20); x <- round(x)
wobble(x, y)


s-abbas/robTests documentation built on Feb. 20, 2023, 10:14 a.m.