【正文】
u p Ce n t r o id s321321C an o n i c al D i s c r i mi n an t F u n c t i o n sF u n ct io n 1100 1 0Function 243210123G R O U PG r o u p Ce n t r o id s321321原先的圖 ?下面是基于 4個變量時分類結(jié)果表: ? 這個表的結(jié)果是有 87個點 ( %) 得到正確劃分 , 有3個點被錯誤判別;其中第二類有兩個被誤判為第一類 ,有一個被誤判為第三類 。當然,在應用中,選擇余地不見得有多大。使用較少的變量意味著節(jié)省資源和易于對結(jié)果作解釋。 ?注意訓練樣本的正確和錯誤分類率。然后在 Independents輸入所有想用的變量;但如果要用逐步判別,則不選 Enter independents together,而選擇 Use stepwise method, ? 在方法( Method)中選挑選變量的準則(檢驗方法;默認值為 Wilks’ Lambda)。 39。 max39。 39。 。 )39。mmnkmmiminkm m m miimiS S E a x a xa x x x x a a Ea??????? ? ? ?????( ) ( ) ( ) ( )11( ) ( ) 39。39。 ( )2D x G D x G x m m m m?? ? ? ? S ?記 ( 1 ) ( 2 ) 1 ( 1 ) ( 2 )1 ( ) 。( ) ( , ..., )( ) , ..., ( )pppp p pxW x x a a x a axa x a xmmmmmm?? ???? ? ? ? ????? ???? ? ?顯然 W(x)為 x1,…, x p的線性函數(shù) , 稱為線性判別函數(shù) 。( ) ( ) ( ) 39。( ) ( )( ) 39。v x v x當總體方差相等時 閾值為 ( 1 ) ( 2 ) ( 1 ) ( 2 )1 1 1( 39。 , .. ., 39。11niiis v x x x x v v A vnn ?? ? ? ????總體方差不等時 ,注意到 的樣本方差為 ( 1 ) ( 2 )* 2 1 1 11239。39。i i iiy v x v s v y v x?? ? ?m=1時 , 不加權法 : ( ) ( )| ( ) | m in | ( ) |ij jiy x y y x y x G? ? ? ? ?m=1時 , 加權法 : 按大小排列 ( 1 ) ( ), .. ., ( 1 ) ( )ky y y y k? ? ?Di,i+1可為相應兩類的分界點 相應的標準差為 令 (1 ) , ... , ( )k??,1( 1 ) ( ) ( ) ( 1 ) , 1 , . . . , 1( 1 ) ( )iii y i i y id i kii?????? ? ?? ? ???1 , , 1()i i i i id y x d x G??? ? ? ?m1時 , 不加權法 : 記 對 x=(x1,…,)’, y l(x)=v(l)’x m1時 , 加權法 : 記 2 ( ) 21[ ( ) ] , 1 , . . . ,mii l llD y x y i k?? ? ??則 則 22m iniiD D x G??? ? ?( ) ( ) ( )39。 L a m b d a C h i s q u a r e df S i g .鳶尾花數(shù)據(jù) (有關判別函數(shù)的輸出 ) S t a n d a r d i z e d C a n o n i c a l D i s c r i m i n a n tF u n c t i o n C o e f f i c i e n t s . 3 4 6 . 0 3 9 . 5 2 5 . 7 4 2. 8 4 6 . 3 8 6. 6 1 3 . 5 5 5花萼長花萼寬花瓣長花瓣寬1 2F u n c t i o n標準化的典則判別函數(shù)系數(shù) (使用時必須用標準化的自變量 ) 1 1 2 3 42 1 2 3 40 . 3 4 6 0 . 5 2 5 0 . 8 4 6 0 . 6 1 30 . 0 3 9 0 . 7 4 2 0 . 3 8 6 0 . 5 5 5y x x x xy x x x x? ? ? ? ?? ? ? ?鳶尾花數(shù)據(jù) (有關判別函數(shù)的輸出 ) C a n o n i c a l D i s c r i m i n a n t F u n c t i o n C o e f f i c i e n t s . 0 6 3 . 0 0 7 . 1 5 5 . 2 1 8. 1 9 6 . 0 8 9. 2 9 9 . 2 7 1 2 . 5 2 6 6 . 9 8 7花萼長花萼寬花瓣長花瓣寬( C o n s t a n t )1 2F u n c t i o nU n s t a n d a r d i z e d c o e f f i c i e n t s典則判別函數(shù)系數(shù) 1 1 2 3 42 1 2 3 40 . 0 6 3 0 . 1 5 5 0 . 1 9 6 0 . 2 9 9 2 . 5 2 60 . 0 0 7 0 . 2 1 8 0 . 0 8 9 0 . 2 7 1 6 . 9 4 8y x x x xy x x x x? ? ? ? ? ?? ? ? ? ?鳶尾花數(shù)據(jù) (有關判別函數(shù)的輸出 ) 這是類均值 (重心 )處的典則判別函數(shù)值 F u n c t i o n s a t G r o u p C e n t r o i d s 7 . 3 9 2 . 2 1 91 . 7 6 3 . 7 3 75 . 6 2 9 . 5 1 8分類剛毛鳶尾花變色鳶尾花佛吉尼亞鳶尾花1 2F u n c t i o nU n s t a n d a r d i z e d c a n o n i c a l d i s c r i m i n a n tf u n c t i o n s e v a l u a t e d a t g r o u p m e a n s這是典則判別函數(shù) (前面兩個函數(shù) )在類均值 (重心 )處的值 鳶尾花數(shù)據(jù) (用判別函數(shù)對觀測量分類結(jié)果 ) C l a s s i f i c a t i o n P r o c e s s i n g S u m m a r y1 5 0001 5 0P r o c e s s e dM i s s i n g o r o u t o f r a n g eg r o u p c o d e sA t l e a s t o n e m i s s i n gd i s c r i m i n a t i n g v a r i a b l eE x c l u d e dU s e d i n O u t p u tP r i o r P r o b a b i l i t i e s f o r G r o u p s. 3 3 3 50 5 0 . 0 0 0. 3 3 3 50 5 0 . 0 0 0. 3 3 3 50 5 0 . 0 0 01 . 0 0 0 1 5 0 1 5 0 . 0 0 0分類剛毛鳶尾花變色鳶尾花佛吉尼亞鳶尾花T o t a lP r i o r U n w e i g h t e d W e i g h t e dC a s e s U s e d i n A n a l y s i sC l a s s i f i c a t i o n F u n c t i o n C o e f f i c i e n t s1 . 6 8 7 1 . 1 0 1 . 8 6 52 . 6 9 5 1 . 0 7 0 . 7 4 7 . 8 8 0 1 . 0 0 1 1 . 6 4 7 2 . 2 8 4 . 1 9 7 1 . 6 9 5 8 0 . 2 6 8 7 1 . 1 9 6 1 0 3 . 8 9 0花萼長花萼寬花瓣長花瓣寬( C o n s t a n t )剛毛鳶尾花 變色鳶尾花佛吉尼亞鳶尾花分類F i s h e r 39。 1 , ...,i l ily c x l m i k? ? ?2 ( ) 21[ ( ) ] , 1 , .. .,mii l l llD y x y i kl?? ? ??22m iniiD D x G??? ? ?Bayes判別法 ?不用判別式 ,而用 比較 新給樣品屬于各個總體的條件概率 P(l|x), l=1,…, k, 的大小 (將新樣品判歸為來自概率最大的總體 ). ?先給出對于 k個總體的先驗概率 q1,…,q k. 如各總體密度為 {fk(x)}, 則后驗概率為 (g=1,…k): P(g|x)=qgfg(x)/Si qifi(x) ?當且僅當 P(h|x)= maxgP(g|x), 判 x來自第 h總體 . ?也可以用使錯判的損失最小來判別 . 如果 c(i|j)為來自 j總體的個體被錯判到第 i總體的損失 . 定義平均錯判損失 (ECM)為 ECM=Si=1 qi[Sl≠iP(l|i)c(l|i)] 逐步判別法 ?前面判別用了所有變量 . ?但是各變量所起作用并不一樣 . ?要有進有出 ,引進“最重要的”并剔除不顯著的 . 根據(jù)是假設檢驗 (比如似然比檢驗 ). ? 檢驗的零假設是各組變量均值相等 . Lambda (Wilks’ Lambda統(tǒng)計量 ) 接近 0表示組均值不同 ,接近 1表示組均值沒有不同 . Chisquare是 lambda的卡方轉(zhuǎn)換 (Bartelett近似 ), 用于確定其顯著性 . 鳶尾花數(shù)據(jù) (花瓣 ,花萼的長寬 ) 5個變量 :花瓣長 (slen),花瓣寬 (swid), 花萼長(plen), 花萼寬 (pwid), 分類號 (1:Setosa, 2:Versicolor, 3:Virginica)(data1404) Statistics→Classify →Discriminant: Variables: independent (slen,swid,plen,pwid) Grouping(spno) Define range(min1,max3) Classify: prior probability(All group equal) use covariance matrix (Withingroups) Plots (Combinedgroups, Separategroups, Territorial map) Display (Summary table) Statistics: Descriptive (Means) Function Coefficients (Fisher’s, Unstandardized) Matrix (Withingroups correlation, Withingroups covariance, Separategroups covariance, Total covariance) Save: (Predicted group membership, Discriminant Scores, Probability of group membership) 鳶尾花數(shù)據(jù) (數(shù)據(jù)分析過程簡明表 ) A n a l y s i s C a s e P r o c e s s i n g S u m m a r y1 5 0 1 0 0 . 00 .00 .00 .00 .01 5 0 1 0 0 . 0U n w e i g h t e d C a s e sV a l i dM i s s i n g o r o u t o f r a n g eg r o u p c o d e sA t l e a s t o n e m i s s i n gd i s c r i m i n a t i n g v a r i a b l eB o t h m i s s i n g o ro u t o f r a n g e g r o u pc o d e s a n d a t l e a s t o n em i s s i n g d i s c r i m i n a t i n gv a r i a b l