明考夫斯基距离简称明氏距离,按取值不同又可分成: o绝对距离(q1)md1()=∑Xk-Xk 曼哈顿距离 欧氏距离(2)=→(2 IXL-X) j o切比雪夫距离()=()=mNx-x
明考夫斯基距离简称明氏距离,按取值不同又可分成: 绝对距离(q=1 ) 曼哈顿距离 欧氏距离(q=2 ) 切比雪夫距离(q=∞) 1 (1) p ij ik jk k d X X = = − 2 1/ 2 1 (2) ( ) p ij ik jk k d X X = = − 1 ( ) max ij ik jk k p d X X = −
明氏距离的不足之处及解决办法: 明氏距离没有考虑指标的数量级水平及量纲。当各 变量数量级相差悬殊且量纲不同时,采用明氏距离 并不合理。 解决办法:先对数据标准化,然后用标准化后的 数据计算距离。 使用欧氏距离要求各坐标对欧氏距离的贡献是同等 的且变差大小也是相同的。这样的欧氏距离才合适 ,效果也较好,否则就不能如实的反映情况。 ◆解决办法是对坐标加权,产生“统计距离
明氏距离的不足之处及解决办法: ① 明氏距离没有考虑指标的数量级水平及量纲。当各 变量数量级相差悬殊且量纲不同时,采用明氏距离 并不合理。 ◆ 解决办法:先对数据标准化,然后用标准化后的 数据计算距离。 ② 使用欧氏距离要求各坐标对欧氏距离的贡献是同等 的且变差大小也是相同的。这样的欧氏距离才合适 ,效果也较好,否则就不能如实的反映情况。 ◆ 解决办法是对坐标加权,产生“统计距离
利用 MATLAB计算明氏距离 o pdist函数 命令行窗囗 euclidean Euclidean distance(default) >>d= pdist(x, minkowski, 1) i euclidean Standardized euclidean distance. each coordinate difference between rows in x is scaled by dividing by the corresponding element of the standard deviation S=nanstd (X) To specify another value for s, use D-=pdist (X,'seuclidean, s) 4.805412.23427.4288 'cityblock' City block metric. >>D= pdist(x, minkowski, 2) minkowski Minkowski distance. The default exponent is 2. To specify a different exponent, useD pdist(X,'minkowski, P), where P is a scalar positive value of the exponent ' chebychev Chebychev distance(maximum coordinate difference). 3.43088.67275.2548 mahalanobis Mahalanobis distance, using the sample covariance of x as computed by >>D= pdist(x, minkowski,, +inf) nancov. To compute the distance with a different covariance, use D pdist (X,'mahalanobis, C), where the matrix C is symmetric and positive D I cosine One minus the cosine of the included angle between points (treated as vectors) 2.73806.55143.8134 correlation One minus the sample correlation between points(treated as sequences of spearman One minus the sample Spearman s rank correlation between observations (treated as sequences of values)
利用MATLAB计算明氏距离 pdist函数
(二)线性相关系数 o皮尔森相关系数: r=X1(2)=2) 其中,为基因向量x的期望值,σx为x的标准差: 为基因向量y的期望值,可y为y的标准差; n为向量的维数。 o皮尔森相关距离:1-r,取值在0-2之间
(二)线性相关系数 皮尔森相关系数: 其中, 为基因向量x的期望值, 为x的标准差; 为基因向量y的期望值, 为y的标准差; n为向量的维数。 皮尔森相关距离:1-r,取值在0-2之间
皮尔森相关系数主要考虑坐标变化的一致性(对应坐 标同时增加或减少) 若向量代表特定实验条件的基因的测量值时,当基因 在两个实验中的值以相同的方式变化时,即使改变的 大小有很大的不同,这两个实验的 Pearson相关系数 也会很高
皮尔森相关系数主要考虑坐标变化的一致性(对应坐 标同时增加或减少); 若向量代表特定实验条件的基因的测量值时,当基因 在两个实验中的值以相同的方式变化时,即使改变的 大小有很大的不同,这两个实验的Pearson相关系数 也会很高