Skip to content

Commit f336640

Browse files
authored
docs: remove extended comment
Signed-off-by: Athan <[email protected]>
1 parent f2c9c0e commit f336640

File tree

1 file changed

+0
-39
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanstdev/lib

1 file changed

+0
-39
lines changed

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,6 @@ var incrstdev = require( '@stdlib/stats/incr/stdev' );
2929
/**
3030
* Returns an accumulator function which incrementally computes a corrected sample standard deviation, ignoring `NaN` values.
3131
*
32-
* ## Method
33-
*
34-
* - This implementation uses Welford's algorithm for efficient computation, which can be derived as follows. Let
35-
*
36-
* ```tex
37-
* \begin{align*}
38-
* S_n &= n \sigma_n^2 \\
39-
* &= \sum_{i=1}^{n} (x_i - \mu_n)^2 \\
40-
* &= \biggl(\sum_{i=1}^{n} x_i^2 \biggr) - n\mu_n^2
41-
* \end{align*}
42-
* ```
43-
*
44-
* Accordingly,
45-
*
46-
* ```tex
47-
* \begin{align*}
48-
* S_n - S_{n-1} &= \sum_{i=1}^{n} x_i^2 - n\mu_n^2 - \sum_{i=1}^{n-1} x_i^2 + (n-1)\mu_{n-1}^2 \\
49-
* &= x_n^2 - n\mu_n^2 + (n-1)\mu_{n-1}^2 \\
50-
* &= x_n^2 - \mu_{n-1}^2 + n(\mu_{n-1}^2 - \mu_n^2) \\
51-
* &= x_n^2 - \mu_{n-1}^2 + n(\mu_{n-1} - \mu_n)(\mu_{n-1} + \mu_n) \\
52-
* &= x_n^2 - \mu_{n-1}^2 + (\mu_{n-1} - x_n)(\mu_{n-1} + \mu_n) \\
53-
* &= x_n^2 - \mu_{n-1}^2 + \mu_{n-1}^2 - x_n\mu_n - x_n\mu_{n-1} + \mu_n\mu_{n-1} \\
54-
* &= x_n^2 - x_n\mu_n - x_n\mu_{n-1} + \mu_n\mu_{n-1} \\
55-
* &= (x_n - \mu_{n-1})(x_n - \mu_n) \\
56-
* &= S_{n-1} + (x_n - \mu_{n-1})(x_n - \mu_n)
57-
* \end{align*}
58-
* ```
59-
*
60-
* where we use the identity
61-
*
62-
* ```tex
63-
* x_n - \mu_{n-1} = n (\mu_n - \mu_{n-1})
64-
* ```
65-
*
66-
* ## References
67-
*
68-
* - Welford, B. P. 1962. "Note on a Method for Calculating Corrected Sums of Squares and Products." _Technometrics_ 4 (3). Taylor & Francis: 419–20. doi:[10.1080/00401706.1962.10490022](https://doi.org/10.1080/00401706.1962.10490022).
69-
* - van Reeken, A. J. 1968. "Letters to the Editor: Dealing with Neely's Algorithms." _Communications of the ACM_ 11 (3): 149–50. doi:[10.1145/362929.362961](https://doi.org/10.1145/362929.362961).
70-
*
7132
* @param {number} [mean] - mean value
7233
* @throws {TypeError} must provide a number primitive
7334
* @returns {Function} accumulator function

0 commit comments

Comments
 (0)