Wolfram
Mathematica
8의 신기능: 매개 변수 추정 및 검정
◄
이전
|
다음
►
핵심 알고리즘
시가지와 고속도로 연비의 이변량 정규 분포 모델링
시가지와 고속도로 연비를 이변량 정규 분포에 적합하여 예상되는 분포와 시가지 및 여러 고속도로 연비에 따른 1 갤런 당 기대 거리를 비교합니다.
In[1]:=
X
midsizeMPG2009 = {{16, 22}, {18, 26}, {17, 25}, {16, 23}, {16, 23}, {14, 19}, {13, 19}, {10, 14}, {10, 17}, {18, 28}, {18, 27}, {17, 25}, {17, 25}, {17, 26}, {17, 26}, {16, 25}, {17, 25}, {15, 22}, {15, 23}, {11, 17}, {11, 17}, {17, 28}, {16, 24}, {16, 25}, {16, 25}, {17, 26}, {18, 26}, {17, 26}, {17, 25}, {17, 26}, {13, 19}, {15, 24}, {17, 26}, {15, 22}, {22, 33}, {22, 30}, {18, 29}, {17, 26}, {26, 34}, {21, 30}, {13, 20}, {19, 27}, {16, 27}, {21, 30}, {13, 20}, {19, 27}, {16, 27}, {24, 30}, {23, 27}, {23, 29}, {21, 25}, {19, 27}, {10, 15}, {9, 16}, {17, 25}, {20, 29}, {20, 28}, {18, 26}, {24, 33}, {25, 33}, {16, 25}, {15, 23}, {22, 32}, {22, 32}, {20, 28}, {23, 30}, {24, 32}, {19, 27}, {19, 26}, {18, 25}, {17, 24}, {16, 24}, {16, 23}, {16, 24}, {16, 23}, {20, 22}, {17, 25}, {20, 29}, {20, 28}, {18, 26}, {17, 24}, {18, 28}, {20, 29}, {21, 30}, {17, 25}, {18, 25}, {23, 32}, {17, 24}, {16, 22}, {15, 22}, {13, 19}, {13, 20}, {20, 27}, {16, 25}, {23, 32}, {23, 31}, {18, 27}, {19, 26}, {35, 33}, {19, 26}, {24, 30}, {21, 29}, {26, 31}, {27, 33}, {24, 32}, {11, 18}, {24, 30}, {24, 32}, {22, 33}, {17, 26}, {26, 34}, {21, 31}, {21, 31}, {19, 28}, {33, 34}, {48, 45}, {19, 29}, {15, 23}, {15, 22}, {16, 25}};
In[2]:=
X
edist = EstimatedDistribution[midsizeMPG2009, BinormalDistribution[{\[Mu]1, \[Mu]2}, {\[Sigma]1, \[Sigma]2}, \ \[Rho]]];
In[3]:=
X
Partition[ Table[With[{mu = Round[Expectation[ x \[Conditioned] y == hwy, {x, y} \[Distributed] edist], .1]}, Plot[PDF[edist, {city, hwy}], {city, 0, 50}, PlotRange -> All, PlotStyle -> {Darker@ColorData[10, hwy/5 - 1], Thick}, Filling -> 0, FillingStyle -> Directive[Opacity[.3], ColorData[10, hwy/5 - 1]], Epilog -> Style[Text[ "\!\(\*SubscriptBox[\(\[Mu]\), \(city\)]\) = " <> ToString[mu], Scaled[{If[mu < 25, .7, .3], .8}]], Bold, FontFamily -> "Verdana"], PlotLabel -> Style["Highway mileage = " <> ToString[hwy], Bold, FontFamily -> "Verdana"]]], {hwy, 15, 40, 5}], 2] // GraphicsGrid
Out[3]=