Linear Time Regression: Coefficient of Correlation (r)

Abbreviation: LinTimeReg r
Category: Regression

Input Parameters:

Name Range Default
Time Series Close
Regression Periods Int >= 3 10

 
Calculation:

[ n * sum(X*Y) – sum(X) * sum(Y) ]

sqrt ( [n * sum(X*X) – sum(X) * sum(X)] * [n * sum(Y*Y) – sum(Y) * sum(Y)] )

where
sum(X*X) = sum of X*X over the last n periods
sum(Y*Y) = sum of Y*Y over the last n periods
sum(X*Y) = sum of X*Y over the last n periods
sum(X) = sum of X over the last n periods
sum(Y) = sum of Y over the last n periods

X = Period Number
Y = Time Series
n = Regression Periods

 
Discussion:

Computes the coefficient of correlation (r) for the linear regression line. The coefficient correlation is a measure of the degree of linear correlation between the time series and time. The closer the value is to one, the stronger the positive correlation. The closer the value is to negative one, the stronger the negative correlation. A value of zero indicates a lack of correlation.
 

Was this article helpful?

Related Articles