Evaluate performance of PC estimates compared to true PC values
References
Li, Z., Meisner, J., & Albrechtsen, A. (2023). Fast and accurate out-of-core PCA framework for large scale biobank data. Genome Research, 33(9), 1599-1608. doi:10.1101/gr.277525.122 .
Examples
hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, `+`) }
X <- hilbert(9)[, 1:6]
k = 4
# Compute SVD using two methods
dcmp <- svd( scale(X), k, k)
res <- PCAstream( X, k=k)
#> Scale and centering...
#>
Epoch 0 / 7
Epoch 1 / 7
Epoch 2 / 7
Epoch 3 / 7
Epoch 4 / 7
Epoch 5 / 7
Epoch 6 / 7
Epoch 7 / 7
Final decompositions
Completed
# Mean variance explained is 1
perfMetric(dcmp$u, res$u, metric = "MEV")
#> [1] 1
# minimum of sum of squared errors zero
perfMetric(dcmp$u, res$u, metric = "minSSE")
#> [1] 4.354012e-27