next up previous contents
Next: sumnan.m Up: Some Changes in the Previous: bpinit.m


Nanpca.m replaces basicpca.m. It does principal component analysis with missing values as on page [*].
% Remove the means from the data and calculate covariance matrix
[su, n] = sumnan(x, 2);
% average b is removed
b = su ./ n;
xn = x - repmat(b, 1, size(x, 2));
covm = covnan(x');

Tapani Raiko