MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Histogram fitting

  • To: mathgroup at
  • Subject: [mg30659] Re: [mg30638] Histogram fitting
  • From: BobHanlon at
  • Date: Mon, 3 Sep 2001 20:32:34 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/8/31 8:11:32 PM, Adam.Bouchta at writes:

>How does one fit a histogram with a Gaussian?
>I do:
>and would like to make a gaussian fit of the resulting histogram...


data = RandomArray[
      NormalDistribution[10*Random[], 2*Random[]], 

mu = Mean[data];
sigma = StandardDeviationMLE[data];

    Histogram[data, HistogramScale -> 1], 
    Plot[PDF[NormalDistribution[mu, sigma], x], 
      {x, Min[data], Max[data]}, 
      PlotStyle -> {AbsoluteThickness[2], Blue}], 
    Frame -> True, 
    Axes -> False, 
    FrameLabel -> {"x", "PDF\n"}, 
    PlotLabel -> "Data Distribution", 
    ImageSize -> 360]; 
  Print["data: ", LocationReport[data]])

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: Commands to restore Kernel
  • Next by Date: Arrow Syntax is Dumb
  • Previous by thread: Re: Commands to restore Kernel
  • Next by thread: Arrow Syntax is Dumb