@@ -805,10 +805,10 @@ To compute a two-way two-locus statistic, the `index` argument must be
805805provided. The statistics are selected in the same way (with the ` stat `
806806argument), but we provide a restricted set of two-way statistics (see
807807{ref}` sec_stats_two_locus_summary_functions_two_way ` ). The dimension-dropping
808- rules for the result follow the rest of the tskit stats API in that scalar
809- indexes will produce a single two-dimensional matrix, while list of indexes
808+ rules for the result follow the rest of the tskit stats API in that a single list
809+ or tuple will produce a single two-dimensional matrix, while list of these
810810will produce a three-dimensional array, with the outer dimension of length
811- equal to the length of the list of indexes .
811+ equal to the length of the list.
812812
813813For concreteness, we would expect the following dimensions with the specified
814814` sample_sets ` and ` indexes ` arguments.
@@ -869,47 +869,46 @@ input. Each of our summary functions has the signature
869869 allele labelings, is zero. Uses the ` total ` normalisation method.
870870
871871` D_prime `
872- : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D}{D_{\max}} `
872+ : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D}{D_{\max}} ` ,
873873
874- Where {math}```
875- D_ {\max} = \begin{cases}
874+ where {math}
876875 \min\{ p_A (1-p_B), p_B (1-p_B)\} & \textrm{if }D>=0 \\
877876 \min\{ p_A p_B, (1-p_B) (1-p_B)\} & \textrm{otherwise}
878877 \end{cases}```
879878
880- and {math}` D ` is defined above.
879+ and {math}` D ` is defined above. Polarised, ` total ` weighted.
881880
882881` D2 `
883882: {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = (p_{ab} - p_{a} p_{b})^2 `
884883
885- Unpolarised, total weighted.
884+ Unpolarised, ` total ` weighted.
886885
887886` Dz `
888- : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = D (1 - 2 p_{a})(1 - 2p_{b}) `
887+ : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = D (1 - 2 p_{a})(1 - 2p_{b}) ` ,
889888
890- Where {math}` D ` is defined above. Unpolarised, total weighted.
889+ where {math}` D ` is defined above. Unpolarised, ` total ` weighted.
891890
892891` pi2 `
893892: {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = p_{a}p_{b}(1-p_{a})(1-p_{b}) `
894893
895- Unpolarised, total weighted.
894+ Unpolarised, ` total ` weighted.
896895
897896` r `
898- : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D}{\sqrt{p_{a}p_{b}(1-p_{a})(1-p_{b})}} `
897+ : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D}{\sqrt{p_{a}p_{b}(1-p_{a})(1-p_{b})}} ` ,
899898
900- Where {math}` D ` is defined above. Polarised, total weighted.
899+ where {math}` D ` is defined above. Polarised, ` total ` weighted.
901900
902901` r2 `
903- : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D^{2}}{p_{a}p_{b}(1-p_{a})(1-p_{b})} `
902+ : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{D^{2}}{p_{a}p_{b}(1-p_{a})(1-p_{b})} ` ,
904903
905- Where {math}` D ` is defined above. Unpolarised, haplotype weighted.
904+ where {math}` D ` is defined above. Unpolarised, ` haplotype ` weighted.
906905
907906Unbiased two-locus statistics from the Hill-Robertson (1968) system are
908- computed from haplotype counts. Derivations for these unbiased estimators can
907+ computed from haplotype counts. Definitions of these unbiased estimators can
909908be found in [ Ragsdale and Gravel
910909(2020)] ( https://doi.org/10.1093/molbev/msz265 ) . They require at least 4 samples
911- to be valid and are specified as ` stat=D2_unbiased ` , ` Dz_unbiased ` , or
912- ` pi2_unbiased ` .
910+ to be valid and are specified as ` stat=" D2_unbiased" ` , ` " Dz_unbiased" ` , or
911+ ` " pi2_unbiased" ` .
913912
914913(sec_two_locus_summary_functions_two_way)=
915914
@@ -921,9 +920,9 @@ Two-way statistics are indexed by sample sets {math}`i, j` and compute values
921920using haplotype counts within pairs of sample sets.
922921
923922` D2 `
924- : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = D_i * D_j `
923+ : {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = D_i * D_j ` ,
925924
926- Where {math}` D ` is defined above.
925+ where {math}` D ` is defined above.
927926
928927` r2 `
929928: {math}` f(w_{Ab}, w_{aB}, w_{AB}, n) = \frac{(p_{AB_i} - (p_{A_i} p_{B_i})) (p_{AB_j} - (p_{A_j} p_{B_j}))}{\sqrt{p_{A_i} (1 - p_{A_i}) p_{B_i} (1 - p_{B_i})}\sqrt{p_{A_j} (1 - p_{A_j}) p_{B_j} (1 - p_{B_j})}} `
0 commit comments