{ι : Type u_1} → [MeasurableSpace ι] → Finset ι → (ι → ℝ) → Measure ιThe measure with weights p i on the points i ∈ s: ∑ i ∈ s, p i • δ_i, with negative weights read as 0.
Measure.ofWeights s p is the measure ∑ i ∈ s, p i • δ_i with the weights p i on the finite set s: the single adaptor between the library's Finset-indexed weight vectors (probabilities, state prices, spectral weights) and Mathlib's measures. For non-negative weights its integral is the weighted sum, ∫ f ∂ofWeights s p = ∑ i ∈ s, p i * f i, so a statement about weighted sums is a statement about an integral, and a finite measure on a finite space is the law of its own point masses (ofWeights_univ_real_singleton). It lives in MeasureTheory.Measure as an upstream candidate (cf. PMF.toMeasure, which needs weights summing to one).
MeasureTheory.Measure.ofWeights: the measure ∑ i ∈ s, ofReal (p i) • dirac i.MeasureTheory.Measure.integral_ofWeights: ∫ f ∂ofWeights s p = ∑ i ∈ s, p i * f i for non-negative weights.MeasureTheory.Measure.isProbabilityMeasure_ofWeights: weights summing to one give a probability measure.MeasureTheory.Measure.ofWeights_univ_real_singleton: a finite measure on a finite type with measurable singletons is ofWeights univ (fun i ↦ μ.real {i}).Measure.ofWeights_absolutelyContinuous_of_pos: the law of any weights is absolutely continuous with respect to the law of a positive weight vector.finite law, point masses, discrete probability, weights, Dirac measure, MSC 28A25
Above: what it imports. Below: what imports it.
{ι : Type u_1} → [MeasurableSpace ι] → Finset ι → (ι → ℝ) → Measure ιThe measure with weights p i on the points i ∈ s: ∑ i ∈ s, p i • δ_i, with negative weights read as 0.
∀ {ι : Type u_1} [MeasurableSpace ι] {s : Finset ι} {p : ι → ℝ}, (∀ i ∈ s, 0 ≤ p i) → ∑ i ∈ s, p i = 1 → IsProbabilityMeasure (Measure.ofWeights s p)Weights that are non-negative and sum to one give a probability measure.
∀ {ι : Type u_1} [MeasurableSpace ι] [MeasurableSingletonClass ι] (s : Finset ι) {p : ι → ℝ}, (∀ i ∈ s, 0 ≤ p i) → ∀ (f : ι → ℝ), ∫ (i : ι), f i ∂Measure.ofWeights s p = ∑ i ∈ s, p i * f iThe integral against finite weights is the weighted sum: ∫ f ∂(∑ i ∈ s, p i • δ_i) = ∑ i ∈ s, p i * f i for non-negative weights.
∀ {ι : Type u_1} [MeasurableSpace ι] [Fintype ι] [MeasurableSingletonClass ι] (μ : Measure ι) [IsFiniteMeasure μ], (Measure.ofWeights Finset.univ fun i => μ.real {i}) = μA finite measure on a finite type is the law of its point masses: μ = ∑ i, μ {i} • δ_i.
∀ {ι : Type u_2} [MeasurableSpace ι] [Fintype ι] [MeasurableSingletonClass ι] {p q : ι → ℝ}, (∀ (i : ι), 0 < p i) → (Measure.ofWeights Finset.univ q).AbsolutelyContinuous (Measure.ofWeights Finset.univ p)A fully supported weight vector on a finite type dominates every weight vector: the law of q is absolutely continuous with respect to the law of p when p is positive everywhere. Two fully supported weight vectors give mutually absolutely continuous laws.