matlab计算马氏平方距离

时间:2021-08-31
本文章向大家介绍matlab计算马氏平方距离,主要包括matlab计算马氏平方距离使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

马氏距离计算一个点到一个参考分布的距离。马氏距离的优点是不受各个维度特征尺度的影响(尺度无关)。

d2 = mahal(Y, X)

d2 = mahal(Y,X) returns the squared Mahalanobis distance of each observation in Y to the reference samples in X.

返回Y中每个点相对于参考分布X的马氏平方距离。即Y_i与分布p(mu, cov)的距离,这里mu, cov通过X进行估计。

The Mahalanobis distance is a measure between a sample point and a distribution.

The Mahalanobis distance from a vector y to a distribution with mean μ and covariance Σ is

This distance represents how far y is from the mean in number of standard deviations.

mahal returns the squared Mahalanobis distance d2 from an observation in Y to the reference samples in X. In the mahal function, μ and Σ are the sample mean and covariance of the reference samples, respectively.

因此,计算一个向量中各点(或向量)到自身分布的马氏平方距离表示为:

d2 = mahal(X, X)

快去成为你想要的样子!

原文地址:https://www.cnblogs.com/jiangkejie/p/15209045.html