比较风速的两个模型
将风速数据拟合为瑞利和极值模型,将拟合结果和数据与核密度估计相比较,并定性比较经验分位数和拟合分位数.
maxWinds = WeatherData["Boston", "MaxWindSpeed", {{1950, 1, 1}, {2009, 12, 31}, "Month"}]["Values"][[All, 1]];rdist = EstimatedDistribution[maxWinds, RayleighDistribution[θ]];
evdist = EstimatedDistribution[maxWinds, ExtremeValueDistribution[a, b]];GraphicsGrid[{Table[Show[Histogram[maxWinds, Automatic, "PDF", PlotRange -> {{0, 140}, All}, ChartStyle -> "Aquamarine"], Plot[PDF[i, x], {x, 0, 140}, PlotRange -> {0, .045}, PlotStyle -> {Blend[{Blue, Black}], Thick}], SmoothHistogram[maxWinds, PlotStyle -> {Blend[{Black, Purple}], Thick}, FillingStyle -> Directive[Opacity[.5], ColorData[1, 2]]], PlotLabel -> Style[StringDrop[ToString[Head[i]], -12], FontFamily -> "Verdana"], Axes -> {True, False}], {i, {rdist, evdist}}], Table[QuantilePlot[maxWinds, i, PlotStyle -> {Blend[{Blue, Black}], Thick}], {i, {rdist, evdist}}]}]