w = kernelwidth( vX ) returns the estimated optimal kernel bandwidth for a given vector vX.

w = 0.9 \sigma n^{-\frac{1}{5}}

where n is the size of vector vX, and

 \sigma = \min( \hat{\sigma}, \ IQR/1.349 )

, \hat{\sigma} is the standard deviation of vX, and IQR is the interquartile range of vX.


vX (input, vector)
Distributed samples used to estimate bandwidth
w (output, double)
Estimated optimal bandwidth for kernel density, w > 0