quinngroup / ornet

Organellar segmentation, tracking, and network modeling.
MIT License
3 stars 4 forks source link

Sanity-checking our Hellinger Distance Implementation #35

Closed Marcdh3 closed 2 years ago

Marcdh3 commented 2 years ago

I have been comparing our implementation of the Hellinger distance for two multivariate normal distributions with the equation defined on Wikipedia, and I am left with two questions:

  1. Is the gamma parameter utilized in our multivariate_hellinger function supposed to be 0.125 (or 1/8) instead of 0.00125? https://github.com/quinngroup/ornet/blob/e604527847574b23cb94caafe33b4766ef003390/src/measure.py#L59
  2. Are we returning 1 minus the actual distance value?https://github.com/quinngroup/ornet/blob/e604527847574b23cb94caafe33b4766ef003390/src/measure.py#L81-L86
magsol commented 2 years ago
  1. That does indeed seem like a bug. But from what I can tell, it was your Nov 2019 commit that introduced this code--so my question would be, what reference were you using?

  2. 1-dist becomes a similarity metric, so my guess is we're using the metric down the road for spectral analysis of an affinity matrix. But it would be good to double-check this is actually happening.

Marcdh3 commented 2 years ago
  1. If I am remembering everything correctly, I referred to a code snippet that Mojtaba had written around that time and directed me to since I was still unfamiliar with the metric. I'm glad someone else was able to look over it to make sure I wasn't missing anything (again).
  2. Ok perfect. This lines up with how we have been utilizing it, but I had noticed that a lot of documentation still referred to the metric as the distance, rather than the similarity metric, except in the affinityfunc.py file.
magsol commented 2 years ago
  1. Right--I forgot this code was actually from a different repository, so git blame can't follow that history.