Skip to content

Commit 2472f7b

Browse files
committed
chore: clean-up
1 parent d45316a commit 2472f7b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ var v = nanstdevtk( x );
112112
The function has the following parameters:
113113

114114
- **x**: input array.
115-
- **correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `N` corresponds to the number of array elements and `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the unbiased sample [standard deviation][standard-deviation], setting this 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). Default: `1.0`.
115+
- **correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `N` corresponds to the number of non-`NaN` array elements and `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the unbiased sample [standard deviation][standard-deviation], setting this 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). Default: `1.0`.
116116

117117
By default, the function computes the sample [standard deviation][standard-deviation]. To adjust the degrees of freedom when computing the [standard deviation][standard-deviation], provide a `correction` argument.
118118

@@ -132,7 +132,7 @@ var v = nanstdevtk( x, 0.0 );
132132
## Notes
133133

134134
- If provided an empty array, the function returns `NaN`.
135-
- If `N - c` is less than or equal to `0` (where `c` corresponds to the provided degrees of freedom adjustment), the function returns `NaN`.
135+
- If `N - c` is less than or equal to `0` (where `c` corresponds to the provided degrees of freedom adjustment and `N` corresponds to the number of non-`NaN` array elements), the function returns `NaN`.
136136
- 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]).
137137
- 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 computing a negative variance due to floating-point rounding errors!). In short, no single "best" algorithm for computing the standard deviation 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.
138138

lib/node_modules/@stdlib/stats/array/nanstdevtk/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
Degrees of freedom adjustment. Setting this parameter to a value other
1515
than `0` has the effect of adjusting the divisor during the calculation
1616
of the standard deviation according to `N-c` where `N` corresponds to
17-
the number of array elements and `c` corresponds to the provided
17+
the number of non-NaN array elements and `c` corresponds to the provided
1818
degrees of freedom adjustment. When computing the standard deviation of
1919
a population, setting this parameter to `0` is the standard choice
2020
(i.e., the provided array contains data constituting an entire
2121
population). When computing the unbiased sample standard deviation,
2222
setting this parameter to `1` is the standard choice (i.e., the
2323
provided array contains data sampled from a larger population; this is
24-
commonly referred to as Bessel's correction). Default: `1.0`.
24+
commonly referred to as Bessel's correction). Default: 1.0.
2525

2626
Returns
2727
-------

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3232
*
3333
* ## Notes
3434
*
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).
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 `N` corresponds to the number of non-`NaN` array elements and `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).
3636
*
3737
* @param x - input array
38-
* @param correction - degrees of freedom adjustment
38+
* @param correction - degrees of freedom adjustment (default: 1.0)
3939
* @returns standard deviation
4040
*
4141
* @example

lib/node_modules/@stdlib/stats/array/nanstdevtk/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var GENERIC_DTYPE = 'generic';
4545
* @param {number} [correction=1.0] - degrees of freedom adjustment
4646
* @throws {TypeError} first argument must have a supported data type
4747
* @throws {TypeError} first argument must be an array-like object
48-
* @throws {TypeError} second argument must be an number
48+
* @throws {TypeError} second argument must be a number
4949
* @returns {number} standard deviation
5050
*
5151
* @example

lib/node_modules/@stdlib/stats/array/nanstdevtk/test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ tape( 'if provided an array containing a single element, the function returns `0
320320
t.end();
321321
});
322322

323-
tape( 'if provided a `correction` parameter which is greater than or equal to the input array length, the function returns `NaN`', function test( t ) {
323+
tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN`', function test( t ) {
324324
var x;
325325
var v;
326326

@@ -335,7 +335,7 @@ tape( 'if provided a `correction` parameter which is greater than or equal to th
335335
t.end();
336336
});
337337

338-
tape( 'if provided a `correction` parameter which is greater than or equal to the input array length, the function returns `NaN` (accessors)', function test( t ) {
338+
tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN` (accessors)', function test( t ) {
339339
var x;
340340
var v;
341341

0 commit comments

Comments
 (0)