This function calculates the overlap between observed and permuted data for two sets of comparisons. It computes the ratio of overlap between pairs of vectors (res1/res2 and pres1/pres2) after sorting the values.
Arguments
- D
Numeric vector. Observed data values (e.g., differences).
- S
Numeric vector. Standard errors or related values associated with the observed data.
- pD
Numeric vector. Permuted data values (e.g., differences).
- pS
Numeric vector. Standard errors or related values associated with the permuted data.
- nrow
Integer. Number of rows in each block of data.
- N
Integer vector. Number of top values to consider for overlap calculation.
- N_len
Integer. Length of the
N
vector.- ssq
Numeric. A small constant added to standard errors for stability.
- B
Integer. Number of bootstrap samples or resampling iterations.
- overlaps
Numeric matrix. Matrix to store overlap results for observed data.
- overlaps_P
Numeric matrix. Matrix to store overlap results for permuted data.