Removes elements of Ω that have zero probability
Equations
- P.filter_zero = { Ω := Finset.filter (fun (ω : τ) => P.p ω ≠ 0) P.Ω, prob := { p := P.prob.p, sumsto := ⋯ } }
Instances For
@[reducible]
Boolean indicator function
Equations
- Finprob.indicator cond = Bool.rec 0 1 cond
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
- 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
- Finprob.«term_ᵣ==_» = Lean.ParserDescr.trailingNode `Finprob.«term_ᵣ==_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ᵣ== ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- Finprob.«term_∧ᵣ_» = Lean.ParserDescr.trailingNode `Finprob.«term_∧ᵣ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∧ᵣ ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- Finprob.«term_∨ᵣ_» = Lean.ParserDescr.trailingNode `Finprob.«term_∨ᵣ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∨ᵣ ") (Lean.ParserDescr.cat `term 51))
Instances For
@[reducible]
noncomputable def
Finprob.expect_cnd_rv
{τ : Type}
{P : Finprob τ}
{ν : Type}
[DecidableEq ν]
{V : Finset ν}
(X : Finrv P ℝ)
(Y : Finrv P { x : ν // x ∈ V })
:
Expectation conditioned on a finite-valued random variable -
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a dirac distribution
Equations
- Finprob.dirac_ofsingleton t = { p := fun (x : τ) => 1, sumsto := ⋯ }
Instances For
def
Finprob.dirac_dist
{τ : Type}
[DecidableEq τ]
(T : Finset τ)
(t : { x : τ // x ∈ T })
:
Findist T
Dirac distribution over T with P[t] = 1
Equations
- Finprob.dirac_dist T t = { p := fun (x : τ) => if x = ↑t then 1 else 0, sumsto := ⋯ }
Instances For
theorem
Finprob.exp_sum_val_cnd_rv
{τ : Type}
{P : Finprob τ}
{ν : Type}
[DecidableEq ν]
{V : Finset ν}
(X : Finrv P ℝ)
(Y : Finrv P { x : ν // x ∈ V })
(ω : τ)
:
Law of the unconscious statistician, conditional random variable
theorem
Finprob.prob_prod_prob
{τ₁ τ₂ : Type}
{T₁ : Finset τ₁}
{T₂ : Finset τ₂}
(f : τ₁ → NNReal)
(g : τ₁ → τ₂ → NNReal)
(h1 : ∑ t₁ ∈ T₁, f t₁ = 1)
(h2 : ∀ t₁ ∈ T₁, ∑ t₂ ∈ T₂, g t₁ t₂ = 1)
:
Product of a probability distribution with a dependent probability distributions is a probability distribution.
def
Finprob.product_dep
{τ₁ τ₂ : Type}
{Ω₁ : Finset τ₁}
(P₁ : Findist Ω₁)
(Ω₂ : Finset τ₂)
(p : τ₁ → τ₂ → NNReal)
(h1 : ∀ ω₁ ∈ Ω₁, ∑ ω₂ ∈ Ω₂, p ω₁ ω₂ = 1)
:
Probability distribution as a product of a probability distribution and a dependent probability distribution.
Equations
- Finprob.product_dep P₁ Ω₂ p h1 = { p := fun (x : τ₁ × τ₂) => match x with | (ω₁, ω₂) => P₁.p ω₁ * p ω₁ ω₂, sumsto := ⋯ }
Instances For
def
Finprob.product_dep_pr
{τ₁ τ₂ : Type}
{Ω₁ : Finset τ₁}
(P₁ : Findist Ω₁)
(Ω₂ : Finset τ₂)
(Q : τ₁ → Findist Ω₂)
:
Constructs a probability space as a product of a probability space and a dependent probability space.
Equations
- Finprob.product_dep_pr P₁ Ω₂ Q = { p := fun (x : τ₁ × τ₂) => match x with | (ω₁, ω₂) => P₁.p ω₁ * (Q ω₁).p ω₂, sumsto := ⋯ }
Instances For
theorem
Finprob.embed_preserve
{τ₁ τ₂ : Type}
(T₁ : Finset τ₁)
(p : τ₁ → NNReal)
(f : τ₁ ↪ τ₂)
(f_linv : τ₂ → τ₁)
(h : Function.LeftInverse f_linv ⇑f)
:
∑ t₂ ∈ Finset.map f T₁, (p ∘ f_linv) t₂ = ∑ t₁ ∈ T₁, p t₁
Embedding preserves a sum
def
Finprob.embed
{τ₁ τ₂ : Type}
{Ω₁ : Finset τ₁}
(P : Findist Ω₁)
(e : τ₁ ↪ τ₂)
(e_linv : τ₂ → τ₁)
(h : Function.LeftInverse e_linv ⇑e)
:
Findist (Finset.map e Ω₁)
Embed the probability in a new space using e. Needs an inverse
Equations
- Finprob.embed P e e_linv h = { p := fun (t₂ : τ₂) => (P.p ∘ e_linv) t₂, sumsto := ⋯ }