Calculates Pearson's Linear Correlation Coefficient.
An input series.
An input series
A number, the correlation coefficient.
W1: gsin(100, .01, 4)
W2: gsin(100, .01, 4, pi/3)
pearson(gsin(100, 0.01, 2), gcos(100, 0.01, 2))
Pearson’s correlation coefficient for a population is defined as the covariance of two variables divided by the product of their standard deviations:
By substituting the sample estimates of the covariance and standard deviations, the sample correlation coefficient computed by PEARSON becomes:
where the arithmetic mean is defined as:
PEARSON returns the degree of linear correlation between the two input series. The result ranges from -1 to 1.
PEARSON assumes X and Y have the same number of points.
See LINREG2 to fit a line to X and Y values using the method of least squares.