pub enum Mechanism {
Linear {
sign: MechanismSign,
slope: f64,
},
Monotonic {
sign: MechanismSign,
},
Threshold {
sign: MechanismSign,
threshold: f64,
},
Saturating {
sign: MechanismSign,
half_max: f64,
},
Unknown,
}Expand description
v0.45: structural causal mechanism on a directed edge.
A Mechanism captures how a parent finding determines a child’s
value, not just that a dependency exists. With mechanisms in place,
the kernel can answer counterfactual (Pearl level 3) queries: “given
that we observed X under parent=p, what would X have been under
parent=p’?” via twin-network construction.
Doctrine: mechanisms are deliberately coarse. Science rarely warrants precise functional forms; what we need is enough algebraic structure to propagate counterfactual perturbations sign-and-magnitude. Five shapes cover the empirical distribution of biology / clinical claims:
Linear { sign, slope }: dY = slope * dX (with sign packing the direction; slope is a unitless effect-size on the [0,1] confidence scale).Monotonic { sign }: dY agrees with sign(dX) but magnitude is ungraded (used when direction is known but effect-size isn’t).Threshold { sign, threshold }: parent must crossthresholdfor any child response (binary above/below).Saturating { sign, half_max }: hyperbolic / Hill-style; large dX abovehalf_maxproduces vanishing dY.Unknown: explicitly annotated as causally connected but mechanism unspecified. Twin-network treats this as opaque (the counterfactual is reported asMechanismUnspecified).
Variants§
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mechanism
impl<'de> Deserialize<'de> for Mechanism
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Mechanism
impl StructuralPartialEq for Mechanism
Auto Trait Implementations§
impl Freeze for Mechanism
impl RefUnwindSafe for Mechanism
impl Send for Mechanism
impl Sync for Mechanism
impl Unpin for Mechanism
impl UnsafeUnpin for Mechanism
impl UnwindSafe for Mechanism
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more