Skip to content

correlation loses precision on offset low-variance columns #217

Description

@skymanbp

The one-pass nSxy - SxSy form cancels catastrophically:

a = [1e8, 1e8, 1.00000002e8]
b = [1e8, 1e8, 1.00000003e8]
correlation "a" "b" df  -- Just 2.0

a = [1e11, 1e11 + 1, 1e11 + 2]
correlation "a" "a" df  -- Just (-1.0)

A centered two-pass form fixes both but doubles the passes, so it needs
profiling first (#214 review). Will send a PR with benchmarks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions