What is the equation for the $2D$ Epanechnikov Kernel?
The following doesn't look right when I plot it.
$K(x) = \frac{3}{4} * \left(1 - \left(\left(\frac{x}{\sigma} \right)^2 + \left(\frac{y}{\sigma}\right)^2\right) \right)$
I get this:
What is the equation for the $2D$ Epanechnikov Kernel?
The following doesn't look right when I plot it.
$K(x) = \frac{3}{4} * \left(1 - \left(\left(\frac{x}{\sigma} \right)^2 + \left(\frac{y}{\sigma}\right)^2\right) \right)$
I get this:
According to Wikipedia, the Epanechnikov kernel is
$K(u) = \tfrac34(1 - u^2)\mathbf{1}_{\{\lvert u\rvert≤1\}}$
where $\mathbf{1}_{...}$ is the indicator function, that is, the function which is 1 for values in the specified set and 0 otherwise.
Therefore, assuming that $u^2 = (x/σ)^2 + (y/σ)^2$ (I have no knowledge of this aspect of statistics to say), your formula is correct except that you have not included the indicator function (which in a plotting context would usually be expressed as a piecewise function or conditional expression). That is:
$K(x,y) = \begin{cases} \tfrac34 \left(1 - \left((x/σ)^2 + (y/σ)^2\right)\right) & \lvert (x/σ)^2 + (y/σ)^2\rvert≤1 \\ 0 & \text{otherwise} \end{cases} $
In this particular case, $\tfrac34(1 - u^2)$ is negative whenever $\lvert u \rvert > 1$, which is exactly when the indicator function would be $0$, so you could also use this formula:
$K(x,y) = \max\left\{0, \frac34 \left( 1 - \left((x/σ)^2 + (y/σ)^2\right)\right)\right\} $
(This is not valid as a general substitute for an indicator function or piecewise definition, but works because the region of negative values has the same boundary as the region defined for the indicator function.)
The appearance of your plot is most likely from the gradient repeating itself as your $K$ goes negative (which is what the indicator function prevents).
I have an equation for some p-D Epanechnikov Kernel. Maybe you will find it useful. $ \begin{equation} K(\hat{x})=\begin{cases} \frac{1}2C_p^{-1}(p +2)(1-||\hat{x}||^2)& ||\hat{x}||<1\\\\ 0& \text{otherwise} \end{cases} \end{equation} $
while $\hat{x}$ is a vector with p dimensions and $C_p$ is defined as: $C_1 = 2;\ C_2=\pi,\ C_3=\frac{4\pi}3$
would like to see an equation for $C_p$ for every p.