|
"Noel Kelleher" <naych@hotmail.com> wrote in message
<g2jk9i$ehq$1@fred.mathworks.com>...
> "Tom Lane" <tlane@mathworks.com> wrote in message
> <g2jil5$j4u$1@fred.mathworks.com>...
> > >>If you have a histogram of data that is normally
> > >>distributed, is there a matlab function that will fit
a
> > >>curve to the bell shape of the histogram to give you a
> > >>general probability density function for that data
set.
> > ...
> > > If you want to pretend that the histogram counts have
a
> normal
> > > distribution even though they do not have infinite
> tails, then
> > > simply take the mean() and standard deviation of the
> count data;
> > > the pdf is then just the pdf of the normal
distribution
> with those
> > > mean and standard deviation.
> >
> > Noel, whether or not you have the Statistics Toolbox
> available, you might
> > find it helpful to look at the following demo on this
topic:
> >
> >
> http://www.mathworks.com/products/statistics/demos.html?
file=/products/demos/shipping/stats/cfitdfitdemo.html
> >
> > I agree with Walter that you are usually better off
> fitting a distribution
> > to the raw data rather than fitting a curve to the
histogram.
> >
> > -- Tom
> >
> >
>
> Ok, thanks guys!
Hi Noel,
yes, it's possible and I've done that.
I think what you're trying to do is the "distribution
fitting" not the curve fitting; so you could in fact have a
look at
http://www.mathworks.com/products/statistics/demos.html?
file=/products/demos/shipping/stats/cdffitdemo.html
Once you plot the histogram of the original data, find the
frequency counts and bin locations, make a linespace
vector, and generate a pdf or cdf function using
the 'estimated' values from the data.
Hope it helps!
|