loess icon indicating copy to clipboard operation
loess copied to clipboard

do not normalize datasets with too less entries

Open mojoaxel opened this issue 7 years ago • 0 comments

It loess is called with an array less than 4 data-points and normalization is enabled an error occurs in https://github.com/yongjun21/loess/blob/master/src/helpers.js#L12 because math.std can not be called with an empty array. Also it makes no sense for arrays with less than 4 entries.

This fix returns the original array is it has too little entries.

mojoaxel avatar Apr 18 '18 14:04 mojoaxel