Closed mariamasotti1 closed 1 year ago
also why do we filter out zeros again? I think we discussed it but I forgot
KLD (and thus JSDiv/JSD) isn't defined when you include elements of the domains where the probabilities are 0:
https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence#Definition
P(x)/Q(x) is undefined at x when Q(x) = 0, and log(P(x)/Q(x)) is undefined when P(x) = 0
but wouldnt JSD still be defined? because you are using P(x)/M(X) and Q(x)/M(x) where M=.5(P+Q) and not P(x)/Q(x)
I think still no, since wherever P(x) = 0 or Q(x) = 0, log(P(x) / M(x)) and log(Q(x) / M(x)) are still undefined
Should I close this issue?
apparently there are specific axioms associated with being called a distance metric and they are satisfied by implementing the following:
replace current version of jsd with sqrt(jsd)
ref: https://en.wikipedia.org/wiki/Jensen%E2%80%93Shannon_divergence