본문 바로가기

컴퓨터비전

마할라노비스 거리(Mahalanobis distance)

728x90

결과값에 분산이 반영된다.

따라서 다변량(Multi variables)의 데이터 분포와의 거리를 구할 때 유클리디언 거리보다 유용할 수 있다.

다변량이므로 공분산 행렬이 적용된다.

$$ D^2=(X-M)^{T}\cdot C^{-1}\cdot(X-M) $$

 

D: 마할라노비스 거리

X: 관측값

M: 데이터 분포의 평균

C: 데이터 분포 간의 공분산 행렬

 

공분산 행렬의 역행렬(precision matrix)이 사용되는데

전체 데이터 분포에 대해 조건적 독립(요소가 0일 때)적인

특징을 거리에 반영할 수 있기 때문이다.

 

https://stephens999.github.io/fiveMinuteStats/normal_markov_chain.html

 

Multivariate normal: the precision matrix

The command set.seed(12345) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

stephens999.github.io

 

'컴퓨터비전' 카테고리의 다른 글

핀홀 카메라 모델(pinhole camera model)  (0) 2022.01.15
Shortcut Layer  (0) 2021.11.28
IOU(Intersection Over Union)  (0) 2021.11.22
[Object Detection+Tracking] Yolov4+DeepSort Demo  (0) 2021.10.17
코사인 거리(Cosine distance)  (0) 2021.10.16