Plug-in approach of Sheater and Jones estimation bandwidth

21 vues (au cours des 30 derniers jours)
Maximiliano Barbosa
Maximiliano Barbosa le 4 Oct 2022
Hi, there is some algorithm that has the "Plug-in approach of Sheater and Jones estimation bandwidth 1991" instead using the "optimal bandwidth for the normal distribution" . I ask that because my data is bimodal distribution and I need estimate the bandwidth of the kernel estimated with the Sheater and Jones method.
Furthermore, the MATLAB [f,xi] = ksdensity(x) function says:
" The default is optimal for estimating normal densities [1], but you might want to choose a larger or smaller value to smooth more or less "
I have MATLAB 2020B, and there some toolbox wich could help me?
Thank you in advance

Réponses (1)

Ayush Anand
Ayush Anand le 20 Oct 2023
Hi Maximiliano,
I understand you are trying to estimate the bandiwidth of your data kernal using the Sheater and Jones method. The "ksdensity" function in MATLAB does not directly provide an option for the same, but you can do it by specifying a custom bandwidth as follows:
data = ... % your bimodal data
% Estimate the bandwidth using the Sheather and Jones plug-in approach
n = numel(data);
h_sj = 1.06 * std(data) * n^(-1/5); % Sheather and Jones bandwidth estimation
[f, xi] = ksdensity(data, 'Bandwidth', h_sj); % Estimate the kernel density using the estimated bandwidth
Alternatively, you can also refer to the following:
I hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by