Finite uniform-seed distribution ensembles -- definitions #
FiniteEnsemble α allows each parameter slice to use any nonempty finite uniform
seed type. This strictly generalizes fixed-length Boolean seeds and, crucially,
supports exact choices such as a uniform element of Fin m when m is not a
power of two.
The distribution remembers sampler multiplicity: probability is the fraction of seeds whose samples satisfy an event, not the fraction of distinct outputs.
Uniform probability of an event in an arbitrary finite sample space.
Equations
- Complexity.uniformProbability event = ↑event.card / ↑(Fintype.card Ω)
Instances For
Mean of a rational-valued statistic on a finite uniform sample space.
Equations
- Complexity.uniformMean value = (∑ sample : Ω, value sample) / ↑(Fintype.card Ω)
Instances For
Samples in which at least one of trials independent uniform draws lands
in event.
Equations
- Complexity.uniformAtLeastOneEvent event trials = {draws : Fin trials → Ω | ∃ (trial : Fin trials), draws trial ∈ event}
Instances For
Probability that at least one of trials independent uniform draws lands
in event.
Equations
- Complexity.uniformAtLeastOneProbability event trials = Complexity.uniformProbability (Complexity.uniformAtLeastOneEvent event trials)
Instances For
A parameterized distribution represented by a nonempty finite uniform seed space and deterministic sampler at every slice.
Seed type used at each parameter.
Every seed type is finite.
- seedDecidableEq (n : ℕ) : DecidableEq (self.Seed n)
Seed equality is decidable, so events can be enumerated exactly.
No slice has an empty sample space.
Deterministic output associated to each seed.
Instances For
The seed event whose samples satisfy P.
Instances For
Exact uniform-seed probability of P in the nth slice.
Equations
- D.probability n P = Complexity.uniformProbability (D.event n P)
Instances For
Probability mass of one output in the nth slice.
Equations
- D.mass n x = D.probability n fun (y : α) => y = x
Instances For
Finite support of the nth slice.
Equations
- D.support n = Finset.image (D.sample n) Finset.univ
Instances For
Push an ensemble forward through a deterministic map.
Equations
- D.map f = { Seed := D.Seed, seedFintype := D.seedFintype, seedDecidableEq := D.seedDecidableEq, seedNonempty := ⋯, sample := fun (n : ℕ) (seed : D.Seed n) => f (D.sample n seed) }
Instances For
Independently sample two ensembles from the product of their seed spaces.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Point-mass ensemble. Its seed type is a singleton at every slice.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Regard a Boolean-seed ensemble as a general finite uniform-seed ensemble.
Equations
- One or more equations did not get rendered due to their size.