nateosher / DIMPLE

MIT License
2 stars 1 forks source link

the JSD we are using is divergence not distance #65

Closed mariamasotti1 closed 1 year ago

mariamasotti1 commented 1 year ago

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

mariamasotti1 commented 1 year ago

also why do we filter out zeros again? I think we discussed it but I forgot

nateosher commented 1 year ago

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

mariamasotti1 commented 1 year ago

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)

nateosher commented 1 year ago

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

nateosher commented 1 year ago

Should I close this issue?