LARGE covariance matrix in R -
from gene look info (40000 genes (variables) x 30 observation) want create 40000 x 40000 covariance matrix. larger ram. bundle 'ff' managed preallocate 40000x40000 empty matrix correlations. 'cov' or 'cor' function manage 5000x5000 covariance matrix on system, have blockwise 1:5000, 5001:10000 etc covariance calculations , fill preallocated matrix along diagonal. know of algorithm fill "missing patches" in matrix, i.e. covariance (or correlation between) 1 , 22000. know can pairwise combinations , fill in matrix one-by-one, 'cor' quite fast... so, there way calculate cov (or cor) of 1/22000 using calculated covariances?
thanks in advance!
you can utilize cov 2 arguments compute off-diagonal blocks.
cov( x[,1:5000], x[,5001:10000] ) r covariance
No comments:
Post a Comment