Re: Superimposing Normal on a Histogram of data
- To: mathgroup at smc.vnet.net
- Subject: [mg91595] Re: Superimposing Normal on a Histogram of data
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 28 Aug 2008 07:39:16 -0400 (EDT)
- Reply-to: hanlonr at cox.net
Needs["Histograms`"]; Options[Histogram] One option shown is HistogramScale -> Automatic ?HistogramScale "HistogramScale is an option of histogram functions that specifies the way = in which the bar heights are to be scaled. >>" Click the "more" link ( >> ) to go to Histograms/ref/HistogramScale Under EXAMPLES / Basic Examples "Use HistogramScale -> 1 to get a probability density:" Bob Hanlon ---- axel <axel.kilian at hs-merseburg.de> wrote: ============= On 28 Aug., 09:27, Bob Hanlon <hanl... at cox.net> wrote: > Needs["Histograms`"]; > > data = RandomReal[NormalDistribution[5, 2], {100}]; > > {mu, sigma} = {Mean[data], StandardDeviation[data]} > > {5.21122,1.84401} > > Show[{Histogram[data, HistogramScale -> 1], > =C2 Plot[PDF[NormalDistribution[mu, sigma], x], > =C2 =C2 {x, mu - 3 sigma, mu + 3 sigma}, > =C2 =C2 PlotStyle -> Red]}, > =C2 PlotRange -> All] > > Bob Hanlon > > ---- ouadad <desmier... at forces.gc.ca> wrote: > > ============= > Can someone point me to an algorithm that allows me to plot a normal curv= e over a histogram of residuals? =C2 I just want to show how close my res= idual distribution approximates a normal distribution. Hi Bob, very elegant solution. Where did you find the option HistogramScale? It's not in my manual. regards Axel Kilian