Repository navigation
Description
Go Fan Report: gonum.org/v1/gonum
Module: gonum.org/v1/gonum v0.17.0 (already latest release, published 2026-01-10)
Selected via round-robin plus recent-activity priority: the gonum repo was pushed most recently (2026-10-25) among all direct dependencies not reviewed in the last 7 days.
Current Usage in gh-aw
Only 1 file imports gonum, and only one subpackage: pkg/cli/experiments_grader_statistics.go imports gonum.org/v1/gonum/stat/distuv (nothing from stat, mat, optimize, etc.).
Key APIs used:
distuv.StudentsT{Mu,Sigma,Nu}.CDF(...)for Welch t-test p-valuedistuv.UnitNormal.CDF(...)for Mann-Whitney U and two-proportion z-test p-valuesdistuv.Beta{Alpha,Beta}.Prob/.CDF(...)for Bayesian A/B posterior-superiority probability (numerically integrated over a fixed 4096-point grid)
Everything else in the file, including meanValues, sampleVariance, the Mann-Whitney ranking and tie-correction logic, and sumValues, is hand-rolled, not from gonum.
Research Findings
The gonum stat package (not currently imported here) provides Mean, Variance, and notably MeanVariance, which computes the unbiased (Bessel-corrected) sample mean and variance together in a single pass. That is the exact statistic the file hand-rolls today via meanValues plus sampleVariance, but with a redundant pass: welchTTest calls meanValues directly, and sampleVariance recomputes the mean again internally.
gonum does not ship a built-in Mann-Whitney or rank-sum test, so the hand-rolled implementation in this file is a reasonable, justified choice, not a gap.
Recent Updates (v0.16.0 to v0.17.0)
distuv: added a non-central t distributionstat: added Wasserstein distancestat/distuv: added a documentation example for computing a confidence interval, notable becauseMetricComparisonin this repo currently reports only p-values and superiority probabilities, no intervals
Best Practices
Gonum documentation favors the single-pass MeanVariance over separate mean and variance calls, and recommends passing nil for unweighted inputs instead of building an all-ones weight slice.
Improvement Opportunities
Quick Wins
- Replace
meanValues(values)plussampleVariance(values)inwelchTTest(pkg/cli/experiments_grader_statistics.go) with a singlestat.MeanVariance(values, nil)call per group. This removes a redundant mean computation per group and drops the need for the hand-rolledsampleVariancehelper. - The
meanValueshelper used for theDeltafield incomputeGraderMetricComparisonscould be replaced bystat.Mean(values, nil), removing another hand-rolled helper in favor of the already-vendored dependency.
Feature Opportunities
- Add confidence intervals to
MetricComparison, for example aDeltaCI [2]float64field, usingdistuv.StudentsT.Quantileanddistuv.UnitNormal.Quantile, mirroring the confidence-interval example gonum added to its docs in v0.17.0. This is standard practice for A/B reporting and is currently missing from the grader output. betaBinomialProbabilityintegrates over a fixed 4096-point grid to get a posterior-superiority probability; a credible interval for the same Bayesian path, derived fromdistuv.Betaquantile or CDF, could be reported alongside it for consistency with the frequentist paths above.
Best Practice Alignment
- The file currently imports only
stat/distuvand neverstat, despitestatproviding exactly the descriptive-statistics helpers (Mean,MeanVariance) this file reimplements by hand. Importingstatwould better align with the intended split in gonum (statfor descriptive statistics,stat/distuvfor distributions) and reduce custom code surface.
General Improvements
- No version upgrade needed; go.mod already pins the latest gonum release (v0.17.0).
- No other files in the repo import gonum, so there is no cross-file consistency work needed beyond this one file.
Recommendations
- Swap
meanValuesandsampleVarianceforstat.MeanVarianceinwelchTTest(quick win, no behavior change, same unbiased-variance formula). - Consider adding confidence intervals to
MetricComparisonusing existingdistuvquantile methods, since the module already imported for this purpose supports it directly.
Next Steps
- If confidence intervals are added, update any downstream report rendering that consumes
MetricComparisonto display the new field. - Re-review after any change to
AnalysisTypehandling, since that is the main place gonum APIs are invoked.
Generated by Go Fan
Module summary saved to: scratchpad/mods/gonum.md
Run: Β§40289806152
Generated by πΉ Go Fan Β· claude Β· agent Β· ~97 AIC Β· β ~1 AIC Β· β 4.4K Β· β·
- expires on Oct 27, 2026, 12:14 AM UTC-08:00
Activity
github-actions commentedon Oct 27, 2026
This issue was automatically closed because it expired on 2026-10-27T08:14:43.201Z.