Time Series – PCA on Prices or Returns

covariancepcastationaritytime series

This question has been addressed here: Can Principal Component Analysis be used on stock prices / non-stationary data?

In his answer Jon Egil wrote

please make sure you analyse returns not prices

and referenced a paper by Attilio Meucci. In another of Attilio Meucci's papers (which is very nice incidentally), Review of Statistical Arbitrage, Cointegration, and Multivariate Ornstein-Uhlenbeck (2009) Attilio applies PCA to prices (or in this case yields) rather than returns. He even supplies code and data here.

Even just looking at the code you can see he measures the covariance and then applies the PCA directly to this matrix. The results he gets are good, producing the level, slope and curve you would expect.

So it seems that in some cases PCA can be applied successfully to prices.

  1. I'd just like to understand better when it can be applied to prices and what it can't? Is this case was the detrending inherent in the covariance estimation sufficient to produce stationarity?

  2. What are the best tests to apply to whether a particular time-series is suitable for PCA analysis or not?

Best Answer

You can't apply PCA directly to price data. However, if you assume that a linear combination of your stocks is co-integrated, than you'll have a process $Y = Xw$ that is stationary.

If $Y$ is (cov)-stationary (let's not require strict stationarity), we can go forward and say that $Cov(Y) = Cov(Xw)$ over which we can apply the principal component factorization. We could not do that without the assumption of co-integration: "A time series is said to be covariance stationary if its mean and variance do not change over time" (ref). This means that we can drop "time" for the equation and generalize our results outside the span of the time-series.

PCA and cointegration go hand in hand: having applied a linear transformation on the data allows us to select the hedge-ratio as the eigenvector corresponding to the biggest eigenvalue.

Going back to your questions: PCA can be applied in case of co-integration.