File Exchange

image thumbnail

Probability Density Function (PDF) Estimator (V3.2)

version (61.1 KB) by Yi Cao
An estimate of probability density function of the given random data with bounded support.


Updated 08 Apr 2010

View Version History

View License

This function provides an estimate of probability density function for a given random data (an 1-d vector). The estimation can be done with a specified number of intervals, and bandwidth. Without any output, the function will plot the probability density function. A few examples are included to show how to use the function and its output.

It also includes bounded support. For some problems, bounded support is important. For example, many physical problems require positive variables. This function is able to estimate PDF for such problems as well if the lower and upper bounds are specified.

The new version includes cdf and inverse cdf estimation.

Cite As

Yi Cao (2021). Probability Density Function (PDF) Estimator (V3.2) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (14)

Ting-Han Fan

Lisa Justin

excellent. can this be c-code generated?

yahong li




Brent Boehlert

Excellent -- exactly what I needed.


Liu ?

V. Poor

ricardo lusternik

Yi Cao

The file has been upgraded to use Gaussian kernel smoothing estimation algorithm.

Dimitri Shvorob

It's an ad hoc smoother:
One can search FEX for 'kernel density estimator'.

Jesper Henriksen

I havent tried this code, but it sounds very similar to matlabs ksdensity

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!