Skip to content
Prev 17331 / 398513 Next

Avoiding the mean

Dear list,

what is the fastest way to compute a multivariate mean and cov-matrix? I
presume that the mean is computed in cov, so it may be a waste of time to
compute the mean first and then a second time inside of cov. Is it faster
to use cov.wt, which gives cov-matrix and center?
And: If mean and cov should be computed on a part of the data, is it faster 
to use cov.wt with some weights zero, or should cov (or cov.wt) be computed
on a subset?

Best,
Christian