Skip to content

Commit 2b70dd3

Browse files
Apply suggestions from code review
Co-authored-by: Peter Ralph <petrel.harp@gmail.com>
1 parent 2e07676 commit 2b70dd3

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

docs/stats.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ by [Zhao (2007)](https://doi.org/10.1017/S0016672307008634).
751751

752752
Briefly, consider a pair of sites with {math}`n` alleles at the first locus and
753753
{math}`m` alleles at the second. (Whether this includes the ancestral allele
754-
depends on whether the statistic is polarised.) Write {math}`f_{i,j}` as the
754+
depends on whether the statistic is polarised.) Write {math}`f_{ij}` as the
755755
statistic computed for focal alleles {math}`A_i` and {math}`B_j`. Then the
756756
weighting schemes are defined as:
757757

@@ -838,6 +838,8 @@ prod_branch_lengths = np.outer(total_branch_lengths, total_branch_lengths)
838838
print(ld / prod_branch_lengths[0:4, 0:4])
839839
```
840840

841+
To compute the average {math}`r^2` for a uniformly chosen pair of mutations, we also
842+
weight by tree span:
841843
As with the `"site"` mode above, we can specify the row and column trees
842844
separately.
843845

@@ -933,7 +935,19 @@ One-way statistics are summaries of two loci in a single sample set, using
933935
a triple of haplotype counts {math}`\{n_{AB}, n_{Ab}, n_{aB}\}` and the size of
934936
the sample set {math}`n`, where the capitalized and lowercase letters in our
935937
notation represent alternate alleles.
936-
938+
::::{warning}
939+
This means there are two common situations in which many or all LD values will be nan.
940+
These are:
941+
942+
1. A branch-mode ratio statistic computed on less than the full set of samples
943+
will always be nan, since part of the trees are ancestral to none of the samples.
944+
2. A site-mode ratio statistic will be nan at any sites at which there are alleles found
945+
in the entire set of samples that are not seen in the provided sample set.
946+
947+
This behavior **may change in the future**,
948+
because possibly more natural behavior not currently implemented
949+
would be to ignore the branches/alleles not ancestral
950+
to any of the provided samples.
937951
(sec_stats_two_locus_sample_two_way_stats)=
938952

939953
#### Two-way Statistics

0 commit comments

Comments
 (0)