You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/incr/nanskewness/lib/main.js
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,9 @@ var incrskewness = require( '@stdlib/stats/incr/skewness' );
25
25
26
26
27
27
// MAIN //
28
+
28
29
/**
29
-
* Returns an accumulator function which incrementally computes a corrected sample skewness, **ignoring NaN values**.
30
+
* Returns an accumulator function which incrementally computes a corrected sample skewness while **ignoring NaN values**.
30
31
*
31
32
* @returns {Function} accumulator function
32
33
*
@@ -52,24 +53,24 @@ var incrskewness = require( '@stdlib/stats/incr/skewness' );
52
53
* // returns ~0.492
53
54
*/
54
55
functionincrnanskewness(){
55
-
varacc=incrskewness();// Use the standard skewness accumulator
56
+
varacc=incrskewness();// Use the standard skewness accumulator
56
57
57
58
/**
58
-
* If provided a value, the accumulator function returns an updated corrected sample skewness. If not provided a value, the accumulator function returns the current corrected sample skewness.
59
+
* If provided a value, the accumulator function returns an updated corrected sample skewness.
60
+
* If not provided a value, the function returns the current corrected sample skewness.
59
61
*
60
-
* @private
61
62
* @param {number} [x] - new value
62
63
* @returns {(number|null)} corrected sample skewness or null
63
64
*/
64
-
returnfunctionaccumulator(x){
65
-
if(arguments.length===0){
66
-
returnacc();// Return the current skewness
67
-
}
68
-
if(isnan(x)){
69
-
returnacc();// Ignore NaN and return the current skewness
70
-
}
71
-
returnacc(x);// Update skewness with a valid number
72
-
};
65
+
returnfunctionaccumulator(x){
66
+
if(arguments.length===0){
67
+
returnacc();// Return current skewness if no input is provided
68
+
}
69
+
if(isnan(x)){
70
+
returnacc();// Ignore NaN values and return the current skewness
71
+
}
72
+
returnacc(x);// Update skewness with a valid number
0 commit comments