使用逻辑斯谛分布模拟百分比变化
LogisticDistribution 根据先前股票收盘价格为百分比价格变化提供很好的拟合. 使用 EstimatedDistribution 为2000年1月1日至2009年1月1日的 S&P 500指数的每日百分比价格变化找到带有逻辑斯谛分布的最佳拟合. 然后使用该分布进行模拟.
sp500 = TimeSeriesMap[Normal[#, Quantity]&, FinancialData["SP500", "FractionalChange", {{2000, 1, 1}, {2009, 1, 1}, "Day"}]];edist = EstimatedDistribution[sp500, LogisticDistribution[μ, β]]Show[Histogram[sp500, {-0.05, 0.07, 0.005}, "PDF", PlotRange -> {0, 55}, ChartStyle -> "GrayTones"], Plot[PDF[edist, x], {x, -0.1, 0.07}, PlotStyle -> {AbsoluteThickness[3], StandardMagenta}, PlotRange -> All], BaseStyle -> {FontFamily -> "Verdana"}, ImageSize -> 430, Epilog -> Inset[Framed[Style[Grid[{{"Estimated distribution: "}, {Round[#, 0.000001]& /@ edist}}], 11, FontFamily -> "Verdana"], Background -> StandardBlue, RoundingRadius -> 3], {Right, Top}, {Right, Top}]]ListPlot[RandomVariate[edist, 30], Joined -> True, PlotStyle -> Thick, ImageSize -> 400, BaseStyle -> {FontFamily -> "Verdana"}, PlotLabel -> "Simulate fractional price changes for 30 days:"]