File tree Expand file tree Collapse file tree 6 files changed +33
-12
lines changed 
lib/node_modules/@stdlib/stats/incr/nanskewness Expand file tree Collapse file tree 6 files changed +33
-12
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,10 @@ accumulator = incrnanskewness();
151151//  For each simulated datum, update the corrected sample skewness...
152152for  ( i =  0 ; i <  100 ; i++  ) {
153153    if  ( randu () <  0.2  ) {
154- 		 v =  NaN ;
155- 	 } else  {
156- 		 v =  randu () *  100.0 ;
157- 	 }
154+          v =  NaN ;
155+      } else  {
156+          v =  randu () *  100.0 ;
157+      }
158158    accumulator ( v );
159159}
160160console .log ( accumulator () );
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ for ( i = 0; i < 100; i++ ) {
3939		v  =  randu ( )  *  100.0 ; 
4040	} 
4141	skewness  =  accumulator (  v  ) ; 
42- 	if  (  i  <  2  )  { 
42+ 	if  (  i  <  2  ||   skewness   ===   null   )  { 
4343		console . log (  '%d\t%s' ,  v . toFixed (  4  ) ,  skewness  ) ; 
4444	}  else  { 
4545		console . log (  '%d\t%d' ,  v . toFixed (  4  ) ,  skewness . toFixed (  4  )  ) ; 
Original file line number Diff line number Diff line change 2121/** 
2222* Compute a corrected sample skewness incrementally, ignoring `NaN` values. 
2323* 
24- * @module  @stdlib /stats/incr/skewness  
24+ * @module  @stdlib /stats/incr/nanskewness  
2525* 
2626* @example  
2727* var incrnanskewness = require( '@stdlib/stats/incr/nanskewness' ); 
Original file line number Diff line number Diff line change 1+ /** 
2+ * @license  Apache-2.0 
3+ * 
4+ * Copyright (c) 2025 The Stdlib Authors. 
5+ * 
6+ * Licensed under the Apache License, Version 2.0 (the "License"); 
7+ * you may not use this file except in compliance with the License. 
8+ * You may obtain a copy of the License at 
9+ * 
10+ *    http://www.apache.org/licenses/LICENSE-2.0 
11+ * 
12+ * Unless required by applicable law or agreed to in writing, software 
13+ * distributed under the License is distributed on an "AS IS" BASIS, 
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
15+ * See the License for the specific language governing permissions and 
16+ * limitations under the License. 
17+ */ 
18+ 
119'use strict' ; 
220
321// MODULES // 
22+ 
423var  isnan  =  require (  '@stdlib/math/base/assert/is-nan'  ) ; 
524var  incrskewness  =  require (  '@stdlib/stats/incr/skewness'  ) ; 
625
26+ 
727// MAIN // 
828/** 
929* Returns an accumulator function which incrementally computes a corrected sample skewness, **ignoring NaN values**. 
@@ -52,5 +72,7 @@ function incrnanskewness() {
5272    } ; 
5373} 
5474
75+ 
5576// EXPORTS // 
77+ 
5678module . exports  =  incrnanskewness ; 
Original file line number Diff line number Diff line change 6363    " accumulator" 
6464  ]
6565}
66-   
Original file line number Diff line number Diff line change 11/** 
22* @license  Apache-2.0 
33* 
4- * Copyright (c) 2018  The Stdlib Authors. 
4+ * Copyright (c) 2025  The Stdlib Authors. 
55* 
66* Licensed under the Apache License, Version 2.0 (the "License"); 
77* you may not use this file except in compliance with the License. 
@@ -55,10 +55,10 @@ tape( 'the accumulator function incrementally computes a corrected sample skewne
5555	expected  =  [ 
5656		null , 
5757		null , 
58-          null , 
58+ 		 null , 
5959		1.457862967321305 , 
6060		0.4366620845757488 , 
61-          0.4366620845757488 , 
61+ 		 0.4366620845757488 , 
6262		0.1171875 
6363	] ; 
6464
@@ -108,13 +108,13 @@ tape( 'the corrected sample skewness is `null` until at least 3 datums have been
108108	t . equal (  skewness ,  null ,  'returns null'  ) ; 
109109
110110    skewness  =  acc (  NaN  ) ; 
111-      t . equal (  skewness ,  null ,  'returns null'  ) ; 
111+ 	 t . equal (  skewness ,  null ,  'returns null'  ) ; 
112112
113113	skewness  =  acc (  2.0  ) ; 
114114	t . equal (  skewness ,  null ,  'returns null'  ) ; 
115115
116116    skewness  =  acc (  NaN  ) ; 
117-      t . equal (  skewness ,  null ,  'returns null'  ) ; 
117+ 	 t . equal (  skewness ,  null ,  'returns null'  ) ; 
118118
119119	skewness  =  acc (  3.0  ) ; 
120120	t . equal (  skewness ,  null ,  'returns null'  ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments