Returns an accumulator function which incrementally computes the residual sum of squares.
accumulator function
var accumulator = incrrss();
var r = accumulator();
// returns null
r = accumulator( 2.0, 3.0 );
// returns 1.0
r = accumulator( -5.0, 2.0 );
// returns 50.0
r = accumulator();
// returns 50.0
If provided arguments, returns an updated residual sum of squares; otherwise, returns the current residual sum of squares.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
value
residual sum of squares