Add function to compute pca for a given dimension / number of eigenvectors