请教pdist函数mysql 自定义函数距离

Matlab中pdist&函数详解(各种距离的生成)【转】
VIA:http://bulo.hujiang.com/u/6216467/diary/211759/
Pairwise distance between pairs of objects
D = pdist(X)
D = pdist(X,distance)
Description
D = pdist(X)
计算 X 中各对行向量的相互距离(X是一个m-by-n的矩阵). 这里 D 要特别注意,D
是一个长为m(m&1)/2的行向量.可以这样理解 D 的生成:首先生成一个 X
的距离方阵,由于该方阵是对称的,且对角线上的元素为0,所以取此方阵的下三角元素,按照Matlab中矩阵的按列存储原则,此下三角各元素的索引排列即为(2,1),
(3,1), ..., (m,1), (3,2), ..., (m,2), ..., (m,m&1).可以用命令
squareform(D)
将此行向量转换为原距离方阵.(squareform函数是专门干这事的,其逆变换是也是squareform。)
D = pdist(X,distance)
使用指定的距离.distance可以取下面圆括号中的值,用红色标出!
Given an m-by-n data matrix X, which is treated as m (1-by-n) row
vectors x1, x2, ..., xm, the various distances between the vector
xs and xt are defined as follows:
欧几里德距离Euclidean distance('euclidean')
d 2 s,t =(x s x t )(x s x t ) &
Notice that the Euclidean distance is a special case of the
Minkowski metric, where p = 2.
欧氏距离虽然很有用,但也有明显的缺点。
一:它将样品的不同属性(即各指标或各变量)之间的差别等同看待,这一点有时不能满足实际要求。
二:它没有考虑各变量的数量级(量纲),容易犯大数吃小数的毛病。所以,可以先对原始数据进行规范化处理再进行距离计算。
标准欧几里德距离Standardized Euclidean
distance('seuclidean')
d 2 s,t =(x s x t )V 1 (x s x t ) &
where V is the n-by-n diagonal matrix whose jth diagonal element is
S(j)2, where S is the vector of standard
deviations.
相比单纯的欧氏距离,标准欧氏距离能够有效的解决上述缺点。注意,这里的V在许多Matlab函数中是可以自己设定的,不一定非得取标准差,可以依据各变量的重要程度设置不同的值,如knnsearch函数中的Scale属性。
马哈拉诺比斯距离Mahalanobis distance('mahalanobis')
d 2 s,t =(x s x t )C 1 (x s x t ) &
where C is the covariance matrix.
马氏距离是由印度统计学家马哈拉诺比斯(P. C.
Mahalanobis)提出的,表示数据的协方差距离。它是一种有效的计算两个未知样本集的相似度的方法。与欧式距离不同的是它考虑到各种特性之间的联系(例如:一条关于身高的信息会带来一条关于体重的信息,因为两者是有关联的)并且是尺度无关的(scale-invariant),即独立于测量尺度。
如果协方差矩阵为单位矩阵,那么马氏距离就简化为欧式距离,如果协方差矩阵为对角阵,则其也可称为正规化的欧氏距离.
马氏优缺点:
  1)马氏距离的计算是建立在总体样本的基础上的,因为C是由总样本计算而来,所以马氏距离的计算是不稳定的;
  2)在计算马氏距离过程中,要求总体样本数大于样本的维数。
  3)协方差矩阵的逆矩阵可能不存在。&
曼哈顿距离(城市区块距离)City block metric('cityblock')
d s,t =∑ j=1 n ∣ ∣ x s j &x t j
&∣ ∣ &
Notice that the city block distance is a special case of the
Minkowski metric, where p=1.
闵可夫斯基距离Minkowski metric('minkowski')
d s,t =∑ j=1 n ∣ ∣ x s j &x t j
&∣ ∣ &p &
Notice that for the special case of p = 1, the Minkowski metric
gives the city block metric, for the special case of p = 2, the
Minkowski metric gives the Euclidean distance, and for the special
case of p = ∞, the Minkowski metric gives the Chebychev
闵可夫斯基距离由于是欧氏距离的推广,所以其缺点与欧氏距离大致相同。
切比雪夫距离Chebychev distance('chebychev')
d s,t =max j ∣ ∣ x s j &x t j &∣
Notice that the Chebychev distance is a special case of the
Minkowski metric, where p = ∞.
夹角余弦距离Cosine distance('cosine')
d s,t =1x s x t && &∥x s ∥ 2 ∥x t
∥ 2 & &
与Jaccard距离相比,Cosine距离不仅忽略0-0匹配,而且能够处理非二元向量,即考虑到变量值的大小。
相关距离Correlation distance('correlation')
d s,t =1x s x t && &(x s x s
&ˉ ˉ ˉ &)(x s x s
&ˉ ˉ ˉ &) & & √
(x t x t &ˉ ˉ ˉ &)(x t x t
&ˉ ˉ ˉ &) & & √
Correlation距离主要用来度量两个向量的线性相关程度。
汉明距离Hamming distance('hamming')
d s,t =(#(x s j &≠x t j &) n
两个向量之间的汉明距离的定义为两个向量不同的变量个数所占变量总数的百分比。
杰卡德距离Jaccard distance('jaccard')
d s,t =#[(x s j &≠x t j &)∩((x s
j &≠0)∪(x t j &≠0))] #[(x s j
&≠0)∪(x t j &≠0)]
Jaccard距离常用来处理仅包含非对称的二元(0-1)属性的对象。很显然,Jaccard距离不关心0-0匹配,而Hamming距离关心0-0匹配。
Spearman distance('spearman')
d s,t =1(r s r s &ˉ ˉ ˉ &)(r t r
t &ˉ ˉ ˉ &) &
&(r s r s &ˉ ˉ ˉ
&)(r s r s &ˉ ˉ ˉ
&) & & √ (r t r t
&ˉ ˉ ˉ &)(r t r t
&ˉ ˉ ˉ &) & & √
rsj is the rank of xsj taken over x1j, x2j, ...xmj, as computed by
rs and rt are the coordinate-wise rank vectors of xs and xt, i.e.,
rs = (rs1, rs2, ... rsn)
r s &ˉ ˉ ˉ &=1 n
&∑ j r s j &=n+1 2
r t &ˉ ˉ ˉ &=1 n
&∑ j r t j &=n+1 2
二、pdist2
Pairwise distance between two sets of
observations
D = pdist2(X,Y)
D = pdist2(X,Y,distance)
D = pdist2(X,Y,'minkowski',P)
D = pdist2(X,Y,'mahalanobis',C)
D = pdist2(X,Y,distance,'Smallest',K)
D = pdist2(X,Y,distance,'Largest',K)
[D,I] = pdist2(X,Y,distance,'Smallest',K)
[D,I] = pdist2(X,Y,distance,'Largest',K)
Description
这里 X 是 mx-by-n 维矩阵,Y 是 my-by-n 维矩阵,生成 mx-by-my 维距离矩阵
[D,I] = pdist2(X,Y,distance,'Smallest',K)
生成 K-by-my 维矩阵 D 和同维矩阵 I,其中D的每列是原距离矩阵中最小的元素,按从小到大排列,I
中对应的列即为其索引号。注意,这里每列各自独立地取 K 个最小值。
例如,令原mx-by-my 维距离矩阵为A,则 K-by-my 维矩阵 D 满足
D(:,j)=A(I(:,j),j).
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Matlab常用函数之pdist
返回值为向量形式:内容为M*N矩阵X中各成对成分之间两两的欧式距离. D =
pdist(X);D为1*M*(M-1)/2维向量.
其他具体用法: D = pdist(X, DISTANCE) computes D using DISTANCE.
&Choices are:
& 'euclidean' & - Euclidean
distance (default)
& 'seuclidean' &- 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).
& 'cityblock' & - City Block
& 'minkowski' & - Minkowski
distance. The default exponent is 2. To
& & & specify a
different exponent, use
pdist(X,'minkowski',P), where the exponent P is
& & & a scalar
positive value.
& 'chebychev' & - Chebychev
distance (maximum coordinate difference)
& 'mahalanobis' - Mahalanobis distance, using the
sample covariance
& & & of X as
computed by NANCOV. To compute the distance
& & & with a
different covariance, use
&pdist(X,'mahalanobis',C), where the matrix
symmetric and positive definite.
& 'cosine' & &
&- One minus the cosine of the included
& & & between
observations (treated as vectors)
& 'correlation' - One minus the sample linear
correlation between
observations (treated as sequences of values).
& 'spearman' &
&- One minus the sample Spearman's rank
correlation
& & & between
observations (treated as sequences of values).
& 'hamming' & &
- Hamming distance, percentage of coordinates
& & & that
& 'jaccard' & &
- One minus the Jaccard coefficient, the
& & & percentage
of nonzero coordinates that differ
& function & &
&- A distance function specified using @,
& & & example
& & A distance function must
be of the form
& & function D2 = DISTFUN(XI,
& & taking as arguments a
1-by-N vector XI containing a single row of X, an
& & M2-by-N matrix XJ
containing multiple rows of X, and returning an
& & M2-by-1 vector of
distances D2, whose Jth element is the distance
& & between the observations
XI and XJ(J,:).
& & The output D is arranged
in the order of ((2,1),(3,1),..., (M,1),
(3,2),...(M,2),.....(M,M-1)), i.e. the lower left triangle of the
& & M-by-M distance matrix
in column order. &To get the distance
& & the Ith and Jth
observations (I & J), either use the formula
& & D((I-1)*(M-I/2)+J-I), or
use the helper function Z = SQUAREFORM(D),
& & which returns an M-by-M
square symmetric matrix, with the (I,J) entry
& & equal to distance
between observation I and observation J.
& & Example:
&% Compute the ordinary Euclidean distance
&X = randn(100, 5); &
& % some random points
&D = pdist(X, 'euclidean'); &
euclidean distance
&% Compute the Euclidean distance with each
coordinate difference
&% scaled by the standard deviation
&Dstd = pdist(X,'seuclidean');
&% Use a function handle to compute a distance
that weights each
&% coordinate contribution differently
&Wgts = [.1 .3 .3 .2 .1]; &
& % coordinate weights
&weuc = @(XI,XJ,W)(sqrt(bsxfun(@minus,XI,XJ).^2 *
&Dwgt = pdist(X, @(Xi,Xj) weuc(Xi,Xj,Wgts));
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。您所在位置: &
&nbsp&&nbsp&nbsp&&nbsp
pdist函数傻瓜式操作.doc 11页
本文档一共被下载:
次 ,您可全文免费在线阅读后下载本文档。
下载提示
1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。
2.该文档所得收入(下载+内容+预览三)归上传者、原创者。
3.登录后可充值,立即自动返金币,充值渠道很便利
你可能关注的文档:
··········
··········
1直接复制在MATLAB中运行
% pdist 函数
yangben = load('ca.txt');
t = size(yangben);
%求矩阵行,列数
t1 = t(1);
t2 = t(2);
ca =yangben(:,2:t2-1);
%这里是调用100*9的实验数据(即去除第一列和最后一列)
Y=pdist(X,'euclidean')
2.数据,请复制保存为ca.txt.
第一列是编号,最后一列是结果。聚类结束后,请注意转换结果
,1,1,1,2,1,3,1,1,2
,4,4,5,7,10,3,2,1,2
,1,1,1,2,2,3,1,1,2
,8,8,1,3,4,3,7,1,2
,1,1,3,2,1,3,1,1,2
,10,10,8,7,10,9,7,1,4
,1,1,1,2,10,3,1,1,2
,1,2,1,2,1,3,1,1,2
,1,1,1,2,1,1,1,5,2
,2,1,1,2,1,2,1,1,2
,1,1,1,1,1,3,1,1,2
,1,1,1,2,1,2,1,1,2
,3,3,3,2,3,4,4,1,4
,1,1,1,2,3,3,1,1,2
,7,5,10,7,9,5,5,4,4
,4,6,4,6,1,4,3,1,4
,1,1,1,2,1,2,1,1,2
,1,1,1,2,1,3,1,1,2
,7,7,6,4,10,4,1,2,4
,1,1,1,2,1,3,1,1,2
,3,2,10,5,10,5,4,4,4
,5,5,3,6,7,7,10,1,4
,1,1,1,2,1,2,1,1,2
,1,1,1,2,1,3,1,1,2
,2,3,4,2,7,3,6,1,4
,2,1,1,1,1,2,1,1,2
,1,1,1,2,1,2,1,1,2
,1,1,1,2,1,2,1,1,2
,1,3,1,2,1,1,1,1,2
,1,1,1,1,1,2,1,1,2
,1,1,1,2,1,3,1,1,2
,7,7,3,8,5,7,4,3,4
,1,1,2,2,1,3,1,1,2
,1,2,1,2,1,2,1,1,2
,1,1,1,2,1,2,1,1,2
,10,10,8,6,1,8,9,1,4
,2,1,1,1,1,7,1,1,2
,4,4,9,2,10,5,6,1,4
,5,3,3,6,7,7,5,1,4
,4,3,1,3,3,6,5,2,4
,10,10,2,8,10,7,3,3,4
,6,5,6,10,1,3,1,1,4
,10,10,4,8,1,8,10,1,4
,1,1,1,2,1,2,1,2,2
,7,7,4,4,9,4,8,1,4
,1,1,1,2,1,2,1,1,2
,1,1,3,2,1,3,1,1,2
,8,7,2,4,8,3,8,2,4
,5,8,1,2,3,2,1,5,4
,3,3,4,2,4,3,4,1,4
,3,6,2,3,5,4,10,2,4
,5,5,8,10,8,7,3,7,4
,5,5,6,8,8,7,1,1,4
,6,6,3,4,5,3,6,1,4
,10,10,1,3,6,3,9,1,4
,2,4,1,5,1,5,4,4,4
,2,3,1,6,10,5,1,1,4
,5,5,2,2,2,5,1,1,4
,3,5,5,3,3,4,10,1,4
,1,1,1,2,2,2,1,1,2
正在加载中,请稍后...
608页340页389页456页292页390页295页312页318页349页Matlab中pdist 函数详解(各种距离的生成)
编辑:www.fx114.net
本篇文章主要介绍了"Matlab中pdist 函数详解(各种距离的生成)",主要涉及到Matlab中pdist 函数详解(各种距离的生成)方面的内容,对于Matlab中pdist 函数详解(各种距离的生成)感兴趣的同学可以参考一下。
Pairwise distance between pairs of objects
D = pdist(X)
D = pdist(X,distance)
Description
D = pdist(X)
计算 X 中各对行向量的相互距离(X是一个m-by-n的矩阵). 这里 D 要特别注意,D 是一个长为m(m–1)/2的行向量.可以这样理解 D 的生成:首先生成一个 X 的距离方阵,由于该方阵是对称的,且对角线上的元素为0,所以取此方阵的下三角元素,按照Matlab中矩阵的按列存储原则,此下三角各元素的索引排列即为(2,1),
(3,1), ..., (m,1), (3,2), ..., (m,2), ..., (m,m–1).可以用命令 squareform(D) 将此行向量转换为原距离方阵.(squareform函数是专门干这事的,其逆变换是也是squareform。)
D = pdist(X,distance) 使用指定的距离.distance可以取下面圆括号中的值,用红色标出!
Given an m-by-n data matrix X, which is treated as m (1-by-n) row vectors x1, x2, ..., xm, the various distances between the
vector xs and xt are defined as follows:
欧几里德距离Euclidean distance('euclidean')
d 2 s,t =(x s x t )(x s x t ) ′ &
Notice that the Euclidean distance is a special case of the Minkowski metric, where p = 2.
欧氏距离虽然很有用,但也有明显的缺点。
一:它将样品的不同属性(即各指标或各变量)之间的差别等同看待,这一点有时不能满足实际要求。
二:它没有考虑各变量的数量级(量纲),容易犯大数吃小数的毛病。所以,可以先对原始数据进行规范化处理再进行距离计算。
标准欧几里德距离Standardized Euclidean distance('seuclidean')
d 2 s,t =(x s x t )V 1 (x s x t ) ′ &
where V is the n-by-n diagonal matrix whose jth diagonal element is S(j)2, where S is the vector of standard deviations.
相比单纯的欧氏距离,标准欧氏距离能够有效的解决上述缺点。注意,这里的V在许多Matlab函数中是可以自己设定的,不一定非得取标准差,可以依据各变量的重要程度设置不同的值,如knnsearch函数中的Scale属性。
马哈拉诺比斯距离Mahalanobis distance('mahalanobis')
d 2 s,t =(x s x t )C 1 (x s x t ) ′ &
where C is the covariance matrix.
马氏距离是由印度统计学家马哈拉诺比斯(P. C. Mahalanobis)提出的,表示数据的协方差距离。它是一种有效的计算两个未知样本集的相似度的方法。与欧式距离不同的是它考虑到各种特性之间的联系(例如:一条关于身高的信息会带来一条关于体重的信息,因为两者是有关联的)并且是尺度无关的(scale-invariant),即独立于测量尺度。
如果协方差矩阵为单位矩阵,那么马氏距离就简化为欧式距离,如果协方差矩阵为对角阵,则其也可称为正规化的欧氏距离.
马氏优缺点:
  1)马氏距离的计算是建立在总体样本的基础上的,因为C是由总样本计算而来,所以马氏距离的计算是不稳定的;
  2)在计算马氏距离过程中,要求总体样本数大于样本的维数。
  3)协方差矩阵的逆矩阵可能不存在。&
曼哈顿距离(城市区块距离)City block metric('cityblock')
d s,t =∑ j=1 n ∣ ∣ x s j &x t j &∣ ∣ &
Notice that the city block distance is a special case of the Minkowski metric, where p=1.
闵可夫斯基距离Minkowski metric('minkowski')
d s,t =∑ j=1 n ∣ ∣ x s j &x t j &∣ ∣ &p & &p &
Notice that for the special case of p = 1, the Minkowski metric gives the city block metric, for the special case of p = 2,
the Minkowski metric gives the Euclidean distance, and for the special case of p = ∞, the Minkowski metric gives the Chebychev distance.
闵可夫斯基距离由于是欧氏距离的推广,所以其缺点与欧氏距离大致相同。
切比雪夫距离Chebychev distance('chebychev')
d s,t =max j ∣ ∣ x s j &x t j &∣ ∣ &
Notice that the Chebychev distance is a special case of the Minkowski metric, where p = ∞.
夹角余弦距离Cosine distance('cosine')
d s,t =1x s x t &′ &∥x s ∥ 2 ∥x t ∥ 2 & &
与Jaccard距离相比,Cosine距离不仅忽略0-0匹配,而且能够处理非二元向量,即考虑到变量值的大小。
相关距离Correlation distance('correlation')
d s,t =1x s x t &′ &(x s x s &ˉ ˉ ˉ &)(x s x s &ˉ ˉ ˉ &) ′ & √ (x t x t &ˉ ˉ ˉ &)(x t x t &ˉ ˉ ˉ &) ′ & √ & &
Correlation距离主要用来度量两个向量的线性相关程度。
汉明距离Hamming distance('hamming')
d s,t =(#(x s j &≠x t j &) n &)&
两个向量之间的汉明距离的定义为两个向量不同的变量个数所占变量总数的百分比。
杰卡德距离Jaccard distance('jaccard')
d s,t =#[(x s j &≠x t j &)∩((x s j &≠0)∪(x t j &≠0))] #[(x s j &≠0)∪(x t j &≠0)] &&
Jaccard距离常用来处理仅包含非对称的二元(0-1)属性的对象。很显然,Jaccard距离不关心0-0匹配,而Hamming距离关心0-0匹配。
Spearman distance('spearman')
d s,t =1(r s r s &ˉ ˉ ˉ &)(r t r t &ˉ ˉ ˉ &) ′ &(r s r s &ˉ ˉ ˉ &)(r s r s &ˉ ˉ ˉ &) ′ & √ (r t r t &ˉ ˉ ˉ &)(r t r t &ˉ ˉ
ˉ &) ′ & √ & &
rsj is the rank of xsj taken over x1j, x2j, ...xmj, as computed by tiedrank
rs and rt are the coordinate-wise rank vectors of xs and xt, i.e., rs = (rs1, rs2, ... rsn)
r s &ˉ ˉ ˉ &=1 n &∑ j r s j &=n+1 2 &&
r t &ˉ ˉ ˉ &=1 n &∑ j r t j &=n+1 2 &&
二、pdist2
Pairwise distance between two sets of observations
D = pdist2(X,Y)
D = pdist2(X,Y,distance)
D = pdist2(X,Y,'minkowski',P)
D = pdist2(X,Y,'mahalanobis',C)
D = pdist2(X,Y,distance,'Smallest',K)
D = pdist2(X,Y,distance,'Largest',K)
[D,I] = pdist2(X,Y,distance,'Smallest',K)
[D,I] = pdist2(X,Y,distance,'Largest',K)
Description
这里 X 是 mx-by-n 维矩阵,Y 是 my-by-n 维矩阵,生成 mx-by-my 维距离矩阵 D。
[D,I] = pdist2(X,Y,distance,'Smallest',K)
生成 K-by-my 维矩阵 D 和同维矩阵 I,其中D的每列是原距离矩阵中最小的元素,按从小到大排列,I 中对应的列即为其索引号。注意,这里每列各自独立地取 K 个最小值。
例如,令原mx-by-my 维距离矩阵为A,则 K-by-my 维矩阵 D 满足 D(:,j)=A(I(:,j),j).
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!
二、互相尊重,对自己的言论和行为负责。
本文标题:
本页链接:当前位置: >>
马氏距离计算函数定义
1.样本与某一总体之间马氏距离的计算: ? 函数名称:MahalanobisCompute(Group,Vector) ? 用途:此函数用来计算 n 维空间中的某一个样本点 Vector(一个向量) ,与该空间 中的某一总体分布 Group(一组向量)之间的距离,总体的样本容量为 m(即有 m 个向量) 。 ? 输入: 1) Group:代表 n 维空间中的某一总体的样本空间,其维数为 n,样本数为 m, 实际上就是一个 m 行 n 列的矩阵; 2) Vector:代表 n 维空间中的某一个样本点,也就是一个 n 维向量; ? 输出:DisMaha,表示样本 Vector 与总体 Group 之间的马氏距离。 ? 计算公式: DisMaha ?( Vector? ? )T C?1 ( Vector? ? ) ,其中 ? 是总体 Group的均值向量, 维数为 n, 其各分量计算公式为: ?j ?1 m 其中 j ? 1,..., n ; ? Groupij , m i ?1C 是总体 Group 的协方差矩阵,其计算公式为: C ? Cov(Group) 。说明:在计算过程中,需要首先求 C,并判断是否有 C ? 0 ;如果有,说明协方差 矩阵不存在,不能够求马氏距离;如果 C 等于 0,则可以求出马氏距离。 计算某一总体(样本空间)的均值向量 ? 函数名称:AverageCompute(Group) ? 用途: 此函数用来计算 n 维空间中的某一总体分布 Group (一组向量) 的均值向量。 ? 输入:Group:代表 n 维空间中的某一总体的样本空间,其维数为 n,样本数为 m, 实际上就是一个 m 行 n 列的矩阵; ? 输出:E,表示总体 Group 的均值向量,是一个 n 维向量。 ? 2. ? ? 计算公式: E j ? 说明:无。1 m ? Groupij ,其中 j ? 1,..., n ; m i ?1
向量运算的形式: (4)Matlab 计算欧氏距离 Matlab 计算距离主要使用 pdist 函数...马氏距离(MahalanobisDistance) (1)马氏距离定义 有 M 个样本向量 X1~Xm,协...利用马氏距离的定义及两总体协差阵相 等的假设,可以简化马氏距离的计算公式:. ...显然,判别方法的最终结果是得到 Rm 中的一 个划 分.由判别函数 W(X)得到...满足以上条件的函数有多种,本节将要 用到的马氏...数据与 均值之差) 计算出的二点之间的马氏距离相同...概念: 马氏距离是由印度统计学家马哈拉诺比斯提出的...亦称马氏距 离。样品点 X i 与总体 X 间的马氏距离则定义为 X i 与 E ..., a p 代入上式求得对应的判别函数 Y 值并与临界值 Yc 作 (6.3.2) ...计算距离的pdist函数_数学_自然科学_专业资料。pdist 函数调用格式:Y=pdist(X,...‘mahalanobis’:马氏距离; ‘cityblock’:布洛克距离; ‘minkowski’:明可夫斯基...马氏距离表示数据的协方差距离。 为两个服从同一...可以使用很简单的公式来计算判别函数和进行显著性检验...总惯量不仅反映了行剖面集定义的各点与其重心加权...) i =1 k 其中 f j (X ) 由(7.3)定义。...1018 判为第3类的函数为 l 3 ( X ) = 40....计算他与第j类的马氏距离 d j ( X ) ,再计算...写出几种距离公式,两总体距离判别准则; (1)马氏距离的定义总体 G ,均值向量 ...信息 111 姓名: 张富生 (2)利用距离判别建立判别函数,判定广东、西藏分别属于哪个...和 ,并按距离最近准则判别归类,判别准则为 利用马氏距离的定义及 2 个总体协方差矩阵相等的假设,简化 马氏距离的计算公式如下: 式中: 为样本 X 的线性函数。 ...一般而言,定义一个距离函数 d(x,y), 需要满足下 面几个准则: 1) d(x,x...2. 马氏距离考虑下面这张图,椭圆表示等高线,从欧几里得的距离来算,绿黑距离大于...
All rights reserved Powered by
www.tceic.com
copyright &copyright 。文档资料库内容来自网络,如有侵犯请联系客服。}

我要回帖

更多关于 python 自定义函数 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信