$\mathbf{Y}$. Although $\mathbf{Y}$ is discrete, $f_{XY}=f_{Z}$ is also a density. Let $\mathcal{S}_{X}$ be the support of the density $f_{X}$ and $\mathcal{S}_{Y}$ be the support of the probability mass function $f_{Y}$. The MI is $$\begin{aligned}
 & \lefteqn{G_{2}\left(\mathbf{X};\mathbf{Y}\right)}\nonumber \\
 & = & \sum_{y\in\mathcal{S}_{Y}}\int g\left(\frac{f_{X}(x)f_{Y}(y)}{f_{XY}(x,y)}\right)f_{XY}(x,y)dx\label{eq:MI_cond}\\
 & = & \sum_{y\in\mathcal{S}_{Y}}f_{Y}(y)\int g\left(\frac{f_{X}(x)}{f_{X|Y}(x|y)}\right)f_{X|Y}(x|y)dx.\nonumber \end{aligned}$$

Let $\mathbf{N}_{y}=\sum_{i=1}^{N}1_{\left\{ \mathbf{Y}_{i}=y\right\} }$ where $y\in\mathcal{S}_{Y}$. Let $\ft X$ be as in (\[eq:fx\]) and define $\mathcal{X}_{y}=\left\{ \mathbf{X}_{i}\in\left\{ \mathbf{X}_{1},\dots,\mathbf{X}_{N}\right\} |\mathbf{Y}_{i}=y\right\} $. Then if $\mathbf{X}_{i}\in\mathcal{X}_{y}$, the KDE of $f_{X|Y}(x|y)$ is $$\begin{aligned}
\ft{X|y}(\mathbf{X}_{i}) & = & \frac{1}{\left(\mathbf{N}_{y}-1\right)h_{X|y}^{d_{X}}}\sum_{\substack{\mathbf{X}_{j}\in\mathcal{X}_{y}\\
i\neq j
}
}K_{X}\left(\frac{\mathbf{X}_{i}-\mathbf{X}_{j}}{h_{X|y}}\right).\end{aligned}$$ We define the plug-in estimator $\g{h_{X},h_{X|Y}}$ of (\[eq:MI\_cond\]) as $$\begin{aligned}
\g{h_{X},h_{X|y}} & =\frac{1}{\mathbf{N}_{y}}\sum_{\mathbf{X}\in\mathcal{X}_{y}}g\left(\ft X(\mathbf{X})/\ft{X|y}(\mathbf{X})\right),\nonumber \\
\implies\g{h_{X},h_{X|Y}} & =\sum_{y\in\mathcal{S}_{Y}}\frac{\mathbf{N}_{y}}{N}\g{h_{X},h_{X|y}}.\label{eq:mixed_est}\end{aligned}$$

Convergence Rates {#subsec:mixed_conv}
-----------------

To apply the theory of optimally weighted ensemble estimation to $\g{h_{X},h_{X|Y}}$, we need to know its MSE as a function of the bandwidths and the sample size.

\[thm:bias\_mixed\](Bias) Assume that assumptions $\mathcal{A}.0-\mathcal{A}.5$ apply to the functional $g$, the kernel $K_{X}$, and the densities $f_{X}$ and $f_{X|Y}$. Assume that $\mathbf{h}_{X|y}=l\mathbf{N}_{y}^{-\beta}$ with $0<\beta<\frac{1}{d_{X}}$ and $l$ a positive number. Then the bias of $\g{h_{X},h_{X|Y}}$ is $$\begin{aligned}
 & \lefteqn{\bias\left[\g{h_{X},h_{X|Y}}\right]}\nonumber \\
 & =\sum_{\substack{j=0\\
i+j\neq0
}
}^{r}\sum_{i=0}^{r}c_{13,i,j}h_{X}^{i}l^{j}N^{-j\beta}+\frac{c_{14,X}}{Nh_{X}^{d_{X}}}+\frac{c_{14,Y}}{l^{d_{X}}N^{1-\beta d_{X}}}\nonumber \\
 & +O\left(h_{X}^{s}+N^{-s\beta}+\frac{1}{Nh_{X}^{d_{X}}}+\frac{1}{N^{1-\beta d_{X}}}\right).\label{eq:bias_mixed1}\end{aligned}$$ If $g\left(t_{1},t_{2}\right)$ also has $j,l$-th order mixed derivatives $\frac{\partial^{j+l}}{\partial t_{1}^{j}\partial t_{2}^{l}}$ that depend on $t_{1}$ and 