Skip to content

Correlation Metric Aggregator #16817

@nknize

Description

@nknize

This first Multi-Field metric aggregation will compute the Pearson product-moment correlation coefficient for a given list of numeric fields.

Example usage (correlating stock value against S&P 500):

"pearson_correlation" : {
    "correlation" : {
        "field" : [ "FOO_Corp_Stock_Value", "AAPL", "INDEXSP" ],
    }
}

Example result:

The result provides just the upper triangle (excluding the auto-correlated diagonal which would just be 1.0)

"pearson_correlation" : {
    "correlation" : {
        "FOO_Corp_Stock_Value" : {
            "AAPL" : 0.015411381889249296,
            "INDEXSP" : 0.028740529828528586
        },
        "AAPL" : {
            "INDEXSP" : 0.429228885527728843
        }
    }
}

This hypothetical example shows a small positive correlation (0.0154) between Apple and FOO Corp. stock value. A small positive correlation (0.0287) between FOO Corp. stock and the S&P 500, and a strong (fake) positive correlation (0.4292) between Apple Stock and the S&P 500.

While a made up example with contrived data, this correlation provides a useful statistical tool for drawing correlations between all kinds of data (medical, finance, log trends) and provides a foundation for much more advanced statistics (e.g., spatial statistics and econometrics).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions