Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

check_comonotonicity

Check If Two Vectors Are Comonotonic


Description

This functions determines if two vectors have a common ordering permutation.

Usage

check_comonotonicity(x, y, incompatible_lengths = NA)

Arguments

x

numeric vector

y

numeric vector

incompatible_lengths

single logical value, value to return iff lengths of x and y differ

Details

Two vectors x, y of equal length n are comonotonic, if and only if there exists a permutation σ such that x_{σ(1)}≤ … ≤ x_{σ(n)} and y_{σ(1)}≤ … ≤ y_{σ(n)}. Thus, σ orders x and y simultaneously. Equivalently, x and y are comonotonic, iff (x_i-x_j)(y_i-y_j)≥ 0 for every i,j.

If there are missing values in x or y, the function returns NA.

Currently, the implemented algorithm has O(n^2) time complexity.

Value

Returns a single logical value.

References

Grabisch M., Marichal J.-L., Mesiar R., Pap E., Aggregation functions, Cambridge University Press, 2009.

Gagolewski M., Data Fusion: Theory, Methods, and Applications, Institute of Computer Science, Polish Academy of Sciences, 2015, 290 pp. isbn:978-83-63159-20-7

See Also


agop

Aggregation Operators and Preordered Sets

v0.2-3
LGPL (>= 3)
Authors
Marek Gagolewski [aut, cre] (<https://orcid.org/0000-0003-0637-6028>), Anna Cena [ctb] (<https://orcid.org/0000-0001-8697-5383>)
Initial release
2020-01-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.