Normalized finite distributions #
Real weights make expectations finite sums. Unlike avg, a normalized distribution
cannot exist on an empty type. Uniform expectations retain their old empty-type convention.
@[simp]
theorem
Dynamics.Distribution.expect_const
{α : Type u_1}
[Fintype α]
(p : Distribution α)
(c : ℝ)
:
theorem
Dynamics.Distribution.expect_nonneg
{α : Type u_1}
[Fintype α]
(p : Distribution α)
{f : α → ℝ}
(h : ∀ (a : α), 0 ≤ f a)
:
theorem
Dynamics.Distribution.expect_mono
{α : Type u_1}
[Fintype α]
(p : Distribution α)
{f g : α → ℝ}
(h : ∀ (a : α), f a ≤ g a)
:
theorem
Dynamics.Distribution.prob_nonneg
{α : Type u_1}
[Fintype α]
(p : Distribution α)
(s : α → Prop)
:
theorem
Dynamics.Distribution.prob_le_one
{α : Type u_1}
[Fintype α]
(p : Distribution α)
(s : α → Prop)
:
theorem
Dynamics.Distribution.prob_eq_expect
{α : Type u_1}
[Fintype α]
(p : Distribution α)
(s : α → Prop)
[DecidablePred s]
:
prob computed with any decidability instance for the event.
Uniform distribution, available precisely when the sample type is nonempty.
Equations
- Dynamics.Distribution.uniform α = { weight := fun (x : α) => (↑(Fintype.card α))⁻¹, nonneg := ⋯, sum_one := ⋯ }
Instances For
Point mass.
Equations
Instances For
noncomputable def
Dynamics.Distribution.map
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(p : Distribution α)
(f : α → β)
:
Transport a distribution along a function, summing over its fibers.
Equations
Instances For
noncomputable def
Dynamics.Distribution.independent
{α : Type u_1}
{ι : Type u_3}
[Fintype α]
[Fintype ι]
[DecidableEq ι]
(p : ι → Distribution α)
:
Distribution (ι → α)
Independent product of a finite family of distributions.
Equations
- Dynamics.Distribution.independent p = { weight := fun (x : ι → α) => ∏ i : ι, (p i).weight (x i), nonneg := ⋯, sum_one := ⋯ }
Instances For
theorem
Dynamics.Distribution.independent_expect_prod
{α : Type u_1}
{ι : Type u_3}
[Fintype α]
[Fintype ι]
[DecidableEq ι]
(p : ι → Distribution α)
(f : ι → α → ℝ)
:
theorem
Dynamics.Distribution.independent_expect_eval
{α : Type u_1}
{ι : Type u_3}
[Fintype α]
[Fintype ι]
[DecidableEq ι]
(p : ι → Distribution α)
(i : ι)
(f : α → ℝ)
: