Wolfram
Mathematica
8의 신기능: 매개 변수 확률 분포
◄
이전
|
다음
►
핵심 알고리즘
로지스틱 분포를 이용한 작은 변화 시뮬레이션
LogisticDistribution
은 직전일의 주식 종가로부터 소량의 가격 변동에 대해 매우 높은 적합도를 제공합니다.
EstimatedDistribution
를 사용하여 2000년 1 월 1 일부터 2009년 1 월 1 일까지의 S&P 500 지수의 매일 매일의 작은 가격 변동에 대한 로지스틱 분포로 최적의 적합을 찾아줍니다. 그리고 이 분포를 사용하여 시뮬레이션을 실행합니다.
In[1]:=
X
sp500 = FinancialData["SP500", "FractionalChange", {{2000, 1, 1}, {2009, 1, 1}, "Day"}];
In[2]:=
X
edist = EstimatedDistribution[sp500[[All, 2]], LogisticDistribution[\[Mu], \[Beta]]];
In[3]:=
X
Show[Histogram[sp500[[All, 2]], {-0.05, 0.13, 0.005}, "PDF", PlotRange -> {0, 60}, ChartStyle -> "Pastel"], Plot[PDF[edist, x], {x, -0.1, 0.12}, PlotStyle -> {Thick, Black}, PlotRange -> All], BaseStyle -> {FontFamily -> "Verdana"}, ImageSize -> 430, Epilog -> Inset[Framed[ Style[Grid[{{"Estimated distribution: "}, { Round[#, 0.000001] & /@ edist}}], 11, FontFamily -> "Verdana"], Background -> LightBlue, 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:"]
Out[3]=
Out[3]=