# Thread: Kernel Distribution - show it is a density

1. ## Kernel Distribution - show it is a density

Given the kernel density estimator $\displaystyle \hat{f} (s)=\sum^{N}_{n=1} \frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)$, show that it is a density for every N, and every $\displaystyle \delta>0$ and every relization of the sample ie. show the funciton is nonnegative and integrates to one.

I'm not sure how to formalise thise, I know that if $\displaystyle K(\cdot)$ is a density, then it integates to one by definition. Does the following work;
$\displaystyle \int^{\infty}_{-\infty}\hat{f}(s)ds=\int^{\infty}_{-\infty}\sum^{N}_{n=1} \frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)ds=\frac{1}{N\cdot \delta} \int^{\infty}_{-\infty}\sum^{N}_{n=1} K\left( \frac{s-x_n}{\delta}\right)ds$

So I know that
$\displaystyle \int^{\infty}_{-\infty}\sum^{N}_{n=1} K\left( \frac{s-x_n}{\delta}\right)ds$ needs to equal $\displaystyle N\delta$ but I'm not sure what to do with the integral..

2. Originally Posted by Robb
Given the kernel density estimator $\displaystyle \hat{f} (s)=\sum^{N}_{n=1} \frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)$, show that it is a density for every N, and every $\displaystyle \delta>0$ and every relization of the sample ie. show the funciton is nonnegative and integrates to one.

I'm not sure how to formalise thise, I know that if $\displaystyle K(\cdot)$ is a density, then it integates to one by definition. Does the following work;
$\displaystyle \int^{\infty}_{-\infty}\hat{f}(s)ds=\int^{\infty}_{-\infty}\sum^{N}_{n=1} \frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)ds=\frac{1}{N\cdot \delta} \int^{\infty}_{-\infty}\sum^{N}_{n=1} K\left( \frac{s-x_n}{\delta}\right)ds$

So I know that
$\displaystyle \int^{\infty}_{-\infty}\sum^{N}_{n=1} K\left( \frac{s-x_n}{\delta}\right)ds$ needs to equal $\displaystyle N\delta$ but I'm not sure what to do with the integral..
Observe that if $\displaystyle u=(s-x_n)/\delta$:

$\displaystyle \int_{-\infty}^{\infty}K\left(\frac{s-x_n}{\delta}\right)\;ds=\int_{-\infty}^{\infty}\delta K(u)\;du=\delta$

So:

$\displaystyle \int_{-\infty}^{\infty}\hat{f} (s)\; ds= \int_{-\infty}^{\infty}\left[\sum^{N}_{n=1} \frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)\right]\; ds$ $\displaystyle =\sum^{N}_{n=1}\left[ \int_{-\infty}^{\infty}\frac{1}{N\cdot \delta} K\left( \frac{s-x_n}{\delta}\right)\; ds\right]$ $\displaystyle =\sum^{N}_{n=1}\frac{1}{N}=1$

CB