From: Mehdi bahonar on
Hi There,

Do you know how we can convert histogram plot to probability density function plot?

Thanks,
maryam
From: Ulf Graewe on
"Mehdi bahonar" <mehdiuoc(a)yahoo.com> wrote in message <hnfji1$sko$1(a)fred.mathworks.com>...
> Hi There,
>
> Do you know how we can convert histogram plot to probability density function plot?
>
> Thanks,
> maryam

maybe you have to normalise the histogram, so that the probability to be in the total interval is 1.

a first hint:
doc trapz
From: Sadik on
a = randn(1,10000);
[n,x] = hist(a,50);
plot(x,n/10000/diff(x(1:2)))
hold on
plot(x,normpdf(x,0,1),'r')

Therefore, n/10000/diff(x(1:2)) is your pdf. [diff(x(1:2)) looks at deltaX, that is bin width.]

"Mehdi bahonar" <mehdiuoc(a)yahoo.com> wrote in message <hnfje9$r0d$1(a)fred.mathworks.com>...
> Hi There,
>
> Do you know how we can convert histogram plot to probability density function plot?
>
> Thanks,
> maryam
From: Wayne King on
"Mehdi bahonar" <mehdiuoc(a)yahoo.com> wrote in message <hnfje9$r0d$1(a)fred.mathworks.com>...
> Hi There,
>
> Do you know how we can convert histogram plot to probability density function plot?
>
> Thanks,
> maryam

Hi maryam, if you have the Statistics Toolbox, histfit() will superimpose a probability density function for a number of distributions.
Wayne
From: the cyclist on
"Mehdi bahonar" <mehdiuoc(a)yahoo.com> wrote in message <hnfje9$r0d$1(a)fred.mathworks.com>...
> Hi There,
>
> Do you know how we can convert histogram plot to probability density function plot?
>
> Thanks,
> maryam

As has been mentioned, use HISTFIT if you know the underlying distribution type that you want to fit (e.g. normal distribution). If you do not, then you need to do a non-parametric fit. You can use the KSDENSITY function to do this. Note that this is a bit of an art in addition to science. You might want to read up on "kernel density estimation".