A LinearRegressionAggregator is an Aggregator that performs a linear regression analysis of two numeric values, returning several results encapsulated in a LinearRegressionStats object. If no values were encountered, then all linear regression stat values are NaN, except for the count statistic, which is zero. The LinearRegressionStats object contains data for the best fit line slope and y-intercept, the count of all pairs of values where both values are not null, the r-squared component, the correlation, and the averages of both properties. While this Aggregator does use floating-point calculations, it does not override the terminateDoubleDouble method.
Create and use a LinearRegressionAggregator, with one of the following methods:
The values returned by both properties of the object must be numeric.
The following methods are available in the LinearRegressionStats object to retrieve the linear regression values. All of them return a double, except for getCount(), which returns a long.