Assume I have a $N$-dimensional variable $X \in \mathbb{R}^N$ and a radial basis function $K(X,X')\rightarrow\mathbb{R}$ centered on $X' \in \mathbb{R}^N$:
$$K(X,X')=-\exp\left(\frac{\lVert{X-X'}\rVert^2}{2h^2}\right)$$
with
$$X=\begin{bmatrix} x_{1} \\ x_{2} \\ \vdots \\ x_{N} \end{bmatrix}$$
I want to evaluate the partial derivatives $\nabla K(X,X') = (\frac{\partial K(X,X')}{\partial x_1}, \ldots, \frac{\partial K(X,X')}{\partial x_N})$ at location $X$.
Now I could probably evaluate these derivatives numerically through finite differences. An analytic derivation would be more elegant, but seems quite daunting a task. Do you know if there is an elegant solution to this?