Principal Component Analysis: simple example

Generate data from single 2d Gaussian

Definition of Gaussians

μ = {0, 0} ; RowBox[{RowBox[{Σ,  , =,  , RowBox[{{, RowBox[{RowBox[{{, RowBox[{1., ,, .4}], }}], ,, {.4, .2}}], }}]}], ;}]

Number of points in each class

n = 200 ;

Generate and visualize data

data = Table[Random[MultinormalDistribution[μ, Σ]], {n}] ; gd = PlotData2D[data, pr, ... [gd, PlotRangeAll, FrameTrue, FrameTicksNone, yS, ImageSize400] ;

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

Principal Component Analysis (PCA)

pca = PCA[data] ;

gpca = PCAPlot[pca, 2, {Black, Thickness[.012]}, nS] ; Show[gdata, gpca, yS, ImageSize400] ;

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


Created by Mathematica  (October 20, 2003)