4

【判别分析】理论篇

 2 years ago
source link: https://www.guofei.site/2017/12/03/discriminantanalysis.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【判别分析】理论篇

2017年12月03日

Author: Guofei

文章归类: 2-1-有监督学习 ,文章编号: 230


版权声明:本文作者是郭飞。转载随意,但需要标明原文链接,并通知本人
原文链接:https://www.guofei.site/2017/12/03/discriminantanalysis.html

Edit

问题介绍

每个样本有p个维度X=(X1,X2,…Xp)X=(X1,X2,…Xp)
有k个类别G1,G2,…GkG1,G2,…Gk
那么,对于一个新样本,如何判断这个样本属于哪一类呢?

判别分析有很多种,这里介绍两种:距离判别法、贝叶斯判别法

距离判别法

距离的介绍

闵可夫斯基距离

马氏距离(Mahalanobis distance)

  • 同一总体两样本之间d(x,y)=(x−y)TΣ−1(x−y)−−−−−−−−−−−−−−−√d(x,y)=(x−y)TΣ−1(x−y)
    其中ΣΣ是总体的协方差矩阵
  • 一个样本到一个总体的距离
    d(x,G)=(x−u)TΣ−1(x−u)−−−−−−−−−−−−−−−−√d(x,G)=(x−u)TΣ−1(x−u)
    其中,u=EGu=EG
  • 两个等协方差矩阵的总体之间的距离 d(G1,G2)=(u1−u2)TΣ−1(u1−u2)−−−−−−−−−−−−−−−−−−−√d(G1,G2)=(u1−u2)TΣ−1(u1−u2)

判别

定义马氏距离后,判别方法就不难想出

1. 两个同方差整体

检验d(x,G1)−d(x,G2)d(x,G1)−d(x,G2)的符号,便可以确定x属于哪个类

2. 两不等方差整体

step1: 检验方差齐性
step2: 检验d(x,G1)−d(x,G2)d(x,G1)−d(x,G2)的符号

4. 多个整体

argmink∈Kd(x,Gk)arg⁡mink∈Kd(x,Gk)

贝叶斯判别法

一般的贝叶斯判别法

假设:
两个p元总体G1,G2G1,G2的概率密度函数是f1(x),f2(x)f1(x),f2(x)
先验概率p1=P(G1),p2=P(G2),(p1+p2=1)p1=P(G1),p2=P(G2),(p1+p2=1)
有:
P(G1∣x)=p1f1(x)p1f1(x)+p2f2(x),P(G2∣x)=p2f2(x)p1f1(x)+p2f2(x)P(G1∣x)=p1f1(x)p1f1(x)+p2f2(x),P(G2∣x)=p2f2(x)p1f1(x)+p2f2(x)
比较这两个概率即可。

参考资料

https://en.wikipedia.org/wiki/Linear_discriminant_analysis
《MATLAB数据分析方法》李柏年,机械工业出版社
《应用多元统计分析》朱建平,科学出版社


您的支持将鼓励我继续创作!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK