Skip to content

Commit 694e89c

Browse files
committed
style: as suggested by the reviewer
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 4648b77 commit 694e89c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • lib/node_modules/@stdlib/stats/incr/nanmmse/lib

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
24-
var incrmmean = require( '@stdlib/stats/incr/mmean' );
24+
var incrmmse = require( '@stdlib/stats/incr/mmse' );
2525
var format = require( '@stdlib/string/format' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727

@@ -63,11 +63,11 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
6363
* // returns 33.0
6464
*/
6565
function incrnanmmse( W ) {
66-
var mean;
66+
var mmse;
6767
if ( !isPositiveInteger( W ) ) {
6868
throw new TypeError( format( 'invalid argument. Must provide a positive integer. Value: `%s`.', W ) );
6969
}
70-
mean = incrmmean( W );
70+
mmse = incrmmse( W );
7171
return accumulator;
7272

7373
/**
@@ -79,12 +79,10 @@ function incrnanmmse( W ) {
7979
* @returns {(number|null)} mean squared error or null
8080
*/
8181
function accumulator( x, y ) {
82-
var r;
8382
if ( arguments.length === 0 || isnan( x ) || isnan( y ) ) {
84-
return mean();
83+
return mmse();
8584
}
86-
r = y - x;
87-
return mean( r*r );
85+
return mmse( x, y );
8886
}
8987
}
9088

0 commit comments

Comments
 (0)