Class PartialEdgeStrengthResult
java.lang.Object
edu.cmu.tetrad.sem.PartialEdgeStrengthResult
- All Implemented Interfaces:
TetradSerializable, Serializable
Result of a partial edge strength computation performed by
NNEstimator.computePartialEdgeStrength(String, String, int).
Partial edge strength asks: once Y's other parents are accounted for,
does X add anything to held-out prediction of Y? It is computed on the
same k folds as NNEstimator.crossValidate(int): on each fold the
full model (all parents) and a reduced model (Y's mechanism retrained on
the fold's training rows without X) both predict the held-out rows, and
the difference in held-out score is reported.
- Continuous child:
partialR2= R²_full − R²_reduced, with R² = 1 − OOS MSE / marginal variance, matching the Cross-Validation table.residualVarianceholds the reduced model's held-out MSE. - Discrete child:
partialXentImprovement= xent_reduced − xent_full in nats.
Positive means X carries information about Y that the other parents do
not. Near zero means X is redundant given the other parents, which is
not the same as X not being a cause; see EdgeStrengthResult for
the complementary intervention measure, which stays large for a redundant
parent the fitted mechanism actually uses.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleSigned average marginal effect of the parent on the child: the average, over all held-out rows across the k folds, of the central finite difference (f(x + h) − f(x − h)) / (2h) of the fold's fitted mechanism with respect to the parent, with the other parents held at their observed values and h = 0.05 · SD(X).final doubleStandardized average marginal effect:avgMarginalEffect· SD(X) / SD(Y), with SDs taken from the observed data.final StringName of the child variable (head of the edge).final booleantrueif the child variable is discrete.final doubleFraction of held-out rows on which the local derivative was strictly positive, among rows with a finite derivative.final intNumber of CV folds used.final StringName of the parent variable (tail of the edge).final doubleHeld-out R² of the full model minus held-out R² of the model with X removed from Y's parents, on the same k folds as the CV table.final doubleOOS cross-entropy improvement of predicting R from X vs.final doubleHeld-out MSE of the reduced model (Y predicted from its other parents, without X). -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue if the fitted effect changed sign on more than 10% of held-out rows (minority side offracPositiveDerivabove 0.10), so the average marginal effect mixes regions of opposite sign.toString()Returns a human-readable one-line summary.
-
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. -
partialR2
public final double partialR2Held-out R² of the full model minus held-out R² of the model with X removed from Y's parents, on the same k folds as the CV table. Positive = X adds predictive information beyond the other parents. NaN for discrete children. -
residualVariance
public final double residualVarianceHeld-out MSE of the reduced model (Y predicted from its other parents, without X). Kept under its original field name for session compatibility. NaN for discrete children. -
partialXentImprovement
public final double partialXentImprovementOOS cross-entropy improvement of predicting R from X vs. predicting the marginal residual distribution. For discrete children only. NaN for continuous children. -
numFolds
public final int numFoldsNumber of CV folds used. -
avgMarginalEffect
public final double avgMarginalEffectSigned average marginal effect of the parent on the child: the average, over all held-out rows across the k folds, of the central finite difference (f(x + h) − f(x − h)) / (2h) of the fold's fitted mechanism with respect to the parent, with the other parents held at their observed values and h = 0.05 · SD(X). Uses each fold's full model on that fold's held-out rows, so it is an out-of-sample quantity on the same folds aspartialR2. On the parent's original scale (child units per parent unit). NaN unless both parent and child are continuous. -
avgMarginalEffectStd
public final double avgMarginalEffectStdStandardized average marginal effect:avgMarginalEffect· SD(X) / SD(Y), with SDs taken from the observed data. Unit-free, so magnitudes are comparable across parents. NaN unless both parent and child are continuous. -
fracPositiveDeriv
public final double fracPositiveDerivFraction of held-out rows on which the local derivative was strictly positive, among rows with a finite derivative. Values near 1 or 0 indicate a monotone fitted effect; intermediate values indicate the effect changes sign over the data range, in which caseavgMarginalEffectis an average of opposing effects and should be read with care. NaN unless both parent and child are continuous.
-
-
Method Details
-
isNonMonotone
public boolean isNonMonotone()True if the fitted effect changed sign on more than 10% of held-out rows (minority side offracPositiveDerivabove 0.10), so the average marginal effect mixes regions of opposite sign.- Returns:
- whether the fitted effect is flagged as non-monotone
-
toSummaryLine
Returns a human-readable one-line summary.- Returns:
- a human-readable one-line summary
-
toString
-