Numerically most robust way to compute sum of products (standard deviation) in floating-point?
Statement
I stumbled across a paper by Welford (1962), where he proclaims a method that should compute the standard deviation numerically more robust than the naive algorithms (http://www.jstor.org/stable/1266577). Here, "numerically robust" means that round-off errors are reduced.
He gives a recurrence for the sum of squares , being, of course, the mean. That way, the standard deviation can be computed iteratively in a single pass.
As far as I understand, he claims that his iterative recurrence formula is numerically more robust, because all terms in it are of the same order (provided the input data are all of the same order).
This is what I don't understand. It seems to me that, as gets incremented, becomes larger and larger, so more and more significant digits from the second term are lost, aren't they?
Googling a bit further, I have found a paper by Youngs & Cramer, 1971, who looked at a number of methods, including Welford's, of computing the sum of products / standard deviation more robustly (http://www.jstor.org/stable/1267176).
Conducting a number of experiments, they found that …
Posed by Gab · algorithms, st.statistics, na.numerical-analysis
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-70345.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/mo-70345.lean
import Mathlib /-! # Numerically most robust way to compute sum of products (standard deviation) in floating-point? Source: https://mathoverflow.net/questions/70345 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_mo_70345 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_70345