How can I calculate the sum of square deviations between two normalized price series according to (Gatev et. co 2006)? My normalized price series of stocks $X$ and $Y$ consist of the cumulative total daily (log) returns of adjusted close series for stock data taken from Yahoo Finance.
According to some research on the internet it seems I am to:
Divide the time series of the share prices by the price on the first day of the pairs identification period and then subtract the two new time series from each other, square these differences and sum the result. The smaller the value, the more likely the two stocks are to be a good pair.
If that were the case, I would end up with the formula:
$$SSD=\sum(\frac{x_1,x_2,..,x_n}{x_1}-\frac{y_1,y_2,..,y_n}{y_1})^2$$ Where $X=(x_1,x_2,..x_n)$ and $Y=(y_1,y_2,..y_n)$ are stock price series.
But according to other research, sum of squared deviations refers simply to sum of squares, so then the formula is: $$SS = \sum((x_1,x_2,..,x_n)-\frac{x_1+x_2+..+x_n}{n})^2,or\sum(X-\bar{X})^2$$ But how would I incorporate $Y$ into the second one? Subtract the two results so $SS(X)-SS(Y)$?
If anyone could shed some light on the issue, that'd be fantastic!
Thanks.