Find the central value of a list, with optional weights.
Formula
mean = sum / count · weighted = Σ(x w) / Σw
Explanation
The arithmetic mean adds every value and divides by how many there are. The weighted mean multiplies each value by a weight, sums those products, and divides by the total weight.
Variables
xᵢeach data value
wᵢweight for that value (weighted mean)
ncount of values (unweighted mean)
When to use
Grades, sensor readings, portfolio returns, and any “typical value” of a set.