Previous Up Next

9.4.22  Kernel density estimation: kernel_density kde

The kernel_density command performs kernel density estimation (KDE)1 kernel_density takes a sample, optionally restricted to an interval [a,b], and obtains an estimate f of the (unknown) probability density function f from which the samples are drawn. The function f is defined by:

f(x)=
1
n h
 
n
i=1
K


xXi
h



,     (13)

where K is the Gaussian kernel

   K(u)=
1
2 π
 exp


1
2
 u2


and h is the positive real parameter called the bandwidth.
kde is a synonym for kernel_density.


Examples.


Previous Up Next