# \[Announce\] node-red-contrib-statistics & node-red-contrib-regression

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-statistics-node-red-contrib-regression/401>\
**Category:** Share Your Nodes\
**Created:** [26 May 2018 03:10 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-statistics-node-red-contrib-regression/401 "2018-05-26T03:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeanC](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/deanc/32/298_2.png) [@DeanC](https://discourse.nodered.org/u/DeanC)\
**Post date:** [26 May 2018 03:10 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-statistics-node-red-contrib-regression/401/1 "2018-05-26T03:10:59Z")

</div>

# node-red-contrib-statistics

New release v2.2.2  
Upgraded to use simple-statistics version 6.0  
Implemented new functions:

- equalIntervalBreaks
- extent
- gamma
- quantileRank
- sampleWithReplacement
- sampleKurtosis
- shuffle  
[NPM link](https://www.npmjs.com/package/node-red-contrib-statistics)

# node-red-contrib-regression

A Node Red node to perform least squares regression fitting on a flow using the linear regression functions in the regression-js library. The regression functions supported are:

- linear - y = mx + c
- exponential - y = ae^bx
- logarithmic - y = a + b ln x
- power - y = ax^b
- polynomial - ax^n + … + ax + a

If `x` and `y` both contain values then they are saved as a point into the data set. The `x` may also contain an array of `[x,y]` points which will be saved into the data set. If `data set size` is greater that 0 then the size of the data set will be limited to the number of elements specified, with the oldest elements dropped first.

Once enough points are stored in the data set, a line equation will be generated using linear regression. This equation can be output as an object containing the coefficients of the equation, a text representation of the equation, the coefficient of determination, and a function that implements the equation.

For every input containing a value in `x`, a value for `y` will be calculated. The input `y` value can be replaced with the calculated `y` value as a basic noise reduction function.

[NPM link](https://www.npmjs.com/package/node-red-contrib-regression)
