lcls-users / btx

BeamTime with X-rays - miscellaneous functions for aiding analysis during LCLS experiments.
https://lcls-users.github.io/btx/
Other
1 stars 12 forks source link

Included V matrix in PiPCA model #333

Closed russell-marasigan closed 1 year ago

russell-marasigan commented 1 year ago

Changes

Note: changes were only made on the pipca.py script

Algorithm used to update V

Let Ui, Si, and Vii be the matrices obtained from iPCA to model batch Xi. Also, let Ui+1 and Si+1 be the matrices obtained from the parallel QR algorithm for the next batch Xi+1. We can find the next Vi+1i+1 with the standard SVD assumption that Xi+1 = Ui+1 Si+1 Vi+1i+1. And $\forall j \in [0, i]$ we can update the previous Vji+1 batch by defining it to be the matrix that satisfies Xj = Ui+1 Si+1 Vji+1. Once we have all Vji+1 and Vi+1i+1, we can obtain the overall Vi+1 by simply concatenating the Vji+1 and Vi+1i+1. So, Vi+1 = [V0i+1 V1i+1 ... Vii+1 Vi+1i+1].

I could make a more formal write-up and attach it here before merging, if you would like.

Future Actions