'Returns the leave-one-out likelihood function.
The leave-one-out likelihood function for the unconditional KDE.
Parameters
bw: array_like
The value for 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``.
Notes
The leave-one-out kernel estimator of :math:`f_{-i}` is:
.. math:: f_{-i}(X_{i})=\frac{1}{(n-1)h}
\sum_{j=1,j\neq i}K_{h}(X_{i},X_{j})
where :math:`K_{h}` represents the generalized product kernel
estimator:
.. math:: K_{h}(X_{i},X_{j}) =
\prod_{s=1}^{q}h_{s}^{-1}k\left(\frac{X_{is}-X_{js}}{h_{s}}\right)'

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

    LOO = LeaveOneOut(self.data)
    L = 0
    for (i, X_not_i) in enumerate(LOO):
        f_i = gpke(bw, data=(- X_not_i), data_predict=(- self.data[i, :]), var_type=self.var_type)
        L += func(f_i)
    return (- L)
