Path: news.mathworks.com!not-for-mail
From: "Mastaneh " <mtorkama@iupui.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Curve fitting to a histogram to give a probability density function.
Date: Wed, 6 Aug 2008 16:33:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 56
Message-ID: <g7cjnu$6ic$1@fred.mathworks.com>
References: <g2je6j$m19$1@fred.mathworks.com> <g2jf7o$711$1@canopus.cc.umanitoba.ca> <g2jil5$j4u$1@fred.mathworks.com> <g2jk9i$ehq$1@fred.mathworks.com>
Reply-To: "Mastaneh " <mtorkama@iupui.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1218040382 6732 172.30.248.35 (6 Aug 2008 16:33:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 6 Aug 2008 16:33:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 648205
Xref: news.mathworks.com comp.soft-sys.matlab:484004



"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!