Multivariate kernel density estimation: Difference between revisions

Content deleted Content added
Update link to fastKDE repository, which moved to GitHub
 
Line 154:
 
<syntaxhighlight lang="matlab" style="overflow:auto;">
clear all
% generate synthetic data
data=[randn(500, 2);
randn(500, 1) + 3.5, randn(500, 1);];
% call the routine, which has been saved in the current directory
[bandwidth, density, X, Y] = kde2d(data);
% plot the data and the density estimate
contour3(X, Y, density, 50), hold on
plot(data(:,1), data(:,2), 'r.', 'MarkerSize', 5)
</syntaxhighlight>