Documentation

Linglib.Core.CausalBayesNet

Causal Bayes Net #

@cite{grusdt-lassiter-franke-2022}

Two-node causal Bayesian network infrastructure: directed causal structure over two binary variables, noisy-OR parameterization, and probability distributions with conditional probability, independence, and correlation.

Causal relations between two binary variables A and C. Used by @cite{grusdt-lassiter-franke-2022} for conditional semantics.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.

      Noisy-OR parameterization for a causal link.

      • background (b): P(C | ¬A) — background rate
      • power (Δ): P(C | A) - P(C | ¬A) — causal power
      • background :

        Background rate: P(C | ¬A)

      • power :

        Causal power: P(C | A) - P(C | ¬A)

      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            Instances For

              P(C | A) in the Noisy-OR model.

              Equations
              Instances For

                P(C | ¬A) in the Noisy-OR model.

                Equations
                Instances For

                  Check if parameters are valid.

                  Equations
                  Instances For

                    Deterministic cause: P(C|A) = 1, P(C|¬A) = 0.

                    Equations
                    Instances For

                      No effect: P(C|A) = P(C|¬A) = 0.

                      Equations
                      Instances For

                        Always-on: P(C|A) = P(C|¬A) = 1.

                        Equations
                        Instances For

                          A probability distribution over two binary variables A and C.

                          Used by @cite{grusdt-lassiter-franke-2022}: a "world" is a probability distribution because conditionals make claims about probabilities (P(C|A) > θ).

                          • pA :

                            Marginal probability P(A)

                          • pC :

                            Marginal probability P(C)

                          • pAC :

                            Joint probability P(A ∧ C)

                          Instances For
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Equations
                                Instances For

                                  Check if a WorldState represents a valid probability distribution.

                                  Equations
                                  Instances For

                                    P(A ∧ ¬C)

                                    Equations
                                    Instances For

                                      P(¬A ∧ C)

                                      Equations
                                      Instances For

                                        P(¬A ∧ ¬C)

                                        Equations
                                        Instances For

                                          P(¬A)

                                          Equations
                                          Instances For

                                            P(¬C)

                                            Equations
                                            Instances For

                                              P(C | A), or 0 if P(A) = 0.

                                              Equations
                                              Instances For

                                                P(C | ¬A), or 0 if P(¬A) = 0.

                                                Equations
                                                Instances For

                                                  P(A | C), or 0 if P(C) = 0.

                                                  Equations
                                                  Instances For

                                                    P(A | ¬C), or 0 if P(¬C) = 0.

                                                    Equations
                                                    Instances For

                                                      P(A ∧ C) = P(A) · P(C).

                                                      Equations
                                                      Instances For

                                                        P(A ∧ C) > P(A) · P(C).

                                                        Equations
                                                        Instances For

                                                          P(A ∧ C) < P(A) · P(C).

                                                          Equations
                                                          Instances For

                                                            WorldState from marginals assuming independence.

                                                            Equations
                                                            Instances For

                                                              WorldState with perfect correlation (A ↔ C).

                                                              Equations
                                                              Instances For

                                                                WorldState where A ∧ C never happens.

                                                                Equations
                                                                Instances For

                                                                  Propositional version of isValid for theorem proving.

                                                                  Equations
                                                                  Instances For

                                                                    Validity implies 0 ≤ P(C|A) ≤ 1.

                                                                    Validity implies 0 ≤ P(C|¬A) ≤ 1.

                                                                    theorem Core.CausalBayesNet.WorldState.law_of_total_probability (w : WorldState) (_h : w.IsValid) (hA_pos : 0 < w.pA) (hA_lt_one : w.pA < 1) :
                                                                    w.pC = w.pCGivenA * w.pA + w.pCGivenNotA * (1 - w.pA)

                                                                    Law of Total Probability: P(C) = P(C|A)·P(A) + P(C|¬A)·P(¬A).

                                                                    theorem Core.CausalBayesNet.WorldState.bayes_theorem (w : WorldState) (hA : 0 < w.pA) (hC : 0 < w.pC) :

                                                                    Bayes' Theorem: P(A|C) = P(C|A)·P(A) / P(C).