code: def covariance_matrix(self):
      
  
      a = N.dot(self.U,self.sigma)
      cv = N.dot(a,a.T)
      # This yields the covariance matrix in Cartesian
      # coordinates
      return cv
docs: Constructs the covariance matrix of
      input data from
      the singular value decomposition. Note
      that this is different than a covariance
      matrix of residuals, which is what we want
      for calculating fit errors.
  
      Using SVD output to compute covariance matrix
      X=UΣV⊤
      XX⊤XX⊤=(UΣV⊤)(UΣV⊤)⊤=(UΣV⊤)(VΣU⊤)
      V is an orthogonal matrix (V⊤V=I),
      covariance matrix of input data: XX⊤=UΣ2U⊤
  
       Because the axes represent identity in the
       PCA coordinate system, the PCA major axes
       themselves represent an affine transformation
       matrix from PCA to Cartesian space