scatter(X(:,1),X(:,2),10,'.')% Scatter plot with points of size 10holdonscatter(Y(:,1),Y(:,2),100,d2_mahal,'o','filled') hb = colorbar;ylabel(hb,'Mahalanobis Distance') legend('X','Y','Location','best')
Y内のすべての観測値 ([1,1]、[-1,-1,]、[1,-1]および[1]) は、Xの平均からユークリッド距離で等距離にあります。しかし、マハラノビス距離では、[1,1]と[-1,-1]は[1,-1]と[1]よりはるかに X に近くなります。データの共分散および異なる変数のスケールが考慮されるので、マハラノビス距離は外れ値の検出に役立ちます。
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.