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 (ui − mu)2

ssqv = ∑i=1N (vi − mv)2

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

### Links to this page

- Functions
- What was new in 6.4?