View License

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

» Watch video

Highlights from
Bivariant Kernel Density Estimation (V2.1)

3.8 | 12 ratings Rate this file 25 Downloads (last 30 days) File Size: 213 KB File ID: #19280 Version: 1.2
image thumbnail

Bivariant Kernel Density Estimation (V2.1)


Yi Cao (view profile)


20 Mar 2008 (Updated )

A tool for bivariant pdf, cdf and icdf estimation using Gaussian kernel function.

| Watch this File

File Information

This function implements bivariant Gaussian kernel density estimation. It can be used to estimate bivariant probability density function (pdf), cumulative distribution function (cdf) and inversed cdf (icdf) from a set of random data. The code is programmed in a way to be suitable for beginners to learn kernel density estimation.


Probability Density Function (Pdf) Estimator (V3.2) inspired this file.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (18)
25 Jul 2016 Takumi Sase

Sorry, please ignore the comment below.

Comment only
25 Jul 2016 Takumi Sase

How to optimaze the number of peaks in the code?

Comment only
25 Nov 2015 Larissa

So the function works once you figure out how the data needs to be structured. My only problem is that, as written, the actual pdf values scale down as your data range gets larger. Should this really be happening?

Up to and including the line


the values are the same regardless of data scale. However, the next line scales by the bandwidth AGAIN and messes that up. Is this accurate? If so, could you explain the reasoning for this?

03 Aug 2015 Joseph

Joseph (view profile)

examples do work, and so does the code. Really straightforward coding and simple to manipulate for use in your individual needs, even if you're new to KDE

30 Jun 2015 Xinyao Tang

It seems that your bandwidth formula doesn't correct.

04 Nov 2014 Adwin555

I just delete % to run the examples, but I got "Error in gkde2"

03 Sep 2014 Matthew

documentation is false, misleading, and old.

02 Dec 2013 Michael

nice code. I like that you put your references for methods, and I need to double-check them. Wish you had a link to Wolfram or an online resource.

Internal nomenclature could be cleaned up. The command call in the example should be able to be copied, pasted to command-line and executed.

Comment only
14 Oct 2013 sebastiano

27 May 2012 Yong-ha

08 Jul 2010 yolgs Hoffmann

ah ok: The functions does not get p.xy, the information in the file is misleading. But instead requires p.x and p.y separately. It´s in the check function around line 180 f.

Comment only
08 Jul 2010 yolgs Hoffmann

Nice one. But to really use it I definitely need to put in my own grid locations. So I have the same problem as Frank. Please - is there a solution? That would be really good.

Comment only
13 May 2010 Frank

Frank (view profile)

Nice program with the default values. Put I'm not seeing how I can input my own grid locations. The optional inputs say "p.xy - Nx2 matrix for locations to make estimation", however, I don't see where this is done within the program. Also, I get errors on line 260 when I try to input my own bandwidth values.

Comment only
12 Apr 2010 Turkay YILDIZ

08 Apr 2010 Warrick

Very easy to understand for a Matlab novice like myself. However, is the bandwidth formula correct? It doesn't seem to match the reference? Also, my total probability density is almost, but not exactly 1 (~0.96)

22 Oct 2009 Tyler Jandreau

05 Apr 2009 V. Poor

14 Jul 2008 nicolas cachy

very handy, thank you

09 Apr 2010 1.1

new functionality

12 Aug 2013 1.2

a bug fixed

Contact us