New in Wolfram
Mathematica
8: 母数推定と検定
◄
previous
|
next
►
コアとなるアルゴリズム
成分混合分布を使って,多峰データをモデル化する
いくつかのカーネル密度推定を使い,間欠泉の噴出間隔についての混合成分の数を決定し,データをガンマ分布の混合にフィットして母数を推定する.
In[1]:=
X
waiting = ExampleData[{"Statistics", "OldFaithful"}][[All, 2]];
In[2]:=
X
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}}];
In[3]:=
X
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
Out[3]=