2

Assume that I have a one-dimensional radial basis kernel function $k(x,x')$ with $x,x' \in \mathbb{R}$:

$$k(x,x') = exp\left(-\frac{(x-x')^2}{2h^2}\right)$$

where $h^2$ is the bandwidth, assumed a constant. I want to find the derivative of this kernel:

$$\frac{\partial k(x,x')}{\partial x}=\frac{\partial}{\partial x}exp\left(-\frac{(x-x')^2}{2h^2}\right)$$

I have tried to derive this and would appreciate it if someone could double-check my math. First we make use of the chain rule $f(g(x))'=f'(g(x))g'(x)$$, for which we have equivalently:

$$f'(g(x))=exp\left(-\frac{(x-x')^2}{2h^2}\right)$$

since $\frac{\partial}{\partial x}e^{x}=e^{x}$ and

$$g'(x)=\frac{\partial}{\partial x}-\frac{(x-x')^2}{2h^2}$$

Using the binomial formula $(x-y)^2=x^2-2xy+y^2$

$$g'(x)=\frac{\partial}{\partial x}-\frac{x^2-2xx'-x'^2}{2h^2}$$

which yields

$$g'(x)=-\frac{2x-2x'}{2h^2}$$

and if we combine $f'(g(x))$ and $g'(x)$, we get:

$$\frac{\partial k(x,x')}{\partial x}=-\frac{2x-2x'}{2h^2} exp\left(-\frac{(x-x')^2}{2h^2}\right)$$

Is this derivation correct?

J.Galt
  • 961

0 Answers0