Skip to main content
. Author manuscript; available in PMC: 2021 Mar 11.
Published in final edited form as: Biometrics. 2020 May 4;77(1):91–101. doi: 10.1111/biom.13272

Algorithm 2:

The ZIPFA cross-validation algorithm in tth fold

Matrix An×m is to be decomposed to κ factors.
Initialize:
(1) Let A˜ be the same matrix as A but all 0’s and elements corresponding to Id[t] are replaced by the column mean of rest values;
(2) Apply SVD to ln (A˜) to obtain the components Uold and Vold;
(3) Calculate relative row sum N without elements corresponding to Id[t];
(4) Eliminate the elements with index Id[t] in A(v) (or A(u)) and note down their locations. Cross out elements in N(v) (or N(u)) on the corresponding location.
Update:
This part remains the same as regular ZIPFA algorithm described before.
CV likelihood:
(5) Obtain Λ(fit) = U(final)V(final)⊤ and calculate P(fit) = −τΛ(fit).
(6) Use the distribution assumption in Section 2.1 to calculate the likelihood of elements in A with index Id[t] and sum them up.