def integrate_kde(self, other):
if other.d != self.d:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if other.n < self.n:<EOL><INDENT>small = other<EOL>large = self<EOL><DEDENT>else:<EOL><INDENT>small = self<EOL>large = other<EOL><DEDENT>sum_cov = small.covariance + large.covariance<EOL>sum_cov_chol = linalg.cho_factor(sum_cov)<EOL>result = <NUM_LIT:0.0><EOL>for i in range(small.n):<EOL><INDENT>mean = small.dataset[:, i, newaxis]<EOL>diff = large.dataset - mean<EOL>tdiff = linalg.cho_solve(sum_cov_chol, diff)<EOL>energies = sum(diff * tdiff, axis=<NUM_LIT:0>) / <NUM_LIT><EOL>result += sum(exp(-energies), axis=<NUM_LIT:0>)<EOL><DEDENT>result /= sqrt(linalg.det(<NUM_LIT:2> * pi * sum_cov)) * large.n * small.n<EOL>return result<EOL>
Computes the integral of the product of this  kernel density estimate
with another.

Parameters
----------
other : gaussian_kde instance
    The other kde.

Returns
-------
value : scalar
    The result of the integral.

Raises
------
ValueError
    If the KDEs have different dimensionality.