-
-
Notifications
You must be signed in to change notification settings - Fork 906
feat: adding stats/incr/nanmmse
#6190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
// MODULES // | ||
|
||
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; | ||
var incrmmean = require( '@stdlib/stats/incr/mmean' ); | ||
var incrmmse = require( '@stdlib/stats/incr/mmse' ); | ||
var format = require( '@stdlib/string/format' ); | ||
var isnan = require( '@stdlib/math/base/assert/is-nan' ); | ||
|
||
|
@@ -63,11 +63,11 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); | |
* // returns 33.0 | ||
*/ | ||
function incrnanmmse( W ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to create a thin wrapper around the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @hrshya, i have styled as per your request, please review. |
||
var mean; | ||
var mmse; | ||
if ( !isPositiveInteger( W ) ) { | ||
|
||
throw new TypeError( format( 'invalid argument. Must provide a positive integer. Value: `%s`.', W ) ); | ||
} | ||
mean = incrmmean( W ); | ||
mmse = incrmmse( W ); | ||
return accumulator; | ||
|
||
/** | ||
|
@@ -79,12 +79,10 @@ function incrnanmmse( W ) { | |
* @returns {(number|null)} mean squared error or null | ||
*/ | ||
function accumulator( x, y ) { | ||
var r; | ||
if ( arguments.length === 0 || isnan( x ) || isnan( y ) ) { | ||
return mean(); | ||
return mmse(); | ||
} | ||
r = y - x; | ||
return mean( r*r ); | ||
return mmse( x, y ); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is not being used so you can remove it.