User:BrotherE/CorrelationPseudocodeInLaTeXMath

The pseudocode for the numerically stable sample correlation coefficient rewritten in common math:

$$ m_{x,i} = \begin{cases} x_1 & i=2 \\ m_{x,i-1}+(x_i-m_{x,i-1})/(i-1) & i>2 \end{cases} $$

$$ m_{y,i} = \begin{cases} y_1 & i=2 \\ m_{y,i-1}+(y_i-m_{y,i-1})/(i-1) & i>2 \end{cases} $$

$$ \rho=\frac {\sum_{i=2}^{N}{(x_i-m_{x,i})(y_i-m_{y,i})\frac{i-1}{i}}} { \sqrt{\sum_{i=2}^{N}{(x_i-m_{x,i})(x_i-m_{x,i})\frac{i-1}{i}}} \sqrt{\sum_{i=2}^{N}{(y_i-m_{y,i})(y_i-m_{y,i})\frac{i-1}{i}}} } $$