Skip to contents

Fits \(Y = f(X) + N\) and \(X = g(Y) + N\) and reports the direction whose residual is independent of its putative cause. Independence is HSIC, not correlation.

Usage

morie_anm_direction(x, y, B = 200L)

Arguments

x, y

Numeric vectors.

B

Permutations for the independence p-values.

Value

Named list with direction, conclusive, hsic_xy, hsic_yx, p_xy, p_yx, n.

Details

Three limits. The asymmetry vanishes for linear-Gaussian data, where both directions admit independent noise, so conclusive reports the tie rather than breaking it. A hidden common cause still yields a named direction, which will be meaningless. And a saturating link defeats the method: measured at 6/6 correct with a cubic link in either orientation but 0/6 with \(\tanh(3y)\), because outside the active range the cause carries almost no information.

Mirrors morie.fn.anmod.

References

Hoyer PO, Janzing D, Mooij JM, Peters J & Scholkopf B (2009). NIPS 21, 689-696.

Examples

set.seed(1)
xv <- runif(150, -2, 2)
morie_anm_direction(xv, xv^3 + rnorm(150, 0, 0.5), B = 49)$direction
#> [1] "X->Y"