Serving the Quantitative Finance Community

 
User avatar
TedSpread
Topic Author
Posts: 0
Joined: October 12th, 2005, 5:23 pm

How fast is standard PCA??

April 6th, 2006, 1:34 pm

basic question - thanks for any input!Let's say i have 1 dependent and 1,000 independents and time series for each of them going back 250 days. how quickly can i fit my dependent with the 5 most important components out of the 1,000 - including their weights? is this a mathematically feasible problem to solve?
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

How fast is standard PCA??

April 7th, 2006, 8:40 am

Problem is calculating Eigenvalues and Eigenvectors for 1,001x1,001 matrix. what is the nature of the data (equity prices)? Even with equity prices I think you will find that reducing the dimension of the problem somewhat will not impact the results massively. Numerical recipes in C explains how to go about calculating the Eigenvalues etc.
 
User avatar
TedSpread
Topic Author
Posts: 0
Joined: October 12th, 2005, 5:23 pm

How fast is standard PCA??

April 7th, 2006, 2:09 pm

thanks - it sounds to me - without reducing the dimensions that this is extremely costly in terms of time to calculate. can anybody give me a ballpark number as to what we are talking about. weeks, months or years on one normal pc?i know the problem can be solved numerically through optimization - but i want to get to the true raw cost first.thank you
 
User avatar
Jim
Posts: 1
Joined: February 1st, 2002, 5:20 pm

How fast is standard PCA??

April 7th, 2006, 3:17 pm

I would estimate the compute time to be only a few hours.We have a system that computes the eigenvalues/eigenvectors of a dataset consisting of about 500 data rows with 120 variables each in less than 2 seconds and doing PCA on a 360 x 360 covariance matrix takes about 45 seconds. I believe the algorithm we use is O(N^3), so total time (assuming the covariance matrix fits in memory) would be approx 2 * (10^3) = 2000 seconds or 33.3 minutes.As the dataset gets bigger and bigger, your virtual memory paging to/from disk becomes the bottleneck, not the matrix calculations. But for something like 1000 x 1000, I think this could be done in a couple of hours.
 
User avatar
TedSpread
Topic Author
Posts: 0
Joined: October 12th, 2005, 5:23 pm

How fast is standard PCA??

April 7th, 2006, 3:49 pm

thank you - this is helpful
 
User avatar
Errrb
Posts: 0
Joined: December 17th, 2002, 4:18 pm

How fast is standard PCA??

April 7th, 2006, 7:47 pm

QuoteOriginally posted by: TedSpreadbasic question - thanks for any input!Let's say i have 1 dependent and 1,000 independents and time series for each of them going back 250 days. how quickly can i fit my dependent with the 5 most important components out of the 1,000 - including their weights? is this a mathematically feasible problem to solve?In your example the time is close to 0, since the rank of your matrix is 250. You sould do SVD and then you will end up with finding eigenvectors of 250x250 matrix, which is nothing.