def __init__(self, variables, mean, cov):
        """
        Parameters
        ----------
        variables: iterable of any hashable python object
            The variables for which the distribution is defined.

        mean: list, array-like
            1-D array of size n where n is the number of variables.

        cov: n x n, 2-D array like
            n x n dimensional matrix where n is the number of variables.

        Examples
        --------
        >>> import numpy as np
        >>> from pgmpy.factors.distributions import GaussianDistribution as GD
        >>> dis = GD(variables=['x1', 'x2', 'x3'],
        ...          mean=np.array([1, -3, 4]),
        ...          cov=np.array([[4, 2, -2],
        ...                        [2, 5, -5],
        ...                        [-2, -5, 8]]))
        >>> dis.variables
        ['x1', 'x2', 'x3']
        >>> dis.mean
        array([[ 1],
               [-3],
               [4]]))
        >>> dis.cov
        array([[4, 2, -2],
               [2, 5, -5],
               [-2, -5, 8]])
        >>> dis.assignment([0, 0, 0])
        0.0014805631279234139
        """
        no_of_var = len(variables)

        self.variables = variables
        self.mean = np.asarray(np.reshape(mean, (no_of_var, 1)), dtype=float)
        self.covariance = np.asarray(cov, dtype=float)
        self._precision_matrix = None

        if len(mean) != no_of_var:
            raise ValueError("Length of mean_vector must be equal to the",
                             "number of variables.")

        if self.covariance.shape != (no_of_var, no_of_var):
            raise ValueError("The Covariance matrix should be a square matrix",
                             " with order equal to the number of variables. ",
                             "Got: {got_shape}, Expected: {exp_shape}".format
                             (got_shape=self.covariance.shape,
                              exp_shape=(no_of_var, no_of_var)))
def __init__ ( self , variables , mean , cov ) : no_of_var = len ( variables ) self . variables = variables self . mean = np . asarray ( np . reshape ( mean , ( no_of_var , 1 ) ) , dtype = float ) self . covariance = np . asarray ( cov , dtype = float ) self . _precision_matrix = None if len ( mean ) != no_of_var : raise ValueError ( "Length of mean_vector must be equal to the" , "number of variables." ) if self . covariance . shape != ( no_of_var , no_of_var ) : raise ValueError ( "The Covariance matrix should be a square matrix" , " with order equal to the number of variables. " , "Got: {got_shape}, Expected: {exp_shape}" . format ( got_shape = self . covariance . shape , exp_shape = ( no_of_var , no_of_var ) ) )
Parameters
        ----------
        variables: iterable of any hashable python object
            The variables for which the distribution is defined.

        mean: list, array-like
            1-D array of size n where n is the number of variables.

        cov: n x n, 2-D array like
            n x n dimensional matrix where n is the number of variables.

        Examples
        --------
        >>> import numpy as np
        >>> from pgmpy.factors.distributions import GaussianDistribution as GD
        >>> dis = GD(variables=['x1', 'x2', 'x3'],
        ...          mean=np.array([1, -3, 4]),
        ...          cov=np.array([[4, 2, -2],
        ...                        [2, 5, -5],
        ...                        [-2, -5, 8]]))
        >>> dis.variables
        ['x1', 'x2', 'x3']
        >>> dis.mean
        array([[ 1],
               [-3],
               [4]]))
        >>> dis.cov
        array([[4, 2, -2],
               [2, 5, -5],
               [-2, -5, 8]])
        >>> dis.assignment([0, 0, 0])
        0.0014805631279234139