How to write a joint kernel density of two random variables with known individual densities? Consider two random variables $X$ and $Y$ with densities
$${f}_1(x) = \frac{1}{n_1h_1} \sum\limits_{i=1}^{n_1}K\left(\frac{x-u_i}{h_1}\right) ~~~~\text{and}  ~~~~ {f}_2(y) = \frac{1}{n_2h_2} \sum\limits_{j=1}^{n_2}K\left(\frac{y-v_j}{h_2}\right),$$respectively, where $K$ is a kernel and $h_1$ and $h_2$ are corresponding bandwidth parameters. Then, how to write the joint density of $X$ and $Y$?
 A: It depends on what assumptions you are willing to make. Basically, you need a multivariate kernel. If you can assume that the variables are independent, you can use the product kernel
$$
\hat{f_h}(\mathbf{x}) = \frac{1}{n} \sum_{i=1}^n \prod_{j=1}^d \frac{1}{h_j} K\Big(\frac{x_i-\mathbf{X}_{ij}}{h_j}\Big)
$$
It won't do anything about handling dependence or correlation between variables. If you can't assume independence, you need a proper multivariate kernel density estimator defined in terms of multivariate kernels.
A: The kernel density estimation (KDE) will produce the marginal density function:
$$f_1(x_1)=\int_{X_2} f(x_1,x_2)dx_2\approx f_K(x_1)$$
Where $f(x_1,x_2)$ is the joint density function, and $f_K$ is your KDE. Unfortunately, in general case it is impossible to recover the join density solely from marginals, e.g. without any additional assumptions. There are special cases where it is possible, such as when the variables are independent, for instance.
There is Sklar theorem which stets that joint distributions can be constructed from marginals plus copula. For instance, in case of Gaussian distribution, the copula is very simply determined by the correlation matrix of the variables. The problem is that the Sklar theorem doesn't tell us how to estimate this copula. However, if somehow you knew it then you would plug your marginals into the copula and get the joint distribution.
By the way, the copulas are a very common technique in some fields, and they do use KDE as marginals in some applications. Here's an excellent short paper that details applications of copulas in Finance: Copulas for Finance A Reading Guide and Some Applications, by Eric Bouy et al., has all equations you need to get the joint distribution, for instance
