博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mahalanobis Distance(马氏距离)
阅读量:6976 次
发布时间:2019-06-27

本文共 1570 字,大约阅读时间需要 5 分钟。

(from:)

 

Mahalanobis distance

In , Mahalanobis distance is a  measure introduced by  in 1936.It is based on  between variables by which different patterns can be identified and analyzed. It gauges similarity of an unknown  to a known one. It differs from in that it takes into account the correlations of the  and is . In other words, it is a .

Definition

Formally, the Mahalanobis distance of a multivariate vector x = ( x_1, x_2, x_3, \dots, x_N )^T from a group of values with mean \mu = ( \mu_1, \mu_2, \mu_3, \dots , \mu_N )^T and  S is defined as:

D_M(x) = \sqrt{(x - \mu)^T S^{-1} (x-\mu)}.\,

(注:1.这个是X和总体均值的马氏距离。2.这里的S是可逆的,那么协方差矩阵不可逆的话怎么办?)

Mahalanobis distance (or "generalized squared interpoint distance" for its squared value) can also be defined as a dissimilarity measure between two  \vec{x} and \vec{y} of the same  with the  S :

d(\vec{x},\vec{y})=\sqrt{(\vec{x}-\vec{y})^T S^{-1} (\vec{x}-\vec{y})}.\,

If the covariance matrix is the identity matrix, the Mahalanobis distance reduces to the . If the covariance matrix is , then the resulting distance measure is called the normalized Euclidean distance:

d(\vec{x},\vec{y})= \sqrt{\sum_{i=1}^N  {(x_i - y_i)^2 \over s_{i}^2}},

where s_{i} is the  of the x_i ( y_i) over the sample set.

(源自:百度百科)

马氏优缺点:

1.马氏距离的计算是建立在总体样本的基础上的,这一点可以从上述协方差矩阵的解释中可以得出,也就是说,如果拿同样的两个样本,放入两个不同的总体中,最后计算得出的两个样本间的马氏距离通常是不相同的,除非这两个总体的协方差矩阵碰巧相同。
 
2.在计算马氏距离过程中,要求总体样本数大于样本的维数,否则得到的总体样本协方差矩阵逆矩阵不存在,这种情况下,用欧式距离计算即可。
 
3.还有一种情况,满足了条件总体样本数大于样本的维数,但是协方差矩阵的逆矩阵仍然不存在,比如三个样本点(3,4),(5,6)和(7,8)这种情况是因为这三个样本在其所处的二维空间平面内共线。这种情况下,也采用欧式距离计算。
 
4.在实际应用中“总体样本数大于样本的维数”这个条件是很容易满足的,而所有样本点出现3)中所描述的情况是很少出现的,所以在绝大多数情况下,马氏距离是可以顺利计算的,但是马氏距离的计算是不稳定的,不稳定的来源是协方差矩阵,这也是马氏距离与欧式距离的最大差异之处。
   
优点:它不受量纲的影响,两点之间的马氏距离与原始数据的测量单位无关;由标准化数据和中心化数据(即原始数据与均值之差)计算出的二点之间的马氏距离相同。马氏距离还可以排除变量之间的相关性的干扰。
 
缺点:它的缺点是夸大了变化微小的变量的作用。

转载于:https://www.cnblogs.com/kevinGaoblog/archive/2012/06/19/2555448.html

你可能感兴趣的文章
dlib编译成静态库及被其它程序调用
查看>>
UNIX网络编程之epoll的 accept , read , write
查看>>
java事务管理
查看>>
分布式MySQL 数据库
查看>>
MMX指令集系列之一----数据加载与算术运算指令
查看>>
R语言可视化二
查看>>
Python abs() 函数
查看>>
西电网络赛 - C
查看>>
div布局方案整理
查看>>
Python之内置函数再总结
查看>>
同步锁,死锁现象与递归锁,信息量Semaphore.....(Day36)
查看>>
sql server 索引阐述系列三 表的堆组织
查看>>
GD库笔记
查看>>
js函数知识点
查看>>
Centos 配置eth0 提示Device does not seem to be present
查看>>
redis5.0.3单实例简单安装记录
查看>>
metro 微博api开发,post请求
查看>>
C#中UDP数据的发送、接收
查看>>
自己设计大学排名-数据库实践
查看>>
linux环境jmeter- java环境安装配置
查看>>