Skip to content

Statistics: document NaN behavior in Correlation.Pearson/WeightedPearson/Spearman#1155

Open
su-senka wants to merge 1 commit into
mathnet:masterfrom
su-senka:docs/correlation-nan-remarks
Open

Statistics: document NaN behavior in Correlation.Pearson/WeightedPearson/Spearman#1155
su-senka wants to merge 1 commit into
mathnet:masterfrom
su-senka:docs/correlation-nan-remarks

Conversation

@su-senka

Copy link
Copy Markdown

Adds doc notes to Correlation.Pearson, WeightedPearson, and Spearman clarifying that they return NaN when an input series has zero variance — e.g. too few elements, or all values equal/tied after ranking. Follows up on the discussion in #650, where this behavior was undocumented and caused confusion for a caller computing Spearman on a growing list. Doc-only, no logic changes.

…/WeightedPearson/Spearman

Pearson, WeightedPearson and Spearman return NaN when one of the input
series has zero variance (e.g. fewer than two elements, or all values
equal/tied after ranking), since the underlying formula divides by the
standard deviation of each series. This was previously undocumented,
which led to confusion in mathnet#650.

No behavior change; XML doc comments only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant