Documentation

Linglib.Core.Causal.BayesNet

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
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      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
          def Core.Causal.BayesNet.instDecidableEqNoisyOR.decEq (x✝ x✝¹ : NoisyOR) :
          Decidable (x✝ = x✝¹)
          Equations
          • One or more equations did not get rendered due to their size.
          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
                            def Core.Causal.BayesNet.instDecidableEqWorldState.decEq (x✝ x✝¹ : WorldState) :
                            Decidable (x✝ = x✝¹)
                            Equations
                            • One or more equations did not get rendered due to their size.
                            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

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

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

                                                              theorem Core.Causal.BayesNet.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.Causal.BayesNet.WorldState.bayes_theorem (w : WorldState) (hA : 0 < w.pA) (hC : 0 < w.pC) :
                                                              w.pAGivenC = w.pCGivenA * w.pA / w.pC

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