MathGroup Archive 2012

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

Search the Archive

Re: histospline

Not sure if this is what you want but it may help.


compare::usage =
  "compare[data, dist] plots PDF of maximum likelihood estimate with \
histogram scaled as PDF.";

   dist_: NormalDistribution[Unique[], Unique[]]] :=
   {estDist =
     EstimatedDistribution[data, dist]},
    Histogram[data, Automatic, "PDF",
     ChartStyle -> EdgeForm[None]],
    Plot[PDF[estDist, x],
     {x, Min[data], Max[data]},
     PlotStyle -> Darker[Red]],
    Frame -> True,
    Axes -> False,
    PlotLabel -> "Data Histogram and " <> ToString[estDist]]];

dist1 = NormalDistribution[5*RandomReal[], 2*RandomReal[]]

data1 = RandomVariate[dist1, 200];

compare[data1] (* defaults to NormalDistribution *)

dist2 = GammaDistribution[4*RandomReal[] + 1, 2*RandomReal[]]

data2 = RandomVariate[dist2, 300];

compare[data2, GammaDistribution[a, b]]

Bob Hanlon

On Sun, Apr 29, 2012 at 2:11 AM, paul <paulvonhippel at> wrote:
> I'm looking for a Mathematica package that can generate a histospline.
> This is a smooth density estimate based only on the information in a histogram.

  • Prev by Date: Mathematica NB file to LaTeX for publication?
  • Next by Date: Re: Trouble plotting BSpline
  • Previous by thread: histospline
  • Next by thread: NDSolve in 3D