The mean of a finite family of vectors #
The mean m = (card ι)⁻¹ • ∑ i, z i of a finite family z : ι → E in a vector space over a field
R is its center of mass with equal weights, Finset.univ.centerMass (fun _ ↦ 1) z. Through total
inversion, the mean of the empty family is 0. For a nonempty family this is the affine
Finset.centroid, which has no canonical value on the empty family. Mathlib's average
Finset.expect needs a ℚ≥0-module structure, which a vector space over a general field, such
as an inner product space over ℝ or ℂ, does not carry as an instance.
Over a field of characteristic zero, this file records the identities of descriptive statistics
used for sample means and scatter operators: the sum of a family is its size times its mean, the
deviations zᵢ - m sum to zero, subtracting a constant c from a nonempty family subtracts it
from the mean, and appending a point y to a family of n points moves the mean by
(n + 1)⁻¹ (y - m), including for n = 0.
Main declarations #
TauCeti.finiteMean: the mean of a finite family.TauCeti.finiteMean_of_isEmpty: the mean of the empty family is0.TauCeti.sum_eq_card_smul_finiteMean:∑ i, z i = card ι • m.TauCeti.sum_sub_finiteMean:∑ i, (z i - m) = 0.TauCeti.finiteMean_sub_const: the mean of the deviationszᵢ - cism - c.TauCeti.finiteMean_snoc: the mean after appending a point.
The mean (card ι)⁻¹ • ∑ i, z i of a finite family z of vectors: its center of mass with
equal weights. The mean of the empty family is 0.
Instances For
The mean of the empty family is 0.
The sum of a finite family is its size times its mean.
The deviations of a finite family from its mean sum to zero.
Subtracting a constant from every member of a nonempty family subtracts it from the mean.
Appending a point. Appending y to a family z of n points with mean m moves the
mean by (n + 1)⁻¹ • (y - m). For n = 0 this says that the mean of the single point y is
y.