Hello everyone,
I’ve recently started using squidpy to analyze my spatial data, and I have a question about the co-occurrence metric. According to the documentation, the co-occurrence is computed as
P(A | B) / P(A), where A and B are the cell types of interest. Based on this definition, my understanding is that the metric should be symmetric; that is, co_occurrence(A, B) should equal co_occurrence(B, A).
However, when I compute these values on my dataset, the two results differ slightly, typically starting around the fifth decimal place. My question is: Is this small difference expected due to numerical approximations in the calculation, or is my assumption incorrect and the metric is not actually symmetric in practice?
Thanks in advance for any clarification.