Dynamic PCA

Little swap, will you be nice and tell me please, what is your price?
User avatar
Nonius
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by Nonius »

In fact it's the higher orders I was looking at!
Chiral is Tyler Durden
User avatar
ronin
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by ronin »

Fair enough. You have done the calcs and I haven't, so I'll shut up now... Wink
"There is a SIX am?" -- Arthur
User avatar
FatChoi
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by FatChoi »

Looking at this as a way of determining an APT style factor decomposition, if the model is stationary the best estimator will be the longest sample available.

If the model is not stationary, what is happening? A simple thing would be stationary weightings on GARCHy factors. I think this would give more salient factors than might seem reasonable from a typical PCA analysis and the best estimators would need a long sample to estimate GARCH parameters than only become visible occasionally. It would of course also require a state estimator. This could be interpreted as a stable long term structure requiring highfrequency current state estimator. I found nice discussions of GARCH type covariance estimators here and here.

When things get this complicated is the covariance matrix still an effective summary of the joint distribution of returns?
User avatar
ronin
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by ronin »

Nonius, you have got me intrigued with this - enough to do the perturbation calc myself.



Bottom line is:



- the eigenvalues and eigenvectors come out as nice and smooth functions of slow time, without finite time singularities.



- the problem is that when the eigenvalues and eigenvectors evolve, the eigenvalue that started as the smallest may grow over time, and another eigenvalue may shrink. When two such eigenvalues cross, your PCA vector shifts discontinuously from the eigenvector of one eigenvalue to the eigenvector of another eigenvalue.



Does that make sense in terms of what you are seeing?



r
"There is a SIX am?" -- Arthur
User avatar
Nonius
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by Nonius »

ronin, for the eigenvectors associated with "low" eigenvalues, there is definitely a risk that things could cross because I do not believe you can "choose" in a consistent manner the "kth" PCA. for example, suppose we are talking about a 10x10 matrix and we want to look at the eigenvectors of the last 5 smallest eigenvalues, call it at time t v6(t)...v10(t). Then, for example, what does it mean for us to specify v8(t)? at time s do we assign a "random path" from v8(t) to v8(s) or is it more natural to associate v9(t) with v8(s)? maybe this is what you're talking about? in the 2x2 case this doesn't really happen as the first PCA you could think of as a sort of "momentum" direction and the second is sort of a mean reverting direction, and those don't really cross for obvious reasons.



one way to avoid the lack of knowledge of how to see those low eigenvectors being ordered would be to concentrate on the high PCA, then just say you're interested in the orthogonal complement of the high PCA in one fell swoop. that's basically like looking at the "residual risk" component. I looked into that but there are other complexities that arise doing that.
Chiral is Tyler Durden
User avatar
EspressoLover
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by EspressoLover »

@Nonius



Quick and dirty approach. Roll a N-window PCA for [[T, T+N],[T+1,T+N+1], ...]. For a large enough N relative to sample time, the period-to-period change in PCA eigenvectors should be sufficiently smooth. It should be trivial to map the eigenvectors at time T to its counterpart at time T+1 simply by looking at the cross-correlation of projections in the common dataset [T+1, T+N]. Even if eigenvector ranks change, just follow the map. You could even get a little fancier by setting a correlation threshold where you assume an eigenvector has "dropped out".
Good questions outrank easy answers. -Paul Samuelson
User avatar
EspressoLover
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by EspressoLover »

> In-sample and out-of-sample the r-sq was through the roof. Residuals were non-existent. Then I looked at the stability of the coefficients and it was clear that it was not worth trying to reap the benefit of the explanatory power.



Best guess to what was happening here: as sampling frequency increases correlations start to fall to 0. Price-discreteness and microstructures effects dominate over smooth stochastic diffusion. At sub-second intervals, you're mostly modeling which stocks are ticking together. Particularly thick-book, low-priced stocks. The dynamic eigenvectors are proxying large-scale portfolios that are currently rebalancing.



E.g. say [IBM, MSFT and AAPL] are highly correlated on a low-frequency basis. But currently there's a large rebalancing portfolio that's concentrated in IBM and MSFT, but not AAPL. The execution algo is probably sending orders at the same time for IBM and MSFT. AAPL will re-converge, but it will take time for price-discovery to disperse across symbols. Sampled at high-enough frequency you'll see a high cross-correlation at that time for IBM-MSFT, but low for AAPL-IBM/MSFT.



A simple way to make money off this might be to check for eigenvectors that persistently form at certain times of day or at common rebalance times (e.g. on the hour, end of month, etc.). Large portfolios often trade on fairly predictable schedules. By the time the dynamic eigenvector appears in your Kalman filter its probably too late to monetize it. but if you can reliably predict a similar eigenvector at the same time tomorrow, then you can get in front of it. Particularly if you can predict its directional bias.
Good questions outrank easy answers. -Paul Samuelson
User avatar
NeroTulip
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by NeroTulip »

The low eigenvalues/eigenvectors are very unstable because of estimation error (see Macenko-Pastur) and non-stationarity. Only a handful of eigenvalues are significant (1? 3?, 5?), with their corresponding eigenvectors drifting slowly enough in time to be useful. In my tests, correl(v1[t], v1[t+1]) was 90%+, but correl(v10[t],v10[t+1]) was ~0
Inflatable trader
User avatar
ronin
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by ronin »

Nonius,



In some respect this is now analogous to worst-of options or first-to-defaults.



The question really shouldn't be "what is my lowest eigenvalue", it should be "what is the probability that this eigenvalue will be the lowest over the period I am interested in".



In the textbook stationary example it is (100%, 0, 0 ....), but in reality it is (delta1, delta2, ....)



I.e. you have a delta wrt each eigenvalue, with the associated cross gammas, you are tracking them all, and you adjust your trading to account for the deltas and the cross gammas.





Your last point - I don't think that will lead anywhere. There is no difference between looking at 5 lowest eigenvalues and the complement of 5 highest eigenvalues.
"There is a SIX am?" -- Arthur
User avatar
afekz
Posts: 1
Joined: Thu Jan 01, 2004 12:00 am

Dynamic PCA

Post by afekz »

ronin wrote:

"Your last point - I don't think that will lead anywhere. There is no difference between looking at 5 lowest eigenvalues and the complement of 5 highest eigenvalues."

I think (suspect?) that the point was more that one should look at them collectively ("one fell swoop"), rather than doing anything that assumes that there's structure outside the top 5: "5 lowest" becomes "a residual".
Post Reply