Learn R Programming

RecordTest (version 2.0.0)

series_untie: Avoid Record Ties

Description

Avoids record ties when observations have been rounded.

Usage

series_untie(X)

Arguments

X

A numeric vector, matrix (or data frame).

Value

A matrix equal to X whose elements have been added a sample from a uniform variable, different for every element.

Details

This function is used in the data preparation (or pre-processing) often required to apply the exploratory and inference tools based on theory of records within this package.

The theory of records on which the hypothesis tests are based assumes that the random variables are continuous, proving that the probability that two observations take the same value is zero. Most of the data collected is rounded, giving a certain probability to the tie between records, thereby reducing the number of new records (see, e.g., Wergen et al. 2012).

This function avoids ties by adding a sample from a uniform random variable to each element of X. The function computes the maximum number of decimal digits (let it be \(n\)) for any element in X. Then the uniform variable is sampled in the interval \((-5 \times 10^{-(n+1)}, 5 \times 10^{-(n+1)})\), so the records in the original (rounded) series will also be in the new series.

References

Wergen G, Volovik D, Redner S, Krug J (2012). <U+201C>Rounding Effects in Record Statistics.<U+201D> Physical Review Letters, 109(16), 164102.

See Also

series_double, series_record, series_rev, series_split, series_ties, series_uncor

Examples

Run this code
# NOT RUN {
set.seed(23)
X <- matrix(round(stats::rnorm(100), digits = 1), nrow = 10, ncol = 10)
series_untie(X)

series_untie(ZaragozaSeries)

# }

Run the code above in your browser using DataLab