How to calculate the distance of Mahalanobis between two time series of equal sizes?

I am collecting data from time series data. I need to calculate the distance or similarity between two rows of equal sizes. I was offered to use the Euclidean distance, similarity or the distance of the Mahalanobi. The first two did not provide any useful information. I don’t seem to understand the various textbooks on the Internet.

So,

For two vectors A (a1, a2, a3, ..., an) and B (b1, b2, b3, ..., bn), how do you find the distance of Mahalanobis between them?

(I got some advice on using these remote measures on https://stackoverflow.com/a/299602/ ... myself, and there is a question on how to calculate the Cos similarity, so please consider before closing this question)

+3
source share
1 answer

You must evaluate the covariance matrix.

Related Wikipedia articles this and this .

For multidimensional vectors (n observations of a p-dimensional variable), the formula for the Mahalanobis distance is

alt text

Where S is the inverse covariance matrix, which can be estimated as:

alt text

where alt textis the ith observation of a (p-dimensional) random variable and

alt text

Be careful that using the Mahalanobis distance between your vectors only makes sense if all of your expected vector values ​​match.

, , ( / ). , "" .

!

+7

Source: https://habr.com/ru/post/1751537/


All Articles