Contrast {fake} | R Documentation |
Computes matrix contrast, defined as the number of unique truncated entries with a specified number of digits.
Contrast(mat, digits = 3)
mat |
input matrix. |
digits |
number of digits to use. |
A single number, the contrast of the input matrix.
Bodinier B, Filippi S, Nost TH, Chiquet J, Chadeau-Hyam M (2021). “Automated calibration for stability selection in penalised regression and graphical models: a multi-OMICs network application exploring the molecular response to tobacco smoking.” https://arxiv.org/abs/2106.02521.
# Example 1
mat <- matrix(c(0.1, 0.2, 0.2, 0.2), ncol = 2, byrow = TRUE)
Contrast(mat)
# Example 2
mat <- matrix(c(0.1, 0.2, 0.2, 0.3), ncol = 2, byrow = TRUE)
Contrast(mat)