KSDENSITY allows me to estimate the probability density function however it does not allow me to automatically optimize the bandwidth of the kernal. In fact, the algorithm found in KSDENSITY is optimal for "normal" probability density functions, and probably does not take into account the weights (Reference to section 2.4.2 in documentation [1], Bowman, A. W., and A. Azzalini. Applied Smoothing Techniques for Data Analysis. New York: Oxford University Press, 1997).
I would like to be able to use a least-square cross-validation algorithm in KSDENSITY that holds for a general probability density function and gaussian (normal) kernel. This algorithm would also take into account any weights.
A third party toolbox that does something similar is at,
Best Answer