Skip to content

Commit c790ae8

Browse files
committed
refactor: update 'weighted standard deviation' to 'weighted sample standard deviation'
--- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent c7a50f0 commit c790ae8

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

lib/node_modules/@stdlib/stats/incr/wstdev/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ limitations under the License.
2020

2121
# incrwstdev
2222

23-
> Compute a [weighted standard deviation][weighted-standard-deviation] incrementally.
23+
> Compute a [weighted sample standard deviation][weighted-standard-deviation] incrementally.
2424
2525
<section class="intro">
2626

27-
The [weighted standard deviation][weighted-standard-deviation] is defined as
27+
The [weighted sample standard deviation][weighted-standard-deviation] is defined as
2828

29-
<!-- <equation class="equation" label="eq:weighted_standard_deviation" align="center" raw="s = \sqrt{\frac{\displaystyle\sum_{i=0}^{n-1} w_{i} \left( x_{i} - \bar{x} \right)^2}{\displaystyle\sum_{i=0}^{n-1} w_{i}}}" alt="Equation for the weighted standard deviation."> -->
29+
<!-- <equation class="equation" label="eq:weighted_standard_deviation" align="center" raw="s = \sqrt{\frac{\displaystyle\sum_{i=0}^{n-1} w_{i} \left( x_{i} - \bar{x} \right)^2}{\displaystyle\sum_{i=0}^{n-1} w_{i}}}" alt="Equation for the weighted sample standard deviation."> -->
3030

3131
```math
3232
s = \sqrt{\frac{\displaystyle\sum_{i=0}^{n-1} w_{i} \left( x_{i} - \bar{x} \right)^2}{\displaystyle\sum_{i=0}^{n-1} w_{i}}}
3333
```
3434

35-
<!-- <div class="equation" align="center" data-raw-text="s = \sqrt{\frac{\displaystyle\sum_{i=0}^{n-1} w_{i} \left( x_{i} - \bar{x} \right)^2}{\displaystyle\sum_{i=0}^{n-1} w_{i}}}" data-equation="eq:weighted_arithmetic_mean">
36-
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@adbea9806383f70c982e3191475c874efba1296b/lib/node_modules/@stdlib/stats/incr/wstdev/docs/img/equation_weighted_standard_deviation.svg" alt="Equation for the weighted arithmetic mean.">
35+
<!-- <div class="equation" align="center" data-raw-text="s = \sqrt{\frac{\displaystyle\sum_{i=0}^{n-1} w_{i} \left( x_{i} - \bar{x} \right)^2}{\displaystyle\sum_{i=0}^{n-1} w_{i}}}" data-equation="eq:weighted_standard_deviation">
36+
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@adbea9806383f70c982e3191475c874efba1296b/lib/node_modules/@stdlib/stats/incr/wstdev/docs/img/equation_weighted_standard_deviation.svg" alt="Equation for the weighted sample standard deviation.">
3737
<br>
3838
</div> -->
3939

@@ -53,15 +53,15 @@ var incrwstdev = require( '@stdlib/stats/incr/wstdev' );
5353

5454
#### incrwstdev()
5555

56-
Returns an accumulator `function` which incrementally computes a [weighted standard deviation][weighted-standard-deviation].
56+
Returns an accumulator `function` which incrementally computes a [weighted sample standard deviation][weighted-standard-deviation].
5757

5858
```javascript
5959
var accumulator = incrwstdev();
6060
```
6161

6262
#### accumulator( \[x, w] )
6363

64-
If provided an input value `x` and a weight `w`, the accumulator function returns an updated weighted standard deviation. If not provided any input values, the accumulator function returns the current standard deviation.
64+
If provided an input value `x` and a weight `w`, the accumulator function returns an updated weighted sample standard deviation. If not provided any input values, the accumulator function returns the current weighted sample standard deviation.
6565

6666
```javascript
6767
var accumulator = incrwstdev();
@@ -111,7 +111,7 @@ var i;
111111
// Initialize an accumulator:
112112
accumulator = incrwstdev();
113113

114-
// For each simulated datum, update the weighted standard deviation...
114+
// For each simulated datum, update the weighted sample standard deviation...
115115
for ( i = 0; i < 100; i++ ) {
116116
v = uniform( 0.0, 100.0 );
117117
w = uniform( 0.0, 100.0 );

lib/node_modules/@stdlib/stats/incr/wstdev/examples/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ var i;
3030
// Initialize an accumulator:
3131
accumulator = incrwstdev();
3232

33-
// For each simulated datum, update the weighted standard deviation...
34-
console.log( '\nValue\tWeight\tWeighted Standard Deviation\n' );
33+
// For each simulated datum, update the weighted sample standard deviation...
34+
console.log( '\nValue\tWeight\tWeighted Sample Standard Deviation\n' );
3535
for ( i = 0; i < 100; i++ ) {
3636
x = uniform( 0.0, 100.0 );
3737
w = uniform( 0.0, 100.0 );
3838
stdev = accumulator( x, w );
3939
console.log( '%d\t%d\t%d', x.toFixed( 4 ), w.toFixed( 4 ), stdev.toFixed( 4 ) );
4040
}
41-
console.log( '\nFinal weighted standard deviation: %d\n', accumulator() );
41+
console.log( '\nFinal weighted sample standard deviation: %d\n', accumulator() );

lib/node_modules/@stdlib/stats/incr/wstdev/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Compute a weighted standard deviation incrementally.
22+
* Compute a weighted sample standard deviation incrementally.
2323
*
2424
* @module @stdlib/stats/incr/wstdev
2525
*

lib/node_modules/@stdlib/stats/incr/wstdev/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var format = require( '@stdlib/string/format' );
3939
* \sigma = \sqrt{\frac{\sum_{i=0}^{n-1} w_i (x_i - \mu)^2}{\sum_{i=0}^{n-1} w_i}}
4040
* ```
4141
*
42-
* where \\( w_i \\) are the weights and \\( \mu \\) is the weighted mean.
42+
* where \\( w_i \\) are the weights and \\( \mu \\) is the weighted arithmetic mean.
4343
*
4444
* - To derive an incremental formula for computing a weighted sample standard deviation, let:
4545
*
@@ -147,7 +147,7 @@ function incrwstdev( mean ) {
147147
* @param {number} [x] - value
148148
* @param {NonNegativeNumber} [w] - weight
149149
* @throws {TypeError} second argument must be a nonnegative number
150-
* @returns {(number|null)} weighted standard deviation or null
150+
* @returns {(number|null)} weighted sample standard deviation or null
151151
*/
152152
function accumulator1( x, w ) {
153153
if ( arguments.length === 0 ) {
@@ -177,7 +177,7 @@ function incrwstdev( mean ) {
177177
* @param {number} [x] - value
178178
* @param {NonNegativeNumber} [w] - weight
179179
* @throws {TypeError} second argument must be a nonnegative number
180-
* @returns {(number|null)} weighted standard deviation or null
180+
* @returns {(number|null)} weighted sample standard deviation or null
181181
*/
182182
function accumulator2( x, w ) {
183183
if ( arguments.length === 0 ) {

lib/node_modules/@stdlib/stats/incr/wstdev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/stats/incr/wstdev",
33
"version": "0.0.0",
4-
"description": "Compute a weighted standard deviation incrementally.",
4+
"description": "Compute a weighted sample standard deviation incrementally.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

0 commit comments

Comments
 (0)