Class EdgeStrengthResult

java.lang.Object
edu.cmu.tetrad.sem.EdgeStrengthResult
All Implemented Interfaces:
TetradSerializable, Serializable

public final class EdgeStrengthResult extends Object implements TetradSerializable
Result of a single edge-strength computation performed by 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

    Fields
    Modifier and Type
    Field
    Description
    final String
    Name of the child variable (head of the edge).
    final boolean
    true if the child variable is discrete.
    final int
    Number of draws of the child per configuration, for each of the two conditions.
    final double
    Mean over configurations and randomized draws of KL(P(Y | pa) ‖ P(Y | pa, X randomized)) in bits.
    final double
    Standard deviation of klDivBits across repeats; NaN if one repeat or continuous.
    final double
    Mean over parent configurations of MMD² between draws of the child with the configuration fixed and draws with the parent's input randomized.
    final double
    Standard deviation of mmd2 across repeats; NaN if one repeat.
    final double
    Refit-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 double
    Standard deviation of nullMmd2 across refits; NaN if fewer than two.
    final int
    Number of refits the null is based on; 0 if skipped.
    final int
    Number of independent repeats the means and SDs are taken over.
    final String
    Name of the parent variable (tail of the edge).
    final int
    Number of observed parent configurations the measures were averaged over, per repeat.
    final double
    Mean over parent configurations of var(Y | pa, X randomized) − var(Y | pa), in the child's units squared.
    final double
    varianceDiff divided by the child's observed marginal variance, so it is comparable across children.
    final double
    Standard deviation of varianceDiffFrac across repeats; NaN if one repeat or discrete.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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).
     
    One-line summary suitable for a status bar.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • parentName

      public final String parentName
      Name of the parent variable (tail of the edge).
    • childName

      public final String childName
      Name of the child variable (head of the edge).
    • discreteChild

      public final boolean discreteChild
      true if the child variable is discrete.
    • mmd2

      public final double mmd2
      Mean 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 mmd2Sd
      Standard deviation of mmd2 across repeats; NaN if one repeat.
    • varianceDiff

      public final double varianceDiff
      Mean 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 varianceDiffFrac
      varianceDiff divided by the child's observed marginal variance, so it is comparable across children. NaN for discrete children.
    • varianceDiffFracSd

      public final double varianceDiffFracSd
      Standard deviation of varianceDiffFrac across repeats; NaN if one repeat or discrete.
    • klDivBits

      public final double klDivBits
      Mean 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 klDivBitsSd
      Standard deviation of klDivBits across repeats; NaN if one repeat or continuous.
    • simulatedN

      public final int simulatedN
      Number of observed parent configurations the measures were averaged over, per repeat.
    • drawsPerConfig

      public final int drawsPerConfig
      Number of draws of the child per configuration, for each of the two conditions.
    • numRepeats

      public final int numRepeats
      Number of independent repeats the means and SDs are taken over.
    • nullMmd2

      public final double nullMmd2
      Refit-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 nullMmd2Sd
      Standard deviation of nullMmd2 across refits; NaN if fewer than two.
    • nullRefits

      public final int nullRefits
      Number 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 returns true, 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

      public String toSummaryLine()
      One-line summary suitable for a status bar.
      Returns:
      a formatted summary line
    • toString

      public String toString()
      Overrides:
      toString in class Object