地震のマグニチュードについての混合モデルを分解する
地震のマグニチュードについての混合モデルを分解する
過去の地震のマグニチュードの混合モデルの構成要素をデータに対してプロットし,特定のマグニチュードがモデルの各構成要素から来ている確率を可視化する.
magnitudes = Select[ExampleData[{"Statistics", "USEarthquakes"}], #[[1]] ≥ 1935&][[All, 7]];edist = EstimatedDistribution[magnitudes, MixtureDistribution[{p, 1 - p}, {NormalDistribution[a, b], NormalDistribution[c, d]}]];wts = Table[edist[[1, i]] PDF[edist[[2, i]], x], {i, 2}];
h = Histogram[magnitudes, 20, "ProbabilityDensity", ChartStyle -> Directive[Opacity[.6], Hue[.242, .4, .8]]];
GraphicsRow[{Show[h, Plot[wts, {x, 2, 8}, PlotStyle -> {{Hue[.01, .6, .6], Thick}, {Hue[.6, .7, .7], Thick}}, PlotRange -> All], PlotLabel -> Style["確率密度関数の構成要素", FontFamily -> "Verdana"]], Plot[Evaluate[Table[edist[[1, i]] PDF[edist[[2, i]], x] / Total[wts], {i, 2}]], {x, 3, 7}, PlotStyle -> {{Hue[.01, .6, .6], Thick}, {Hue[.6, .7, .7], Thick}}, FillingStyle -> {1 -> Directive[Opacity[.3], Hue[.01, .6, .6]], 2 -> Directive[Opacity[.3], Hue[.6, .7, .7]]}, PlotRange -> All, Filling -> Axis, PlotLabel -> Style["構成要素の確率", FontFamily -> "Verdana"]]}]