New in Wolfram
Mathematica
8: Parameter Estimation and Testing
◄
previous
|
next
►
Core Algorithms
Use Hotelling's
Test to Detect Counterfeit Bills
Compute Hotelling's
statistics on various pairs of measurements for genuine and counterfeit Swiss bank notes to choose the best pair of indicators that a bill is counterfeit.
In[1]:=
X
data = ExampleData[{"Statistics", "SwissBankNotes"}]; colheads = ExampleData[{"Statistics", "SwissBankNotes"}, "ColumnHeadings"];
In[2]:=
X
Framed[GraphicsGrid[ Table[cBills = Pick[data[[All, {i, j}]], data[[All, -1]], 1]; gBills = Pick[data[[All, {i, j}]], data[[All, -1]], 0]; If[i == j, Graphics[ Style[Text[colheads[[i]]], Bold, FontSize -> 12, FontFamily -> "Verdana"], Background -> White, Frame -> True, FrameTicks -> None], ListPlot[{cBills, gBills}, PlotStyle -> {{PointSize -> .05, Hue[.742, .7, .7]}, {PointSize -> .05, Hue[.242, .7, .7]}}, Frame -> True, Axes -> False, FrameTicks -> None, AspectRatio -> 1, Background -> White, ImageSize -> 80, Epilog -> Inset[Framed[ Style[ToString@ NumberForm[ TTest[{cBills, gBills}, Automatic, "TestStatistic", VerifyTestAssumptions -> None], {4, 1}], Bold, FontFamily -> "Verdana"], RoundingRadius -> 5, Background -> Directive[Lighter[Yellow, .75]]], Scaled[{.3, .75}]]]], {i, 6}, {j, 6}]], RoundingRadius -> 10, FrameMargins -> 10, Background -> GrayLevel[.9]]
Out[2]=