Skip to content

Commit 267cac8

Browse files
committed
docs: add missing references and add missing notes
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent d43d8be commit 267cac8

File tree

9 files changed

+62
-4
lines changed

9 files changed

+62
-4
lines changed

lib/node_modules/@stdlib/stats/array/stdevch/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,21 @@ console.log( v );
162162

163163
<!-- /.examples -->
164164

165+
* * *
166+
167+
<section class="references">
168+
169+
## References
170+
171+
- Neely, Peter M. 1966. "Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients." _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496–99. doi:[10.1145/365719.365958][@neely:1966a].
172+
- Ling, Robert F. 1974. "Comparison of Several Algorithms for Computing Sample Means and Variances." _Journal of the American Statistical Association_ 69 (348). American Statistical Association, Taylor & Francis, Ltd.: 859–66. doi:[10.2307/2286154][@ling:1974a].
173+
- Chan, Tony F., Gene H. Golub, and Randall J. LeVeque. 1983. "Algorithms for Computing the Sample Variance: Analysis and Recommendations." _The American Statistician_ 37 (3). American Statistical Association, Taylor & Francis, Ltd.: 242–47. doi:[10.1080/00031305.1983.10483115][@chan:1983a].
174+
- Schubert, Erich, and Michael Gertz. 2018. "Numerically Stable Parallel Computation of (Co-)Variance." In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036][@schubert:2018a].
175+
176+
</section>
177+
178+
<!-- /.references -->
179+
165180
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
166181

167182
<section class="related">
@@ -178,6 +193,14 @@ console.log( v );
178193

179194
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
180195

196+
[@neely:1966a]: https://doi.org/10.1145/365719.365958
197+
198+
[@ling:1974a]: https://doi.org/10.2307/2286154
199+
200+
[@chan:1983a]: https://doi.org/10.1080/00031305.1983.10483115
201+
202+
[@schubert:2018a]: https://doi.org/10.1145/3221269.3223036
203+
181204
</section>
182205

183206
<!-- /.links -->

lib/node_modules/@stdlib/stats/array/stdevch/docs/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3030
/**
3131
* Computes the standard deviation of an array using a one-pass trial mean algorithm.
3232
*
33+
* ## Notes
34+
*
35+
* - Setting the correction parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting the correction parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting the correction parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
36+
*
3337
* @param x - input array
3438
* @param correction - degrees of freedom adjustment (default: 1.0)
3539
* @returns standard deviation

lib/node_modules/@stdlib/stats/array/stdevpn/docs/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3030
/**
3131
* Computes the standard deviation of an array using a two-pass algorithm.
3232
*
33+
* ## Notes
34+
*
35+
* - Setting the correction parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting the correction parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting the correction parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
36+
*
3337
* @param x - input array
3438
* @param correction - degrees of freedom adjustment (default: 1.0)
3539
* @returns standard deviation

lib/node_modules/@stdlib/stats/array/stdevtk/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ console.log( v );
163163

164164
<!-- /.examples -->
165165

166+
* * *
167+
168+
<section class="references">
169+
170+
## References
171+
172+
- Ling, Robert F. 1974. "Comparison of Several Algorithms for Computing Sample Means and Variances." _Journal of the American Statistical Association_ 69 (348). American Statistical Association, Taylor & Francis, Ltd.: 859–66. doi:[10.2307/2286154][@ling:1974a].
173+
174+
</section>
175+
176+
<!-- /.references -->
177+
166178
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
167179

168180
<section class="related">
@@ -179,6 +191,8 @@ console.log( v );
179191

180192
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
181193

194+
[@ling:1974a]: https://doi.org/10.2307/2286154
195+
182196
</section>
183197

184198
<!-- /.links -->

lib/node_modules/@stdlib/stats/array/stdevtk/docs/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3030
/**
3131
* Computes the standard deviation of an array using a one-pass textbook algorithm.
3232
*
33+
* ## Notes
34+
*
35+
* - Setting the correction parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting the correction parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting the correction parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
36+
*
3337
* @param x - input array
3438
* @param correction - degrees of freedom adjustment (default: 1.0)
3539
* @returns standard deviation

lib/node_modules/@stdlib/stats/array/stdevwd/docs/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3030
/**
3131
* Computes the standard deviation of an array using Welford's algorithm.
3232
*
33+
* ## Notes
34+
*
35+
* - Setting the correction parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting the correction parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting the correction parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
36+
*
3337
* @param x - input array
3438
* @param correction - degrees of freedom adjustment (default: 1.0)
3539
* @returns standard deviation

lib/node_modules/@stdlib/stats/array/stdevyc/docs/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3030
/**
3131
* Computes the standard deviation of an array using a one-pass algorithm proposed by Youngs and Cramer.
3232
*
33+
* ## Notes
34+
*
35+
* - Setting the correction parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the standard deviation according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the standard deviation of a population, setting the correction parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample standard deviation, setting the correction parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
36+
*
3337
* @param x - input array
3438
* @param correction - degrees of freedom adjustment (default: 1.0)
3539
* @returns standard deviation

lib/node_modules/@stdlib/stats/array/variancech/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ console.log( v );
146146

147147
<section class="references">
148148

149-
</section>
150-
151-
<!-- /.references -->
152-
153149
## References
154150

155151
- Neely, Peter M. 1966. "Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients." _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496–99. doi:[10.1145/365719.365958][@neely:1966a].
156152
- Ling, Robert F. 1974. "Comparison of Several Algorithms for Computing Sample Means and Variances." _Journal of the American Statistical Association_ 69 (348). American Statistical Association, Taylor & Francis, Ltd.: 859–66. doi:[10.2307/2286154][@ling:1974a].
157153
- Chan, Tony F., Gene H. Golub, and Randall J. LeVeque. 1983. "Algorithms for Computing the Sample Variance: Analysis and Recommendations." _The American Statistician_ 37 (3). American Statistical Association, Taylor & Francis, Ltd.: 242–47. doi:[10.1080/00031305.1983.10483115][@chan:1983a].
158154
- Schubert, Erich, and Michael Gertz. 2018. "Numerically Stable Parallel Computation of (Co-)Variance." In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036][@schubert:2018a].
159155

156+
</section>
157+
158+
<!-- /.references -->
159+
160160
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
161161

162162
<section class="related">

lib/node_modules/@stdlib/stats/array/variancetk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ var v = variancetk( x, 0.0 );
114114
- If provided an empty array, the function returns `NaN`.
115115
- If provided a `correction` argument which is greater than or equal to the number of elements in a provided input array, the function returns `NaN`.
116116
- The function supports array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
117+
- Some caution should be exercised when using the one-pass textbook algorithm. Literature overwhelmingly discourages the algorithm's use for two reasons: 1) the lack of safeguards against underflow and overflow and 2) the risk of catastrophic cancellation when subtracting the two sums if the sums are large and the variance small. These concerns have merit; however, the one-pass textbook algorithm should not be dismissed outright. For data distributions with a moderately large standard deviation to mean ratio (i.e., **coefficient of variation**), the one-pass textbook algorithm may be acceptable, especially when performance is paramount and some precision loss is acceptable (including a risk of returning a negative variance due to floating-point rounding errors!). In short, no single "best" algorithm for computing the variance exists. The "best" algorithm depends on the underlying data distribution, your performance requirements, and your minimum precision requirements. When evaluating which algorithm to use, consider the relative pros and cons, and choose the algorithm which best serves your needs.
117118

118119
</section>
119120

0 commit comments

Comments
 (0)