copulas/multivariate/gaussian.py
def _get_covariance(self, X):
        """Compute covariance matrix with transformed data.

        Args:
            X: `numpy.ndarray` or `pandas.DataFrame`.

        Returns:
            np.ndarray

        """
        result = pd.DataFrame(index=range(len(X)))
        column_names = self.get_column_names(X)
        for column_name in column_names:
            column = self.get_column(X, column_name)
            distrib = self.distribs[column_name]

            # get original distrib's cdf of the column
            cdf = distrib.cumulative_distribution(column)

            if distrib.constant_value is not None:
                # This is to avoid np.inf in the case the column is constant.
                cdf = np.ones(column.shape) - EPSILON

            # get inverse cdf using standard normal
            result = self.set_column(result, column_name, stats.norm.ppf(cdf))

        # remove any rows that have infinite values
        result = result[(result != np.inf).all(axis=1)]
        return pd.DataFrame(data=result).cov().values
Compute covariance matrix with transformed data.

        Args:
            X: `numpy.ndarray` or `pandas.DataFrame`.

        Returns:
            np.ndarray

        
Compute covariance matrix with transformed data.
Compute covariance matrix with transformed data .
def _get_covariance(self, X):
        result = pd.DataFrame(index=range(len(X)))
        column_names = self.get_column_names(X)
        for column_name in column_names:
            column = self.get_column(X, column_name)
            distrib = self.distribs[column_name]
            cdf = distrib.cumulative_distribution(column)
            if distrib.constant_value is not None:
                cdf = np.ones(column.shape) - EPSILON
            result = self.set_column(result, column_name, stats.norm.ppf(cdf))
        result = result[(result != np.inf).all(axis=1)]
        return pd.DataFrame(data=result).cov().values
def _get_covariance ( self , X ) : result = pd . DataFrame ( index = range ( len ( X ) ) ) column_names = self . get_column_names ( X ) for column_name in column_names : column = self . get_column ( X , column_name ) distrib = self . distribs [ column_name ] cdf = distrib . cumulative_distribution ( column ) if distrib . constant_value is not None : cdf = np . ones ( column . shape ) - EPSILON result = self . set_column ( result , column_name , stats . norm . ppf ( cdf ) ) result = result [ ( result != np . inf ) . all ( axis = 1 ) ] return pd . DataFrame ( data = result ) . cov ( ) . values
Compute covariance matrix with transformed data.
Compute covariance matrix with transformed data .
"""Compute covariance matrix with transformed data.

        Args:
            X: `numpy.ndarray` or `pandas.DataFrame`.

        Returns:
            np.ndarray

        """ # get original distrib's cdf of the column # This is to avoid np.inf in the case the column is constant. # get inverse cdf using standard normal # remove any rows that have infinite values
None
self
X
`numpy.ndarray` or `pandas.DataFrame`.
` numpy . ndarray ` or ` pandas . DataFrame ` .