3.0

3.0 | 14 ratings Rate this file 81 Downloads (last 30 days) File Size: 1.35 KB File ID: #8578
image thumbnail

PDFPLOT

by Alex Bar-Guy

 

28 Sep 2005 (Updated 29 Sep 2005)

PDFPLOT displays a histogram of the empirical probability density function (PDF) of the input data.

| Watch this File

File Information
Description

PDFPLOT displays a histogram of the empirical probability density function (PDF) for the data in the input array X using nbins number of bins.
If input X is a matrix, then pdfplot(X) parses it to the vector and displays PDF of all values.
For complex input X, pdfplot(X) displays PDF of abs(X).

Example:
  y = randn( 1, 1e5 );
  pdfplot( y );
  pdfplot( y, 100 );

Acknowledgements
This submission has inspired the following:
Probability Density Function (PDF) Estimator (V3.2)
MATLAB release MATLAB 6.5.1 (R13SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (16)
02 Oct 2005 x x

whats the numel function?? its not specified

18 Nov 2005 sui lasiko

excellent!

23 Dec 2005 Norbert Pierre

Allows visualization of the data. An extremely useful utility.

19 Mar 2006 anonym anonym

check how it works:
plot(-3:0.1:3,pdf('norm',-3:0.1:3,0,1))
hold
pdfplot(x,30)

03 Aug 2006 Li jia

just what i want, thank you

01 Dec 2006 Jonathan Duplicy

good job - what I need.
unbelievable it's not included in stat. toolbox

06 Mar 2007 Hong La

Okey, i seem it to be my need but not. This is not new thing, a little simple.

01 May 2007 Eoin Elliffe

It would be nice if you could do Ntigram as for pdf you generally need variable bin sizes.

04 Jun 2007 Tim Hattrell

I don't think this calculates the correct PDF as the area under the graph is not one. Replace bar(X, N/sum(N)); with bar(X, N/sum(N)/step); to fix this.

07 Jan 2008 seema sudevan  
06 Feb 2008 Sean Winfree

Yes, the fix suggested by Tim Hattrell
returns the correct pdf. Thanks Tim

20 Feb 2008 Jon Hyde  
23 Jun 2008 Paul Beekhuizen

Nothing more than just a standard histogram with cleverly chosen bins. Much better techniques exist to display a pdf. On top of that, it is buggy (although this can be easily fixed by the fix proposed in one of the other reviews).

06 May 2010 Holger Hiebel

As somebody other already mentioned:
Be careful, to get the real PDF estimate replace
bar(X, N/sum(N));
with
bar(X, N/sum(N)/step);

10 Jul 2010 Amit L  
24 Jan 2011 mathworks2011

[f,xi] = ksdensity(X, 'npoints', 1000);

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Alex Bar-Guy 22 Oct 2008 08:00:57
probability Alex Bar-Guy 22 Oct 2008 08:00:57
pdf Alex Bar-Guy 22 Oct 2008 08:00:57
density Alex Bar-Guy 22 Oct 2008 08:00:57
function Alex Bar-Guy 22 Oct 2008 08:00:57
empi Alex Bar-Guy 22 Oct 2008 08:00:57
display Alex Bar-Guy 22 Oct 2008 08:00:57
distribution Alex Bar-Guy 22 Oct 2008 08:00:57
plot Alex Bar-Guy 22 Oct 2008 08:00:57
pdf estibaliz sanvicente 15 Mar 2010 12:30:56

Contact us at files@mathworks.com