Documentation

CslibFrontier.GameTheory.PredictionMarket.BayesianNetworkMarket

Bayesian-Network-Structured Compact Prediction Markets #

This module formalizes Bayesian-network-structured compact prediction markets and their operational completeness for constant-absolute-risk-aversion (CARA) traders from [PennockSami2007, §26.3, p. 658; §26.3.2, pp. 661–662] (based on Pennock & Wellman 2000, 2005).

Mathematical Overview #

Over m binary base events X_0, …, X_{m-1} (state space BNState m := Fin m → Bool, of size 2 ^ m), any complete Arrow–Debreu market must contain at least 2 ^ m securities (complete_market_card_ge, [PennockSami2007, §26.3, p. 658]).

Given a directed acyclic graph G : BayesNetDAG m in topological order (∀ j ∈ G.parents k, j < k), a conditional probability table cpt : BNCPT G defines the factorized joint probability cpt.jointProb ω = ∏ k, Pr(X_k = ω k | pa(X_k) = ω|_{pa(k)}), which always sums to 1 (BNCPT.sum_jointProb_eq_one) and recovers each table entry upon conditioning (BNCPT.sum_jointProb_event_eq).

Restricting trading to the BN-structured conditional securities S_{X_k | pa(X_k) = d} uses ∑ k, 2 ^ (G.parents k).card ≤ m * 2 ^ D securities (where D = max_k |pa(X_k)|), and the moralized family-clique securities S_{X_k = b, pa(X_k) = d} use 2 * ∑ k, 2 ^ (G.parents k).card securities (card_bnCondSecurity, card_bnFamilySecurity, [PennockSami2007, §26.3.2, p. 662]).

For any finite nonempty collection of CARA traders (u_i(w) = -exp(-w / τ_i) with risk tolerances τ_i > 0), the complete-market Arrow–Debreu equilibrium has state prices equal to the normalized weighted geometric mean (caraEqStatePrice), achieves exact budget balance and market clearing, is strictly optimal for every trader (proved directly via 1 + x ≤ exp x), and is Pareto optimal (caraEqAllocation_paretoOptimal). When all traders' strictly positive beliefs factorize over G:

Main definitions #

Main results #

References #

@[reducible, inline]

State space {0, 1}^m generated by m binary base events [PennockSami2007, §26.3, p. 658].

theorem Cslib.GameTheory.PredictionMarket.complete_market_card_ge {m : ℕ} {I : Type u_1} [Fintype I] {payoff : I → BNState m → ℝ} (hspan : Submodule.span ℝ (Set.range payoff) = ⊤) :

Complete market size lower bound [PennockSami2007, §26.3, p. 658]: any finite family of securities on BNState m whose payoff vectors span BNState m → ℝ has cardinality at least 2 ^ m.

A Bayesian network directed acyclic graph on m binary base events in topological order: every parent of k has strictly smaller index j < k [PennockSami2007, §26.3.2, p. 662].

  • parents : Fin m → Finset (Fin m)

    Parent set pa(X_k) of base event k.

  • acyclic (k j : Fin m) : j ∈ self.parents k → j < k

    Topological acyclicity: every parent of k has index < k.

A Bayesian network DAG is moral if every two distinct parents of any node are joined by a directed edge (automatically satisfied by trees, forests, and Markov chains with |pa(k)| ≤ 1).

Every DAG with in-degree at most 1 (tree, forest, or Markov chain) is moral.

@[reducible, inline]

Assignment of truth values to the parent events pa(X_k) of node k.

Restriction of a full state ω : BNState m to the parents of node k.

Conditional probability table (CPT) on a Bayesian network DAG G: prob k d is the conditional probability Pr(X_k = true | pa(X_k) = d) [PennockSami2007, §26.3.2, p. 662].

  • prob (k : Fin m) : ParentConfig G k → ℝ

    Conditional probability Pr(X_k = true | pa(X_k) = d).

theorem Cslib.GameTheory.PredictionMarket.BNCPT.ext {m : ℕ} {G : BayesNetDAG m} {x y : BNCPT G} (prob : x.prob = y.prob) :
x = y

A CPT is valid if every conditional probability lies in [0, 1].

A CPT is strictly positive if every conditional probability lies strictly in (0, 1).

Single-node conditional factor Pr(X_k = ω k | pa(X_k) = ω|_{pa(k)}).

Factorized joint probability Pr(ω) = ∏ k, Pr(X_k = ω k | pa(X_k) = ω|_{pa(k)}) [PennockSami2007, §26.3.2, p. 662].

theorem Cslib.GameTheory.PredictionMarket.BNCPT.factorProb_nonneg {m : ℕ} {G : BayesNetDAG m} {cpt : BNCPT G} (h : cpt.IsValid) (k : Fin m) (ω : BNState m) :
0 ≤ cpt.factorProb k ω
theorem Cslib.GameTheory.PredictionMarket.BNCPT.factorProb_pos {m : ℕ} {G : BayesNetDAG m} {cpt : BNCPT G} (h : cpt.IsPos) (k : Fin m) (ω : BNState m) :
0 < cpt.factorProb k ω
theorem Cslib.GameTheory.PredictionMarket.BNCPT.jointProb_pos {m : ℕ} {G : BayesNetDAG m} {cpt : BNCPT G} (h : cpt.IsPos) (ω : BNState m) :
0 < cpt.jointProb ω

Normalization of Bayesian-network joint distributions [PennockSami2007, §26.3.2, p. 662]: the factorized product ∏ k, Pr(X_k | pa(X_k)) sums to 1 over all 2 ^ m states.

Every valid CPT defines a probability distribution in probSimplex (BNState m).

Every strictly positive CPT defines a strictly positive distribution in openProbSimplex (BNState m).

theorem Cslib.GameTheory.PredictionMarket.BNCPT.sum_jointProb_event_eq {m : ℕ} {G : BayesNetDAG m} (cpt : BNCPT G) (k : Fin m) (d : ParentConfig G k) :
∑ ω : BNState m with restrictParents G k ω = d ∧ ω k = true, cpt.jointProb ω = cpt.prob k d * ∑ ω : BNState m with restrictParents G k ω = d, cpt.jointProb ω

CPT conditional-probability consistency [PennockSami2007, §26.3.2, p. 662]: for every node k and parent configuration d, the joint probability of (X_k = true ∧ pa(X_k) = d) equals cpt.prob k d times the marginal probability of (pa(X_k) = d).

Compact BN-Structured Conditional and Family-Clique Securities (§26.3.2, p. 662) #

@[reducible, inline]

Index type of BN-structured conditional securities S_{X_k | pa(X_k) = d} [PennockSami2007, §26.3.2, p. 662].

@[reducible, inline]

Index type of moralized family-clique indicator securities S_{X_k = b, pa(X_k) = d} [PennockSami2007, §26.3.2, p. 662].

Exact number of BN-structured conditional securities: ∑ k, 2 ^ |pa(X_k)| [PennockSami2007, §26.3.2, p. 662].

Exponential compression bound for BN-structured markets [PennockSami2007, §26.3.2, p. 662]: if every node has at most D parents, the BN-structured market contains at most m * 2 ^ D conditional securities.

Exact number of moralized family-clique securities: 2 * ∑ k, 2 ^ |pa(X_k)| ≤ 2 * m * 2 ^ D [PennockSami2007, §26.3.2, p. 662].

Payoff vector of conditional security S_{X_k | pa(X_k) = d} traded at unit price price c: pays 1 - price c when pa(X_k) = d ∧ X_k = true, -price c when pa(X_k) = d ∧ X_k = false, and 0 (cancelled and refunded) when pa(X_k) ≠ d [PennockSami2007, §26.3.1–§26.3.2].

Payoff indicator vector of family-clique security S_{X_k = b, pa(X_k) = d}: pays $1 iff pa(X_k) = d and X_k = b, and $0 otherwise.

Payoff subspace spanned by risk-free cash {1} and the BN-structured conditional securities {S_{X_k | pa(X_k) = d}} at price vector price.

Payoff subspace spanned by risk-free cash {1} and the moralized family-clique securities {S_{X_k = b, pa(X_k) = d}} (for m > 0, {1} is already spanned by the family indicators).

For 0 < m, constant risk-free cash already lies in the span of bnFamilyIndicator G alone.

For any moral Bayesian network DAG G (including all trees, forests, and Markov chains), every family-clique indicator lies in the linear span of risk-free cash plus the pure conditional securities S_{X_k | pa(X_k) = d} at any price vector price.

CARA Arrow–Debreu Equilibrium and Operational Completeness (§26.3.2, p. 662) #

Negative exponential (Constant Absolute Risk Aversion, CARA) utility u_τ(w) = -exp(-w / τ) with risk tolerance τ > 0 [PennockSami2007, §26.3.2, p. 662].

noncomputable def Cslib.GameTheory.PredictionMarket.caraExpectedUtility {Ω : Type u_1} [Fintype Ω] (P : Ω → ℝ) (τ : ℝ) (w : Ω → ℝ) :

Expected CARA utility of state-contingent wealth allocation w : Ω → ℝ under belief P.

def Cslib.GameTheory.PredictionMarket.IsCARAParetoOptimal {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] (P : ι → Ω → ℝ) (τ w₀ : ι → ℝ) (w : ι → Ω → ℝ) :

Pareto optimality of a feasible wealth allocation w : ι → Ω → ℝ with aggregate endowment ∑ i, w₀ i across states [PennockSami2007, §26.3.2, p. 662].

noncomputable def Cslib.GameTheory.PredictionMarket.caraEqStatePrice {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] (P : ι → Ω → ℝ) (τ : ι → ℝ) (ω : Ω) :

Complete-market CARA Arrow–Debreu equilibrium state prices: the normalized risk-tolerance-weighted geometric mean π(ω) ∝ ∏ i, P_i(ω)^{τ_i / ∑_j τ_j}.

noncomputable def Cslib.GameTheory.PredictionMarket.caraEqAllocation {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] (P : ι → Ω → ℝ) (τ w₀ : ι → ℝ) (i : ι) (ω : Ω) :

Complete-market CARA Arrow–Debreu equilibrium allocation for trader i.

@[simp]
theorem Cslib.GameTheory.PredictionMarket.caraExpectedUtility_apply {Ω : Type u_1} [Fintype Ω] (P : Ω → ℝ) (τ : ℝ) (w : Ω → ℝ) :
caraExpectedUtility P τ w = ∑ ω : Ω, P ω * caraUtility τ (w ω)
theorem Cslib.GameTheory.PredictionMarket.caraEqStatePrice_mem_openProbSimplex {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] [Nonempty Ω] {P : ι → Ω → ℝ} (hP : ∀ (i : ι) (ω : Ω), 0 < P i ω) (τ : ι → ℝ) :

Equilibrium CARA state prices lie in openProbSimplex Ω.

theorem Cslib.GameTheory.PredictionMarket.caraEqAllocation_budget {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] [Nonempty Ω] {P : ι → Ω → ℝ} (hP : ∀ (i : ι) (ω : Ω), 0 < P i ω) (τ w₀ : ι → ℝ) (i : ι) :
∑ ω : Ω, caraEqStatePrice P τ ω * caraEqAllocation P τ w₀ i ω = w₀ i

Every trader's CARA equilibrium allocation satisfies exact budget balance under π.

theorem Cslib.GameTheory.PredictionMarket.caraEqAllocation_clearing {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] [Nonempty Ω] [Nonempty ι] {P : ι → Ω → ℝ} (hP : ∀ (i : ι) (ω : Ω), 0 < P i ω) {τ : ι → ℝ} (hτ : ∀ (i : ι), 0 < τ i) (w₀ : ι → ℝ) (ω : Ω) :
∑ i : ι, caraEqAllocation P τ w₀ i ω = ∑ i : ι, w₀ i

Market clearing for CARA equilibrium allocations: aggregate wealth across all traders equals aggregate initial wealth in every state ω.

theorem Cslib.GameTheory.PredictionMarket.caraEqAllocation_optimal {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] [Nonempty Ω] {P : ι → Ω → ℝ} (hP : ∀ (i : ι) (ω : Ω), 0 < P i ω) {τ : ι → ℝ} (hτ : ∀ (i : ι), 0 < τ i) (w₀ : ι → ℝ) (i : ι) {w : Ω → ℝ} (hbud : ∑ ω : Ω, caraEqStatePrice P τ ω * w ω ≤ w₀ i) :
caraExpectedUtility (P i) (τ i) w ≤ caraExpectedUtility (P i) (τ i) (caraEqAllocation P τ w₀ i) ∧ (w ≠ caraEqAllocation P τ w₀ i → caraExpectedUtility (P i) (τ i) w < caraExpectedUtility (P i) (τ i) (caraEqAllocation P τ w₀ i))

Strict individual optimality of CARA equilibrium allocations: at state prices π, every budget-feasible wealth profile w yields expected CARA utility at most that of caraEqAllocation, with strict inequality whenever w ≠ caraEqAllocation P τ w₀ i.

theorem Cslib.GameTheory.PredictionMarket.caraEqAllocation_paretoOptimal {Ω : Type u_1} {ι : Type u_2} [Fintype Ω] [Fintype ι] [Nonempty Ω] [Nonempty ι] {P : ι → Ω → ℝ} (hP : ∀ (i : ι) (ω : Ω), 0 < P i ω) {τ : ι → ℝ} (hτ : ∀ (i : ι), 0 < τ i) (w₀ : ι → ℝ) :

First Welfare Theorem for CARA prediction markets: the complete-market CARA Arrow–Debreu equilibrium allocation is Pareto optimal [PennockSami2007, §26.3.2, p. 662].

Operational Completeness of BN-Structured Markets (§26.3.2, p. 662) #

The log-probability of any strictly positive BN-factorized distribution lies in bnFamilySpan G.

theorem Cslib.GameTheory.PredictionMarket.cara_bnFamily_operationallyComplete {ι : Type u_2} [Fintype ι] {m : ℕ} {G : BayesNetDAG m} [Nonempty ι] {cpts : ι → BNCPT G} (hpos : ∀ (i : ι), (cpts i).IsPos) {τ : ι → ℝ} (hτ : ∀ (i : ι), 0 < τ i) (w₀ : ι → ℝ) :
IsCARAParetoOptimal (fun (i : ι) => (cpts i).jointProb) τ w₀ (caraEqAllocation (fun (i : ι) => (cpts i).jointProb) τ w₀) ∧ ∀ (i : ι), caraEqAllocation (fun (i : ι) => (cpts i).jointProb) τ w₀ i ∈ bnFamilySpan G

Operational completeness of Markov / family-clique BN markets for CARA traders [PennockSami2007, §26.3.2, p. 662]: if all CARA traders' strictly positive beliefs factorize over the same Bayesian network DAG G, then every trader's Pareto-optimal complete-market equilibrium allocation lies in the compact O(m · 2 ^ max |pa|) family-clique span bnFamilySpan G (and is Pareto optimal).

theorem Cslib.GameTheory.PredictionMarket.cara_bnCond_operationallyComplete_of_isMoral {ι : Type u_2} [Fintype ι] {m : ℕ} {G : BayesNetDAG m} (hmoral : G.IsMoral) [Nonempty ι] {cpts : ι → BNCPT G} (hpos : ∀ (i : ι), (cpts i).IsPos) {τ : ι → ℝ} (hτ : ∀ (i : ι), 0 < τ i) (w₀ : ι → ℝ) (price : BNCondSecurity G → ℝ) :
IsCARAParetoOptimal (fun (i : ι) => (cpts i).jointProb) τ w₀ (caraEqAllocation (fun (i : ι) => (cpts i).jointProb) τ w₀) ∧ ∀ (i : ι), caraEqAllocation (fun (i : ι) => (cpts i).jointProb) τ w₀ i ∈ bnCondSpan G price

Operational completeness of pure conditional BN markets on moral DAGs [PennockSami2007, §26.3.2, p. 662]: whenever G is moral (including all trees, forests, and Markov chains), every CARA trader's Pareto-optimal complete-market equilibrium allocation lies in the span of risk-free cash plus the ∑ k, 2 ^ |pa(k)| conditional securities S_{X_k | pa(X_k) = d} at any price vector price.

Sharpness: 3-Node Collider Counterexample #

The 3-node collider DAG X_0 → X_2 ← X_1: pa(0) = ∅, pa(1) = ∅, pa(2) = {0, 1}.

Sharpness of moralization (indicator form): on the non-moral collider X_0 → X_2 ← X_1, the parent-interaction indicator 1_{X_0 ∧ X_1} does not lie in bnCondSpan colliderDAG price for any price vector price.

theorem Cslib.GameTheory.PredictionMarket.collider_caraEq_notMem_bnCondSpan :
∃ (cpts : Fin 3 → BNCPT colliderDAG), (∀ (i : Fin 3), (cpts i).IsPos) ∧ ∀ (price : BNCondSecurity colliderDAG → ℝ), caraEqAllocation (fun (i : Fin 3) => (cpts i).jointProb) (fun (x : Fin 3) => 1) (fun (x : Fin 3) => 0) 1 ∉ bnCondSpan colliderDAG price

Sharpness of moralization (3-trader CARA equilibrium form): on the collider X_0 → X_2 ← X_1, there exist 3 strictly positive BN CPTs (with unit risk tolerances τ = 1) whose Pareto-optimal CARA Arrow–Debreu equilibrium allocation for trader 1 is not spanned by risk-free cash plus the 6 conditional securities S_{X_k | pa(X_k) = d} at any price vector.