pub enum CausalMechanism {
Linear {
coefficient: f64,
},
Threshold {
cutoff: f64,
},
Polynomial {
coefficients: Vec<f64>,
},
Logistic {
scale: f64,
midpoint: f64,
},
}Expand description
Causal mechanism defining how a parent influences a child.
Variants§
Linear
Linear: child += coefficient * parent
Threshold
Threshold: child = 1 if parent > cutoff else 0
Polynomial
Polynomial: child += sum(coeff[i] * parent^i)
Logistic
Logistic: child += 1 / (1 + exp(-scale * (parent - midpoint)))
Implementations§
Trait Implementations§
Source§impl Clone for CausalMechanism
impl Clone for CausalMechanism
Source§fn clone(&self) -> CausalMechanism
fn clone(&self) -> CausalMechanism
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CausalMechanism
impl Debug for CausalMechanism
Source§impl<'de> Deserialize<'de> for CausalMechanism
impl<'de> Deserialize<'de> for CausalMechanism
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
Auto Trait Implementations§
impl Freeze for CausalMechanism
impl RefUnwindSafe for CausalMechanism
impl Send for CausalMechanism
impl Sync for CausalMechanism
impl Unpin for CausalMechanism
impl UnwindSafe for CausalMechanism
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