Stat841f09 - Wiki Course Notes

# In doing so we make it very easy to tell which class

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: h cloud onto one point on some projected line, then make those two points as far apart as possible. In doing so, we make it very easy to tell which class a data point belongs to. In practice, it is not possible to collapse all of the points in a cloud to one point, but we attempt to make all of the points in a cloud close to each other while simultaneously far from the points in the other cloud. Example in R P CA and FDA primary dimension for normal multivariate data, using R (http://www.r-project.org) . wikicour senote.com/w/index.php?title= Stat841&pr intable= yes 17/74 10/09/2013 Stat841 - Wiki Cour se Notes > X=mti(rw40no=) > arxno=0,cl2 > X120]=mromn20m=(,)Sgamti((,.,.,)2) > [:0, vnr(=0,uc11,im=arxc115153,) > X2140]=mromn20m=(,)Sgamti((,.,.,)2) > [0:0, vnr(=0,uc53,im=arxc115153,) > Y=crp"e"20,e(bu"20) > (e(rd,0)rp"le,0) Create 2 multivariate normal random variables with . Create Y an index indicating which class they , belong to. > s< sdXn=,v1 > - v(,u1n=) Calculate the singular value decomposition of X. The most significant direction is in s v , ] and is displayed as a black line. \$[1, > s < laXgopn=) > 2 - d(,ruigY The l afunction, given the group for each item, uses Fischer's Linear Discriminant Analysis (FLDA) to find the most discriminant direction. This can be found in d s\$cln. 2saig Now that we've calculated the PCA and FLDA decompositions, we create a plot to demonstrate the differences between the two algorithms. FLDA is clearly better suited to discriminating between two classes whereas PCA is primarily good for reducing the number of dimensions when data is high- dimensional. > po(,o=,an"C v.FAeape) > ltXclYmi=PA s D xml" Plot the set of points, according to colours given in Y. > soe=sv2/\$ > lp \$sv1 > itret=ma([2)soema([1) > necp enX,]-lp*enX,] > aln(=necp,=lp) > bieaitretbsoe Plot the main PCA direction, drawn through the mean of the dataset. Only the direction is significant. >...
View Full Document

## This document was uploaded on 03/07/2014.

Ask a homework question - tutors are online