Example (vii)

Definitions of Gaussian #1

μ1 = {.3, .3} ; RowBox[{RowBox[{Σ1,  , =,  , RowBox[{{, RowBox[{RowBox[{{, RowBox[{1., ,, -.5}], }}], ,, {-.5, .5}}], }}]}], ;}]

Definition of Gaussian #2

μ2 = {-.5, -.5} ; RowBox[{RowBox[{Σ2,  , =,  , RowBox[{{, RowBox[{RowBox[{{, RowBox[{1., ,, .5}], }}], ,, {.5, .5}}], }}]}], ;}]

Desired plot range

prLocal = {{-2, 2}, {-2, 2}} ;

Log likelihood of first Gaussian

lp1 = logpdf[μ1, Σ1] // Chop ;  lp1 // TraditionalForm

FormBox[RowBox[{RowBox[{RowBox[{-, 1.}],  , x^2}], +, RowBox[{RowBox[{(, RowBox[{RowBox[{1.2,  ... Box[{RowBox[{1.8, }], -, RowBox[{2.,  , y}]}], )}],  , y}], -, 1.59473}], TraditionalForm]

Log likelihood of second Gaussian

lp2 = logpdf[μ2, Σ2] // Chop ; lp2 // TraditionalForm

FormBox[RowBox[{RowBox[{RowBox[{-, 1.}],  , x^2}], +, RowBox[{2.,  , y,  , x}], +, RowBox[{Row ... [{(, RowBox[{RowBox[{RowBox[{-, 2.}],  , y}], -, 1.}], )}],  , y}], -, 1.39473}], TraditionalForm]

Decision boundary

Simplify[lp1 - lp2  0]    // Chop// TraditionalForm

FormBox[RowBox[{RowBox[{RowBox[{RowBox[{-, 4.}],  , y,  , x}], +, RowBox[{1.2,  , x}], +, RowBox[{2.8,  , y}]}], ==, 0.2}], TraditionalForm]

View Gaussians

ShowTwoGaussianPDFs[Exp[lp1 // N], Exp[lp2 // N], prLocal, x, y, yS, imSize] ;

[Graphics:../HTMLFiles/index_104.gif]

View decision boundary

ShowDecisionBoundary[μ1, Σ1, μ2, Σ2, prLocal, classColors, {data1Color, data2Color}, yS] ;

[Graphics:../HTMLFiles/index_106.gif]


Created by Mathematica  (September 8, 2003)