MCPcopy Create free account
hub / github.com/adobe/react-spectrum / signedRankCdf

Function signedRankCdf

perf/report.mjs:137–149  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

135// Exact null distribution of the Wilcoxon signed-rank statistic for n pairs:
136// cdf[k] is the probability that the positive-rank sum is at most k.
137function signedRankCdf(n) {
138 let counts = [1];
139 for (let rank = 1; rank <= n; rank++) {
140 let next = Array(counts.length + rank).fill(0);
141 counts.forEach((count, sum) => {
142 next[sum] += count;
143 next[sum + rank] += count;
144 });
145 counts = next;
146 }
147 let cumulative = 0;
148 return counts.map(count => (cumulative += count) / 2 ** n);
149}
150
151// Hodges–Lehmann estimate and distribution-free confidence interval for a paired
152// shift, from the sorted Walsh averages of the per-block changes. The interval uses

Callers 1

signedRankIntervalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected