wobble {robnptests} | R 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
|
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
Fried R, Gather U (2007). “On rank tests for shift detection in time series.” Computational Statistics & Data Analysis, 52(1), 221–233. doi:10.1016/j.csda.2006.12.017.
Examples
x <- rnorm(20); y <- rnorm(20); x <- round(x)
wobble(x, y)