Counts how many edges are among the k highest-scoring edges of
both score1 and score2, e.g. two methods' differential
scores. Ties are handled without depending on the order of the edges:
when the k-th place falls inside a block of tied scores, each edge of
that block is in the top k with probability (places left) / (block
size), and the result is the expected overlap under random
tie-breaking, \(\sum_e P(e \in A_k) P(e \in B_k)\). Without ties at the
boundary this is the ordinary overlap.
Value
A numeric vector of the same length as k with the
(expected) overlap. Values of k larger than the number of edges
are truncated.
Details
Sorting with order() and taking the first k breaks ties by
position. For sparse estimators, which tie most edges at 0, that inflates
the overlap of two methods once k exceeds their number of non-zero
edges, because both take the same low-index edges first.