pub trait Inferable: Debug + Identifiable {
// Required methods
fn question(&self) -> DescriptionValue;
fn observation(&self) -> NumericalValue;
fn threshold(&self) -> NumericalValue;
fn effect(&self) -> NumericalValue;
fn target(&self) -> NumericalValue;
// Provided methods
fn conjoint_delta(&self) -> NumericalValue { ... }
fn is_inferable(&self) -> bool { ... }
fn is_inverse_inferable(&self) -> bool { ... }
}Expand description
Trait for inferable types with causal reasoning properties.
Provides properties for:
- question: Text description
- observation: Numerical observation value
- threshold: Minimum observation value
- effect: Expected effect value
- target: Target value to compare effect against
Provides methods for:
- conjoint_delta(): Estimate of unobserved factors
- is_inferable(): Check if inference is valid
- is_inverse_inferable(): Check inverse inference
Requires approximate float equality util function.
Required Methods§
fn question(&self) -> DescriptionValue
fn observation(&self) -> NumericalValue
fn threshold(&self) -> NumericalValue
fn effect(&self) -> NumericalValue
fn target(&self) -> NumericalValue
Provided Methods§
Sourcefn conjoint_delta(&self) -> NumericalValue
fn conjoint_delta(&self) -> NumericalValue
Calculates the conjoint delta for this item.
The conjoint delta estimates the effect of unobserved factors.
It is calculated as:
1.0 - observation
Where:
- observation is the numerical observation value
Finally, the absolute value is taken.
Sourcefn is_inferable(&self) -> bool
fn is_inferable(&self) -> bool
Checks if inference is valid for this item.
Returns true if:
- Observation is greater than threshold
- Effect is approximately equal to target
Uses 4 decimal places for float comparison.
Sourcefn is_inverse_inferable(&self) -> bool
fn is_inverse_inferable(&self) -> bool
Checks if inverse inference is valid for this item.
Returns true if:
- Observation is less than threshold
- Effect is approximately equal to target
Uses 4 decimal places for float comparison.