pub struct ProbabilityInterval {
pub lower: f64,
pub upper: f64,
}Expand description
Probability interval representing imprecise probabilities.
Represents the set [lower, upper] of possible probability values. Follows the theory of imprecise probabilities and credal sets.
Fields§
§lower: f64Lower probability bound (must be in [0, 1])
upper: f64Upper probability bound (must be in [0, 1] and >= lower)
Implementations§
Source§impl ProbabilityInterval
impl ProbabilityInterval
Sourcepub fn new(lower: f64, upper: f64) -> Option<Self>
pub fn new(lower: f64, upper: f64) -> Option<Self>
Create a new probability interval.
Returns None if bounds are invalid (not in [0,1] or lower > upper).
Sourcepub fn is_precise(&self) -> bool
pub fn is_precise(&self) -> bool
Check if this is a precise probability.
Sourcepub fn is_vacuous(&self) -> bool
pub fn is_vacuous(&self) -> bool
Check if the interval is vacuous (completely imprecise).
Sourcepub fn complement(&self) -> Self
pub fn complement(&self) -> Self
Complement: P(¬A) given P(A).
Sourcepub fn and(&self, other: &Self) -> Self
pub fn and(&self, other: &Self) -> Self
Conjunction bounds: P(A ∧ B) given P(A) and P(B).
Uses Fréchet bounds: max(0, P(A) + P(B) - 1) ≤ P(A ∧ B) ≤ min(P(A), P(B))
Sourcepub fn or(&self, other: &Self) -> Self
pub fn or(&self, other: &Self) -> Self
Disjunction bounds: P(A ∨ B) given P(A) and P(B).
Uses Fréchet bounds: max(P(A), P(B)) ≤ P(A ∨ B) ≤ min(1, P(A) + P(B))
Sourcepub fn implies(&self, other: &Self) -> Self
pub fn implies(&self, other: &Self) -> Self
Implication bounds: P(A → B) given P(A) and P(B).
A → B ≡ ¬A ∨ B, so use complement and disjunction.
Sourcepub fn conditional(&self, joint: &Self) -> Option<Self>
pub fn conditional(&self, joint: &Self) -> Option<Self>
Conditional probability bounds: P(B|A) given P(A) and P(A ∧ B).
If P(A) > 0, returns P(A ∧ B) / P(A). Uses interval division: [a,b] / [c,d] = [a/d, b/c] for positive intervals.
Sourcepub fn intersect(&self, other: &Self) -> Option<Self>
pub fn intersect(&self, other: &Self) -> Option<Self>
Intersection of two probability intervals.
Returns None if intervals don’t overlap.
Sourcepub fn convex_combine(&self, other: &Self, weight: f64) -> Option<Self>
pub fn convex_combine(&self, other: &Self, weight: f64) -> Option<Self>
Convex combination of two intervals.
Useful for averaging or mixing probability assessments.
Trait Implementations§
Source§impl Clone for ProbabilityInterval
impl Clone for ProbabilityInterval
Source§fn clone(&self) -> ProbabilityInterval
fn clone(&self) -> ProbabilityInterval
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more