⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo_kde_1.m

📁 Non-parametric density estimation
💻 M
字号:
% Simple Example #1 -- construction, BW choice, plotting
%
%
fprintf('KDE Example #1 : 1D density estimate with various kernels, auto BW choices\n');

p = kde([.1,.45,.55,.8],.08);  % create a mixture of 4 gaussians for testing
x = sample(p,1000);      % and generate samples

figure(1); hold off;
plot(p,'r-'); hold on;
plot(kde(x,'rot'),'b-'); fprintf('.');
plot(kde(x,'lcv'),'b--'); fprintf('.');
plot(kde(x,'hall'),'b:'); fprintf('.');
plot(kde(x,'rot',ones(1,1000),'Epan'),'g-'); fprintf('.'); % Quadratic kernel instead
plot(kde(x,'lcv',ones(1,1000),'Epan'),'g--'); fprintf('.');
plot(kde(x,'hsjm',ones(1,1000),'Epan'),'g:'); fprintf('.\n');

legend('Original','Gauss Kernel, ROT','Gauss Kernel LCV','Gauss Kernel HSJM',...
       'Epan Kernel ROT','Epan Kernel LCV','Epan Kernel HSJM');


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -