Home:ALL Converter>Rolling window PCA in python

Rolling window PCA in python

Ask Time:2020-06-05T06:06:39         Author:Jacob Steinebronn

Json Formatter

I'm wondering if anyone knows how to implement a rolling/moving window PCA that reuses the calculated PCA when adding and removing measurements.

The idea is that I have a large set of data (measurement) over a very long time, and I would like to have a moving window (say, 200 days) starting at the beginning of my dataset and each step, I include the next day's measurement and throw out the last measurement, so my window is always 200 days long. However, I would not like to simply recalculate the PCA each time.

Is it possible to make an algorithm that is more efficient than simply calculating the PCA for each window independently? Thanks in advance!

Author:Jacob Steinebronn,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62204963/rolling-window-pca-in-python
yy