Re: Fit Gaussian function to histogram
- To: mathgroup at smc.vnet.net
- Subject: [mg117782] Re: Fit Gaussian function to histogram
- From: "Kevin J. McCann" <Kevin.McCann at umbc.edu>
- Date: Thu, 31 Mar 2011 04:02:29 -0500 (EST)
- References: <imsh9i$5me$1@smc.vnet.net>
Histogram gives the plot, but if you want the actual bin counts, use
BinCounts. The mma help will give you the options to call it; I usually use
BinCounts[data,dx] in which dx is the bin width. You can also specify
all the bins with BinCounts[data,{xmin,xmax,dx}]. It is then easy to
convert the counts to probability densities.
Kevin
On 3/29/2011 7:54 AM, cubsfan334 wrote:
> Hi,
>
> I realize that I can generate a histogram from a data set using the
> Histogram[{data},bin size] command, yet this only seems to create a
> graphic. Is there anyway to fit a function (preferably Gaussian) to
> the histogram Mathematica creates?
>
> Thanks!
>