Sub-Probability Distributions #
This file defines a type SPMF as a PMF extended with the option to fail.
The probability of failure is the missing mass to make the PMF sum to 1.
View a subdistribution on α as a distribution on Option α.
Equations
- p.toPMF = OptionT.run p
Instances For
Expose the induced monad instance on SPMF.
Expose the lifting operations from PMF to SPMF given by OptionT.lift
Equations
- SPMF.instMonadLiftPMF = { monadLift := fun {α : Type ?u.5} => OptionT.lift }
Apply an SPMF α to an element of α.
Equations
- SPMF.instFunLikeENNReal = { coe := fun (p : SPMF α) (x : α) => (OptionT.run p) (some x), coe_injective' := ⋯ }
Equations
- SPMF.instZero = { zero := failure }
@[simp]
@[simp]
The set of outputs with non-zero probability mass.
Equations
- p.support = Function.support ⇑p
Instances For
The functor map for SPMF equals PMF.map (Option.map f).