Что будет входом в расхождение KL, учитывая два списка, содержащие значения расстояний из двух разных источников - PullRequest
0 голосов
/ 13 июля 2020

У меня есть два списка расстояний из двух разных источников. Я построил эти списки, используя частотную гистограмму в python. Чтобы вы знали, я делаю весь код в python.

distance vs frequency

But now I need to compare the two plots to measure how much they differ. Can you please suggest what is the probable solution to achieve this? My main concern is what would be the input of the KL Divergence in this case. I am completely new to KL Divergence topic. By searching on the internet, I found that I can use scipy.special rel_entr(a, b). But how would I generate a and b?

Two solutions (I am not even sure whether these logics are correct) came to my mind for expressing the list as a list of probabilities-

  1. Can I convert the frequency histogram to a probability histogram so that the frequencies are between 0-1 (as KL divergence works for values 0-1 only)? Will this be a probability distribution then? If yes, then I will get lists containing the frequencies (values between 0-1) and will pass those two lists as the input of rel_entr().

In that case, for any interval, the value can be 0 which will result in infinity according to the formula of KL divergence. That is another issue I don't know how to handle. If ignoring the 0's is a solution, then I don't understand how that makes sense.

  1. Мне нужно express каждый список непосредственно в любое распределение вероятностей, за которым следуют данные, вместо это частотное распределение и ручное приведение их к 0-1. Но я не знаю, как понять, какому распределению вероятностей соответствуют мои данные.

Правильно ли какое-либо решение? Или есть способы лучше? Я меньше понимаю распределения вероятностей в статистике. Думаю, именно поэтому я не могу asp понять все источники.

...