View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
2D Bandwidth Estimator for KDE

Be the first to rate this file! 16 Downloads (last 30 days) File Size: 25.3 KB File ID: #36153 Version: 1.4
image thumbnail

2D Bandwidth Estimator for KDE



12 Apr 2012 (Updated )

2D kernel density estimator from weighted data.

| Watch this File

File Information

The submission includes a code for estimating a 2D bandwidth ("getBandwidth.m") matrix for a Gaussian Kernel Density Estimator. The included demonstration code ("demoBWEstimation.m") estimates a bandwidth from a weighted set of data-points and displays the resulting KDE by tabulating it, as well as displaying it as a Gaussian Mixture Model. The bandwidth calculation is a special case of a more general bandwidth estimator [1], which was developed originally for online density estimation.

[1] Kristan et al., Multivariate Online Kernel Density Estimation with Gaussian Kernels, Pattern Recognition, 2011 (url:


This file inspired Ensemble Mcmc Sampler.

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
08 Apr 2013 Matej Kristan

bmv, thanks for the error dump. Apparently there was a leftover dependency on the Lightspeed Toolbox. I've updated the submission and it now includes the missing function.

Comment only
29 Mar 2013 bmv

bmv (view profile)

>> demoBWEstimation

Undefined function 'col_sum' for input arguments of type 'double'.
Error in normmixpdf (line 56)
pl = logConstant - 0.5*col_sum(dx.*dx);
Error in evaluatePointsUnderPdf (line 17)
[ p, model ] = normmixpdf( model, X, minerr ) ;
Error in visualizePdf2d2 (line 51)
p = evaluatePointsUnderPdf(pdf, data) ;
Error in visualizeKDE (line 55)
outdat = visualizePdf2d2( kde.pdf, boundsIm, [], grans ) ;
Error in demoBWEstimation (line 47)
subplot(2,3,1) ; I_k = visualizeKDE('kde', kde_k, 'tabulated', 1) ;

Comment only
21 Mar 2013 1.2

Just the description.

08 Apr 2013 1.4

added the following missing function:

function s = col_sum( a )

s = sum(a,1) ;

Contact us