mathematica fit data to inverse gamma distribution
- To: mathgroup at smc.vnet.net
- Subject: [mg117354] mathematica fit data to inverse gamma distribution
- From: Alex <mammasis82 at hotmail.com>
- Date: Wed, 16 Mar 2011 06:25:47 -0500 (EST)
Hi,
I am trying to obtain same figure that is provided in Mathematica's website related to fitting an inverse gamma to a dataset. Here is the code I enter:
data1 = RandomVariate[InverseGammaDistribution[0.5, 3], 10^4];
Show[
Histogram[data1, {0, 20, 1}, "PDF"],
Plot[PDF[
TruncatedDistribution[{0, 20}, InverseGammaDistribution[0.5, 3]],
x], {x, 0, 20}, PlotStyle -> Thick]]
and here is the error I receive:
Histogram::hspec: The height specification PDF is not one of the named height functions or a function that can be used to compute the heights for each bin. >>
Show::"gcomb" : StyleBox[Could not combine the graphics objects in .....
I would appreciate anyone's help.
Regards
Alex