ksdensity default bandwidth value
19 ビュー (過去 30 日間)
回答 (3 件)
Ghada Saleh 2015 年 8 月 7 日
In MATLAB, the default bandwidth in 'ksdensity' function is calculated using the following formula:
BandWidth = sig * (4/(3*N))^(1/5);
where 'sig' is an estimated value of the standard deviation of the samples.
I hope this helps,
FK 2022 年 1 月 22 日
The 'ksdensity' function uses "Silverman's rule" as given in the post of Ghada. The difference between the calculations of Alexandra and the calculations done in Matlab is caused by a different estimation of the the standard deviation. Instead of estimating it by it is done by applying a more robust estimator with (see this Wikipedia article for further information).
With m=[1,3,2,5] you can derive with Silverman's rule that the default bandwith is given by .