Files
pplus-library/modules/stats/variance/routine.json
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

47 lines
1.2 KiB
JSON

{
"name": "Variance",
"summary": "The sample variance of a list of numbers (dividing by N - 1), computed in two passes.",
"tags": [
"statistics",
"cancellation"
],
"sources": [
{
"title": "Chan, Golub and LeVeque, Algorithms for computing the sample variance: analysis and recommendations, The American Statistician 37(3), 1983",
"url": "https://doi.org/10.1080/00031305.1983.10483115"
}
],
"cases": [
{
"call": "Variance([2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0])"
},
{
"call": "Variance([1.0, 2.0])"
},
{
"call": "Variance([1.0e9 + 4.0, 1.0e9 + 7.0, 1.0e9 + 13.0, 1.0e9 + 16.0])"
}
],
"references": [
{
"lang": "python",
"level": "plain",
"file": "ref/python/plain.py",
"note": "The same two passes."
},
{
"lang": "python",
"level": "statistics",
"file": "ref/python/statistics.py",
"note": "The standard library's statistics.variance, which works with exact fractions inside: a different method, held to agree to 12 digits.",
"rel": 1e-12
},
{
"lang": "mojo",
"level": "plain",
"file": "ref/mojo/plain.mojo",
"note": "The same two passes in Mojo."
}
]
}