0

I'm trying to use T-squared distribution (by hand) in my pca analysis. It's purpose is diagnostics after dimensional reduction.

M=self.PCA_red.shape[1]
N=self.PCA_red.shape[0]
F=scipy.stats.f.ppf(0.95,M,N-M) 
self.T2lim=(M*(N-1)/(N-M))*F
for i in range(self.PCA_red.shape[0]):
    self.T2.append(self.PCA_red[i].dot(inv(self.cov_mat)).dot(self.PCA_red[i].T))

PCA_red is reduced data from (236,8) to (236,4) so first covariance matrix had (8,8). How do I calculate a new covariance matrix T-squared distribution? Should I calculate it from reduced data? Could someone explain that to me?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alex Max
  • 1
  • 1
  • You can do PCA on the new distribution but you need to be really careful that your eigenvalues are small – Alexander McFarlane Sep 11 '18 at 22:31
  • I don't fully understand, you mean that I can calculate new covariance matrix base on reduced (236, 4) data? I was wondering about it because after pca there should be mostly uncorralated data – Alex Max Sep 11 '18 at 23:00

0 Answers0