<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672</link>
    <title>MATLAB Central Newsreader - Curve fitting to a histogram to give a probability density function.</title>
    <description>Feed for thread: Curve fitting to a histogram to give a probability density function.</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 09 Jun 2008 14:20:03 -0400</pubDate>
      <title>Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#436500</link>
      <author>Noel Kelleher</author>
      <description>Hi All,&lt;br&gt;
&lt;br&gt;
If you have a histogram of data that is normally&lt;br&gt;
distributed, is there a matlab function that will fit a&lt;br&gt;
curve to the bell shape of the histogram to give you a&lt;br&gt;
general probability density function for that data set.&lt;br&gt;
&lt;br&gt;
Thanks.</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 14:37:44 -0400</pubDate>
      <title>Re: Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#436506</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g2je6j$m19$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Noel Kelleher &amp;lt;naych@hotmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;If you have a histogram of data that is normally&lt;br&gt;
&amp;gt;distributed, is there a matlab function that will fit a&lt;br&gt;
&amp;gt;curve to the bell shape of the histogram to give you a&lt;br&gt;
&amp;gt;general probability density function for that data set.&lt;br&gt;
&lt;br&gt;
No, there isn't. If the histogram is normally distributed then it&lt;br&gt;
has infinite tails in both direction. There are no routines in Matlab&lt;br&gt;
that can work with infinite vectors.&lt;br&gt;
&lt;br&gt;
If you want to pretend that the histogram counts have a normal&lt;br&gt;
distribution even though they do not have infinite tails, then&lt;br&gt;
simply take the mean() and standard deviation of the count data;&lt;br&gt;
the pdf is then just the pdf of the normal distribution with those&lt;br&gt;
mean and standard deviation.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;What we have to do is to be forever curiously testing new&lt;br&gt;
&amp;nbsp;&amp;nbsp;opinions and courting new impressions.&quot;     -- Walter Pater</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 15:36:05 -0400</pubDate>
      <title>Re: Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#436511</link>
      <author>Tom Lane</author>
      <description>&amp;gt;&amp;gt;If you have a histogram of data that is normally&lt;br&gt;
&amp;gt;&amp;gt;distributed, is there a matlab function that will fit a&lt;br&gt;
&amp;gt;&amp;gt;curve to the bell shape of the histogram to give you a&lt;br&gt;
&amp;gt;&amp;gt;general probability density function for that data set.&lt;br&gt;
...&lt;br&gt;
&amp;gt; If you want to pretend that the histogram counts have a normal&lt;br&gt;
&amp;gt; distribution even though they do not have infinite tails, then&lt;br&gt;
&amp;gt; simply take the mean() and standard deviation of the count data;&lt;br&gt;
&amp;gt; the pdf is then just the pdf of the normal distribution with those&lt;br&gt;
&amp;gt; mean and standard deviation.&lt;br&gt;
&lt;br&gt;
Noel, whether or not you have the Statistics Toolbox available, you might &lt;br&gt;
find it helpful to look at the following demo on this topic:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html&quot;&gt;http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I agree with Walter that you are usually better off fitting a distribution &lt;br&gt;
to the raw data rather than fitting a curve to the histogram.&lt;br&gt;
&lt;br&gt;
-- Tom </description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 16:01:51 -0400</pubDate>
      <title>Re: Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#436515</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g2jil5$j4u$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Tom Lane &amp;lt;tlane@mathworks.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;I agree with Walter that you are usually better off fitting a distribution &lt;br&gt;
&amp;gt;to the raw data rather than fitting a curve to the histogram.&lt;br&gt;
&lt;br&gt;
I didn't say or hint that, but it sounds like a good idea to me!&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;And believe me, I was very lousy yesterday.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;I had nothing to say, and, by God, I said it.&quot;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Walter Wellesley Smith</description>
    </item>
    <item>
      <pubDate>Mon, 09 Jun 2008 16:04:02 -0400</pubDate>
      <title>Re: Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#436516</link>
      <author>Noel Kelleher</author>
      <description>&quot;Tom Lane&quot; &amp;lt;tlane@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g2jil5$j4u$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;If you have a histogram of data that is normally&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;distributed, is there a matlab function that will fit a&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;curve to the bell shape of the histogram to give you a&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;general probability density function for that data set.&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; If you want to pretend that the histogram counts have a&lt;br&gt;
normal&lt;br&gt;
&amp;gt; &amp;gt; distribution even though they do not have infinite&lt;br&gt;
tails, then&lt;br&gt;
&amp;gt; &amp;gt; simply take the mean() and standard deviation of the&lt;br&gt;
count data;&lt;br&gt;
&amp;gt; &amp;gt; the pdf is then just the pdf of the normal distribution&lt;br&gt;
with those&lt;br&gt;
&amp;gt; &amp;gt; mean and standard deviation.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Noel, whether or not you have the Statistics Toolbox&lt;br&gt;
available, you might &lt;br&gt;
&amp;gt; find it helpful to look at the following demo on this topic:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html&quot;&gt;http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I agree with Walter that you are usually better off&lt;br&gt;
fitting a distribution &lt;br&gt;
&amp;gt; to the raw data rather than fitting a curve to the histogram.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- Tom &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Ok, thanks guys!</description>
    </item>
    <item>
      <pubDate>Wed, 06 Aug 2008 16:33:02 -0400</pubDate>
      <title>Re: Curve fitting to a histogram to give a probability density function.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170672#447650</link>
      <author>Mastaneh </author>
      <description>&quot;Noel Kelleher&quot; &amp;lt;naych@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g2jk9i$ehq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Tom Lane&quot; &amp;lt;tlane@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;g2jil5$j4u$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;If you have a histogram of data that is normally&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;distributed, is there a matlab function that will fit &lt;br&gt;
a&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;curve to the bell shape of the histogram to give you a&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;general probability density function for that data &lt;br&gt;
set.&lt;br&gt;
&amp;gt; &amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; If you want to pretend that the histogram counts have &lt;br&gt;
a&lt;br&gt;
&amp;gt; normal&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; distribution even though they do not have infinite&lt;br&gt;
&amp;gt; tails, then&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; simply take the mean() and standard deviation of the&lt;br&gt;
&amp;gt; count data;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the pdf is then just the pdf of the normal &lt;br&gt;
distribution&lt;br&gt;
&amp;gt; with those&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; mean and standard deviation.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Noel, whether or not you have the Statistics Toolbox&lt;br&gt;
&amp;gt; available, you might &lt;br&gt;
&amp;gt; &amp;gt; find it helpful to look at the following demo on this &lt;br&gt;
topic:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/products/statistics/demos.html?&quot;&gt;http://www.mathworks.com/products/statistics/demos.html?&lt;/a&gt;&lt;br&gt;
file=/products/demos/shipping/stats/cfitdfitdemo.html&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I agree with Walter that you are usually better off&lt;br&gt;
&amp;gt; fitting a distribution &lt;br&gt;
&amp;gt; &amp;gt; to the raw data rather than fitting a curve to the &lt;br&gt;
histogram.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; -- Tom &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Ok, thanks guys!&lt;br&gt;
&lt;br&gt;
Hi Noel,&lt;br&gt;
yes, it's possible and I've done that. &lt;br&gt;
I think what you're trying to do is the &quot;distribution &lt;br&gt;
fitting&quot; not the curve fitting; so you could in fact have a &lt;br&gt;
look at &lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/products/statistics/demos.html?&quot;&gt;http://www.mathworks.com/products/statistics/demos.html?&lt;/a&gt;&lt;br&gt;
file=/products/demos/shipping/stats/cdffitdemo.html &lt;br&gt;
&lt;br&gt;
Once you plot the histogram of the original data, find the &lt;br&gt;
frequency counts and bin locations, make a linespace &lt;br&gt;
vector, and generate a pdf or cdf function using &lt;br&gt;
the 'estimated' values from the data. &lt;br&gt;
Hope it helps! </description>
    </item>
  </channel>
</rss>

