You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
variance is inaccurate for arrays of identical, large values (Trac #1098) #1696
This is much improved after #3685. Note that the relative error in each term is ~1ulp.
In [13]: a.std()/1e20
Out[13]: 1.6383999999999999e-16
The error arises from the determination of the mean combined with the fact that all error are the same, hence no cancellation when adding up the variance. Using Python's "exact" fsum doesn't do any better.
Activity
thouis commentedon Oct 19, 2012
Attachment added by @thouis on 2009-04-29: test_var.py
thouis commentedon Oct 19, 2012
Milestone changed to
1.4.0by @cournape on 2009-06-01thouis commentedon Oct 19, 2012
Milestone changed to
Unscheduledby @cournape on 2009-11-27thouis commentedon Oct 19, 2012
@bsouthey wrote on 2011-01-26
At least on Linux, this can be addressed by the dtype argument:
Of course it just delays the situation when using even larger numbers.
charris commentedon Feb 20, 2014
This is much improved after #3685. Note that the relative error in each term is ~1ulp.
The error arises from the determination of the mean combined with the fact that all error are the same, hence no cancellation when adding up the variance. Using Python's "exact" fsum doesn't do any better.