'Returns the leave-one-out conditional likelihood of the data.
If `func` is not equal to the default, what\'s calculated is a function
of the leave-one-out conditional likelihood.
Parameters
bw: array_like
The bandwidth parameter(s).
func: callable, optional
Function to transform the likelihood values (before summing); for
the log likelihood, use ``func=np.log``.  Default is ``f(x) = x``.
Returns
L: float
The value of the leave-one-out function for the data.
Notes
Similar to ``KDE.loo_likelihood`, but substitute ``f(y|x)=f(x,y)/f(x)``
for ``f(x)``.'

def loo_likelihood(self, bw, func=(lambda x: x)):

    yLOO = LeaveOneOut(self.data)
    xLOO = LeaveOneOut(self.exog).__iter__()
    L = 0
    for (i, Y_j) in enumerate(yLOO):
        X_not_i = next(xLOO)
        f_yx = gpke(bw, data=(- Y_j), data_predict=(- self.data[i, :]), var_type=(self.dep_type + self.indep_type))
        f_x = gpke(bw[self.k_dep:], data=(- X_not_i), data_predict=(- self.exog[i, :]), var_type=self.indep_type)
        f_i = (f_yx / f_x)
        L += func(f_i)
    return (- L)
