def _covariance_matrix ( self , type = 'noise' ) : if type == 'sampling' : return self . sigma ** 2 / ( self . n - 1 ) elif type == 'noise' : return 4 * self . sigma * N . var ( self . rotated ( ) , axis = 0 )
how to generate covariance matrix python
Constructs the covariance matrix from PCA residuals
def _covariance_matrix(self, type='noise'):
        """
        Constructs the covariance matrix from PCA
        residuals
        """
        if type == 'sampling':
            return self.sigma**2/(self.n-1)
        elif type == 'noise':
            return 4*self.sigma*N.var(self.rotated(), axis=0)