File tree Expand file tree Collapse file tree 6 files changed +10
-9
lines changed
lib/node_modules/@stdlib/stats/incr/nanvariance Expand file tree Collapse file tree 6 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11/**
22* @license Apache-2.0
33*
4- * Copyright (c) 2023 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.
Original file line number Diff line number Diff line change 11/*
22* @license Apache-2.0
33*
4- * Copyright (c) 2023 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.
1616* limitations under the License.
1717*/
1818
19- // TypeScript Version: 4.1
19+ // TypeScript Version: 4.1
2020
21- //<reference types="@stdlib/types"/>
21+ // <reference types="@stdlib/types"/>
2222
2323/**
2424* If provided a value, returns an updated unbiased sample variance; otherwise, returns the current unbiased sample variance.
Original file line number Diff line number Diff line change 11/*
22* @license Apache-2.0
33*
4- * Copyright (c) 2023 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.
Original file line number Diff line number Diff line change 11/**
22* @license Apache-2.0
33*
4- * Copyright (c) 2023 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.
Original file line number Diff line number Diff line change @@ -82,10 +82,10 @@ var format = require( '@stdlib/string/format' );
8282* // returns 1.2996
8383*
8484* v = accumulator( -5.0 );
85- * // returns 24.4402
85+ * // returns 33.7796
8686*
8787* v = accumulator();
88- * // returns 24.4402
88+ * // returns 33.7796
8989*/
9090function incrnanvariance ( mean ) {
9191 var delta ;
@@ -162,6 +162,7 @@ function incrnanvariance( mean ) {
162162 }
163163 return M2 / N ;
164164 }
165+ // Important: For the known mean case, we're simply summing squared deviations
165166 delta = x - mu ;
166167 M2 += delta * delta ;
167168 N += 1 ;
Original file line number Diff line number Diff line change 11/**
22* @license Apache-2.0
33*
4- * Copyright (c) 2023 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.
You can’t perform that action at this time.
0 commit comments