Kernels from a density against a base measure #
This file defines ProbabilityTheory.Kernel.ofDensity, the kernel whose row at a reweights a
base measure by the density f a and normalizes. It is Bayes' rule for a likelihood given as a
function: with the prior as base and the likelihood of an observation as density, the row is the
posterior. A row whose density has zero or infinite total mass collapses to the zero measure, so
the kernel is always finite.
Main definitions #
ProbabilityTheory.Kernel.ofDensity: rowais proportional toμ.withDensity (f a).
Main results #
ProbabilityTheory.Kernel.ofDensity_apply_singleton: the mass of an atom is its density times its base mass, over the total.ProbabilityTheory.Kernel.ofDensity_indicator_one_apply: at an indicator density the row is the base measure conditioned on the set.ProbabilityTheory.Kernel.ofDensity_div_iSup: a bounded density may be taken in the unit interval, since dividing each row by its supremum leaves the kernel unchanged.ProbabilityTheory.Kernel.ofDensity_count: against the counting measure the density kernel is the weight kernelKernel.ofWeights.ProbabilityTheory.Kernel.ofDensity_apply_eq_posterior: with a kernel's likelihood as density the row is the posterior, at every observation of positive marginal.
The kernel that reweights a base measure by a density and normalizes. Row a is the
probability measure proportional to μ.withDensity (f a), and the zero measure when the density
has zero or infinite total mass.
Equations
- ProbabilityTheory.Kernel.ofDensity μ f = ProbabilityTheory.Kernel.ofFunOfCountable fun (a : α) => (μ.withDensity (f a))[|Set.univ]
Instances For
At the indicator of a measurable set the row is the base measure conditioned on the set.
A row depends on its density only up to a positive finite scalar, which the normalization absorbs.
The kernel depends on the density only up to a positive finite scalar.
Dividing each row's density by its supremum, which puts the density in the unit interval, leaves the kernel unchanged.
Every finite measure on a countable discrete space is a row of the density kernel at a base of positive mass everywhere, with the measure's density against the base as the density.
An atom has positive mass in a row of finite density exactly when its density and its base mass are positive.
A relabelling of the target that carries one base and density to another carries the density kernel along.
A row whose density has positive finite mass under the base is a probability measure.
Pushing a row forward along a map through which its density factors gives the row on the pushed-forward base. With a projection as the map, marginalizing a row whose density ignores a coordinate gives the row on the marginal base.
On natural-number weights and densities the mass of an atom is its weighted density over the total.
Against the uniform measure a density normalizes to its share of the row sum, since the base cancels.
With a real-valued density the share is the real ratio of the row.
Against the counting measure the density kernel is the weight kernel.
Bayes' rule. With a kernel's likelihood of the observation as density against the prior, the row at an observation of positive marginal is the posterior.