dpi_edges: Apply the Data Processing Inequality to a set of...

View source: R/corto.R

dpi_edgesR Documentation

Apply the Data Processing Inequality to a set of centroid-target edges

Description

Decides which centroid-target edges survive the Data Processing Inequality (DPI). Used by corto() on the original data and in every bootstrap, and usable on its own with any list of correlation edges.

Usage

dpi_edges(
  centroid,
  target,
  cor,
  rule = c("target", "triangle"),
  centroid_cor = NULL
)

Arguments

centroid

Character vector, the centroid (regulator) of each edge

target

Character vector, the target of each edge

cor

Numeric vector, the correlation of each edge

rule

"target" (default, the only rule of corto() up to version 1.3.1): for each target, only the centroid(s) with the highest absolute correlation survive. "triangle": the ARACNe rule; the edge between centroid a and target c is removed only if another centroid b closes a triangle in which a-c is the weakest edge, i.e. if both |cor(b,c)| and |cor(a,b)| are larger than |cor(a,c)|. Centroids that are not correlated with each other keep their edges to a shared target.

centroid_cor

Correlation matrix between centroids, with row and column names; required for rule="triangle". Only absolute values are used.

Value

A logical vector, TRUE for the edges that survive

Examples

# Two centroids correlated with the same target. Under "target" only the
# stronger survives; under "triangle" both survive unless they are more
# correlated with each other than the weaker one is with the target.
cc <- matrix(c(1, 0.1, 0.1, 1), 2, dimnames = list(c("A", "B"), c("A", "B")))
dpi_edges(c("A", "B"), c("g", "g"), c(0.6, 0.4), rule = "target")
dpi_edges(c("A", "B"), c("g", "g"), c(0.6, 0.4), rule = "triangle", centroid_cor = cc)

corto documentation built on Oct. 21, 2026, 5:10 p.m.