Message400323
> what it's correcting for is an inaccurate value of "c" [...]
In more detail:
Suppose "m" is the true mean of the x in data, but all we have is an approximate mean "c" to work with. Write "e" for the error in that approximation, so that c = m + e. Then (using Python notation, but treating the expressions as exact mathematical expressions computed in the reals):
sum((x-c)**2 for x in data)
== sum((x-m-e)**2 for x in data)
== sum((x - m)**2 for x in data) - 2 * sum((x - m)*e for x in data)
+ sum(e**2 for x in data)
== sum((x - m)**2 for x in data) - 2 * e * sum((x - m) for x in data)
+ sum(e**2 for x in data)
== sum((x - m)**2 for x in data) + sum(e**2 for x in data)
(because sum((x - m) for x in data) is 0)
== sum((x - m)**2 for x in data) + n*e**2
So the error in our result arising from the error in computing m is that n*e**2 term. And that's the term that's being subtracted here, because
sum(x - c for x in data) ** 2 / n
== sum(x - m - e for x in data) ** 2 / n
== (sum(x - m for x in data) - sum(e for x in data))**2 / n
== (0 - n * e)**2 / n
== n * e**2 |
|
Date |
User |
Action |
Args |
2021-08-26 08:38:33 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, steven.daprano, xtreak, reed, iritkatriel |
2021-08-26 08:38:33 | mark.dickinson | set | messageid: <1629967113.12.0.905388258672.issue39218@roundup.psfhosted.org> |
2021-08-26 08:38:33 | mark.dickinson | link | issue39218 messages |
2021-08-26 08:38:33 | mark.dickinson | create | |
|