Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
examples additiona and year fix
  • Loading branch information
Krishna-Sharma-g authored Mar 5, 2025
commit a3dd815a6c5b7b5faee7d718e73927de6e739f26
Empty file.
18 changes: 18 additions & 0 deletions lib/node_modules/@stdlib/stats/incr/nanvariance/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file is incorrect. Please follow our repl text style guide and avoid using LLMs to generate files.

Copy link
Contributor Author

@Krishna-Sharma-g Krishna-Sharma-g Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was showing warning in the linting years so i added that licence code in that but now i have resolved it please check is that exactly you wanted

* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

{{alias}}( [mean] )
Returns an accumulator function which incrementally computes an unbiased
sample variance, ignoring NaN values.
Expand Down
59 changes: 59 additions & 0 deletions lib/node_modules/@stdlib/stats/incr/nanvariance/examples/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var incrnanvariance = require( './../lib' );

var accumulator;
var s2;
var v;
var i;

// Initialize an accumulator:
accumulator = incrnanvariance();

// For each simulated datum, update the unbiased sample variance...
console.log( '\nValue\tVariance\n' );
for ( i = 0; i < 100; i++ ) {
if ( randu() < 0.2 ) {
v = NaN;
} else {
v = randu() * 100.0;
}
s2 = accumulator( v );
console.log( '%d\t%d', v, s2 );
}
console.log( '\nFinal variance: %d\n', accumulator() );

// Initialize an accumulator with a known mean:
accumulator = incrnanvariance( 50.0 );

// For each simulated datum, update the unbiased sample variance...
console.log( '\nValue\tVariance\n' );
for ( i = 0; i < 100; i++ ) {
if ( randu() < 0.2 ) {
v = NaN;
} else {
v = randu() * 100.0;
}
s2 = accumulator( v );
console.log( '%d\t%d', v, s2 );
}
console.log( '\nFinal variance: %d\n', accumulator() );
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading