correlation

A function that can be used in Formulas.

Syntax and semantics

correlation (u#, v#)
compute the correlation between the vectors u# and v#.

Precondition

The vectors u# and v# have to have equal numbers of elements.

Definition

If N is the number of elements of both u and v,

mu = (1/N) ∑i=1N ui
mv = (1/N) ∑i=1N vi
ssqu = ∑i=1N (uimu)2
ssqv = ∑i=1N (vimv)2
correlation (u, v) = ∑i=1N (uimu) · (vimv) / √(ssqu · ssqv)

Links to this page


© Paul Boersma 2023