A CorrelationAggregator is an Aggregator that returns the degree of correlation between two numeric properties as a Double. The returned number ranges from -1 (perfectly anti-correlated) to 0 (uncorrelated) to 1 (perfectly correlated). The correlation is NaN if no values were found, or if the variance of one of the properties found was zero. This Aggregator overrides the terminateDoubleDouble method, so that the correlation is also available as a DoubleDouble. This allows the correlation to be used by other Aggregators as a high-precision DoubleDouble.
Create and use a CorrelationAggregator, with one of the following methods:
The values returned by the two properties of the object must be numeric.
The correlation is calculated by determining the population covariance of the two properties, and dividing it by the square root of the product of the population variances of each of the two properties.