Class EdgeStrengthResult
- All Implemented Interfaces:
TetradSerializable, Serializable
NNEstimator.computeEdgeStrength(String, String, int).
Edge strength here is the intervention strength of Janzing et
al. (2013), as implemented in DoWhy's arrow_strength: the child's
fitted mechanism is held fixed, and for each observed parent configuration
the child is drawn many times with the configuration as is and many times
again with the parent's input replaced by an independent draw from that
parent's marginal. The difference between the two conditional distributions
is measured and averaged over configurations. Nothing is retrained.
Because the mechanism is not refit, a parent that is redundant with
another parent still registers as strong if the mechanism actually uses
it. That is the intended contrast with
NNEstimator.computePartialEdgeStrength(String, String, int), which asks whether the
parent adds held-out predictive information beyond the other parents.
Each measure is the mean over numRepeats independent passes,
with the standard deviation across passes reported alongside. A
refit-noise null (nullMmd2) gives the MMD² that training
randomness alone produces for this child; isAboveNoise() compares
the edge to it.
Three measures are reported:
- MMD² — mean over configurations of the Maximum Mean Discrepancy between the two sets of conditional draws, with a continuous child standardized by its observed standard deviation so values are comparable across children. Higher = stronger edge.
- Variance difference (continuous) — mean over configurations of
var(Y | pa, X randomized) − var(Y | pa). DoWhy's default for
continuous targets. Reported both raw (
varianceDiff) and divided by the child's observed variance (varianceDiffFrac). - KL divergence (discrete) — mean over configurations and randomized draws of KL(P(Y | pa) ‖ P(Y | pa, X randomized)) in bits. DoWhy's default for categorical targets.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringName of the child variable (head of the edge).final booleantrueif the child variable is discrete.final intNumber of draws of the child per configuration, for each of the two conditions.final doubleMean over configurations and randomized draws of KL(P(Y | pa) ‖ P(Y | pa, X randomized)) in bits.final doubleStandard deviation ofklDivBitsacross repeats; NaN if one repeat or continuous.final doubleMean over parent configurations of MMD² between draws of the child with the configuration fixed and draws with the parent's input randomized.final doubleStandard deviation ofmmd2across repeats; NaN if one repeat.final doubleRefit-noise null: mean over refits of the same conditional MMD² between the child's original mechanism and a refit with the same parents under a new seed.final doubleStandard deviation ofnullMmd2across refits; NaN if fewer than two.final intNumber of refits the null is based on; 0 if skipped.final intNumber of independent repeats the means and SDs are taken over.final StringName of the parent variable (tail of the edge).final intNumber of observed parent configurations the measures were averaged over, per repeat.final doubleMean over parent configurations of var(Y | pa, X randomized) − var(Y | pa), in the child's units squared.final doublevarianceDiffdivided by the child's observed marginal variance, so it is comparable across children.final doubleStandard deviation ofvarianceDiffFracacross repeats; NaN if one repeat or discrete. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the edge's MMD² clears the refit-noise band: the null mean plus two null standard deviations (or just the null mean if only one refit was run).toString()One-line summary suitable for a status bar.
-
Field Details
-
parentName
Name of the parent variable (tail of the edge). -
childName
Name of the child variable (head of the edge). -
discreteChild
public final boolean discreteChildtrueif the child variable is discrete. -
mmd2
public final double mmd2Mean over parent configurations of MMD² between draws of the child with the configuration fixed and draws with the parent's input randomized. Continuous children are standardized by their observed SD first. Higher = stronger edge. -
mmd2Sd
public final double mmd2SdStandard deviation ofmmd2across repeats; NaN if one repeat. -
varianceDiff
public final double varianceDiffMean over parent configurations of var(Y | pa, X randomized) − var(Y | pa), in the child's units squared. NaN for discrete children. -
varianceDiffFrac
public final double varianceDiffFracvarianceDiffdivided by the child's observed marginal variance, so it is comparable across children. NaN for discrete children. -
varianceDiffFracSd
public final double varianceDiffFracSdStandard deviation ofvarianceDiffFracacross repeats; NaN if one repeat or discrete. -
klDivBits
public final double klDivBitsMean over configurations and randomized draws of KL(P(Y | pa) ‖ P(Y | pa, X randomized)) in bits. NaN for continuous children. -
klDivBitsSd
public final double klDivBitsSdStandard deviation ofklDivBitsacross repeats; NaN if one repeat or continuous. -
simulatedN
public final int simulatedNNumber of observed parent configurations the measures were averaged over, per repeat. -
drawsPerConfig
public final int drawsPerConfigNumber of draws of the child per configuration, for each of the two conditions. -
numRepeats
public final int numRepeatsNumber of independent repeats the means and SDs are taken over. -
nullMmd2
public final double nullMmd2Refit-noise null: mean over refits of the same conditional MMD² between the child's original mechanism and a refit with the same parents under a new seed. This is the MMD² that training randomness alone produces. Shared by all edges into this child. NaN if no refits were run. -
nullMmd2Sd
public final double nullMmd2SdStandard deviation ofnullMmd2across refits; NaN if fewer than two. -
nullRefits
public final int nullRefitsNumber of refits the null is based on; 0 if skipped.
-
-
Method Details
-
isAboveNoise
public boolean isAboveNoise()Whether the edge's MMD² clears the refit-noise band: the null mean plus two null standard deviations (or just the null mean if only one refit was run). If no null was computed this returnstrue, because there is nothing to compare against, not because the edge is strong.- Returns:
- true if the intervention MMD² is above the refit-noise band
-
toSummaryLine
One-line summary suitable for a status bar.- Returns:
- a formatted summary line
-
toString
-