Difference in variance of factor scores for supplementary and active observations PCA I've been trying to find an answer to this but I haven't been successful. I encounter a problem when adding supplementary individuals to PCA. The variance of the factor scores decreases dramatically when adding supplementary observations.
I am doing a PCA in R on genome data. The data table has 1645 rows (individuals) and 23,446 columns (SNPs). I use a subset of 103 rows to do the PCA and then project the remaining individuals on the PCA using the eigenvector matrix.
I first standardize the matrix by subtracting the column means. I also subtract these column means from the columns of the whole sample.
Taking into account that the number of columns largely exceed the number of rows I then perform the Eigen decomposition on $XX^t$ and then multiply the obtained eigenvector matrix by $X^t$ to obtain the Eigenvector/loadings matrix of $X^tX$.
I then multiply the loadings matrix with (1) the matrix of the 'active' individuals, and (2) the complete matrix (the whole sample).
Now my problem: the variance of the factor scores for the 'active' individuals (red) far exceeds the variance of the factor scores for the whole sample. (~ by a factor of 10, variances take values 114 and 12 respectively). I would have expected the variances to be almost the same or rather the variance for the whole sample to be bigger. I've been looking for an explanation for quite a while now and I get the feeling that I am stuck. Anyone can help me out? I highly appreciate any hint!
My Code
    # standardize matrix by subtracting comlumn means
    genos100.diff<- apply(genos100, 2, function(x) x-mean(x))       
  

    #subtract same column mean from the whole sample
    
    one <- rep(1, nrow(genos.ctrl))
    colmeans <- colMeans(genos100)
    
    genos.ctrl.diff <- genos.ctrl- one%*%t(colmeans)
    
    #compare variances
    
    apply(genos100.diff[,1:10],2, function(x) var(x))
      
    
    apply(genos.ctrl.diff[,1:10],2, function(x) var(x))
    
    # variances consisent
    ####################
    #compute xxt
    xxt <- genos100.diff%*%t(genos100.diff)
    
    
    # eigendecomposition of xxt
    evv <- eigen(xxt, symmetric=TRUE)
    # 
    # eigenvectors of xxt/scores/ matrix F
    pcs <- evv$vectors[,1:5] # 103 rows
    
    
    
    # get eigenvalues
    evals <- evv$values[1:5]
    
    
    
    #### Get loadings/ pcs of xtx/ Q
    # compute the transform of the eigenvector matrix  Qt and normalize
    
    btr <- diag(1/sqrt(evals))%*%t(pcs)%*%genos100.diff
    
    # apply to active individuals, obtain scores
    
    pcs_active <-genos100.diff%*%t(btr)
    
    # Get scores for supplementary individuals 
    pcs_suppl <- genos.ctrl.diff%*%t(btr)
    
    
    # compute variances of the first principal component
    
    ##                
    var(pcs_active[,1]) # 114.0419
    var(pcs_suppl[,1])  # 12.76595

 A: I am not very familiar with R, but from the problem description I do not see anything surprising. You do your PCA on 103 "active" data points and find the first principle component (PC1) that explains most of the variance. This means that when you project your 103 "active" data points onto this PC1 direction you get the largest possible variance $Var(z) = \frac{1}{102}\Sigma_{i=1}^{103} z_i^2 $, where $z_i$ are the projections. Now when you project the whole dataset (1645 data points) onto the same direction, the variance is given by $Var(z) = \frac{1}{1644}\Sigma_{i=1}^{1645} z_i^2$, and this can easily be smaller than before.
I strongly suspect that your "active" PC1 explains very little variance of the "passive" data points. In this case your "passive" data points would have a very different PC1, and PC1 calculated on the whole data set would also be quite different from the one you get from the "active" data points only.
But this is not necessarily so: it can also be that all the "passive" data points are located close to zero, and so don't contribute much to the variance, whereas division by 1644 instead of 102 makes the variance decrease 10-fold.
