# Calculating the Sum of Squared Deviations between two Normalized Price Series

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.

• Try both methods. There is no correct answer. – user2763361 Jan 27 '14 at 4:09
• Alright, I've chosen to go with the first equation according to a UBS Monograph. Thanks. – Travis Liew Jan 27 '14 at 7:15
• To refine what I said, the best method is the one that is best according to cross-validation. You only start having to worry about what is best a priori if you start fitting to your test set by trying too many approaches. – user2763361 Jan 27 '14 at 8:20