def log_pdf(self, X):
        if not type(X) is numpy.ndarray:
            raise TypeError("X must be a numpy array")
        
        if not len(X.shape) is 2:
            raise TypeError("X must be a 2D numpy array")
        
        # this also enforce correct data ranges
        if X.dtype != numpy.bool8:
            raise ValueError("X must be a bool8 numpy array")
        
        if not X.shape[1] == self.dimension:
            raise ValueError("Dimension of X does not match own dimension")

        result = repmat(self.ps, len(X), 1)
        idx = X == 0
        result[idx] = result[idx] - 1
        
        return sum(log(result), 1)
dataset/ETHPy150Open karlnapf/kameleon-mcmc/kameleon_mcmc/distribution/Bernoulli.py/Bernoulli.log_pdf/swapped operands of `-`