Multivariate kernel density estimation: Difference between revisions

Content deleted Content added
Cydebot (talk | contribs)
m Robot - Speedily moving category Non-parametric statistics to Category:Nonparametric statistics per CFDS.
Line 127:
 
We consider estimating the density of the Gaussian mixture
{{nowrapmath|(4''π'')<sup>−1</sup>&thinsp;exp(−{{frac|2}} (''x''<sub>1</sub><sup>2</sup> + ''x''<sub>2</sub><sup>2</sup>))
+ (4''π'')<sup>−1</sup>&thinsp;exp(−{{frac|2}} ((''x''<sub>1</sub> - 3.5)<sup>2</sup> + ''x''<sub>2</sub><sup>2</sup>))}},
from 500 randomly generated points. We employ the Matlab routine for
Line 155:
 
<source 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)
</source>