使用分量混合模拟多峰数据
使用多个内核密度估计确定间歇泉喷发等待时间的混合分量数并估计参数、拟合数据为一个伽玛分布的混合.
waiting = ExampleData[{"Statistics", "OldFaithful"}][[All, 2]];mdist = MixtureDistribution[{1 / 3, 2 / 3}, {GammaDistribution[a, b], GammaDistribution[c, d]}];
edist = EstimatedDistribution[waiting, mdist, {{a, 80}, {b, .5}, {c, 200}, {d, 0.5}}];dp = DiscretePlot[PDF[EmpiricalDistribution[waiting], x], {x, DeleteDuplicates[waiting]}, Filling -> Axis, PlotRange -> {{35, 100}, All}, AxesOrigin -> {35, 0}, PlotStyle -> Darker@Hue[.908667, .7, .7]];
{Show[dp, Map[SmoothHistogram[waiting, #, PlotRange -> {{35, 100}, All}, PlotStyle -> Darker@Hue[.908667, .7, .7]]&, {{"Adaptive", Automatic, 1}, "SheatherJones", "LeastSquaresCrossValidation", "Oversmooth"}]], Show[dp, Plot[PDF[edist, x], {x, 0, 100}, PlotStyle -> {{Darker@Hue[.908667, .7, .7], Thick}}, Filling -> Axis, FillingStyle -> Directive[Opacity[.2], Hue[.908667, .7, .7]], PlotRange -> {{35, 100}, All}]]}//GraphicsRow