Skip to contents

Theorem 3.2.1 / Corollary / Theorem 3.2.2: joint, marginal and total-runs pmfs under randomness. Mirrors morie.fn.gb321/gb321c/ gb322.

Usage

morie_runs_pmf(n1, n2, r1 = NULL, r2 = NULL, r = NULL)

Arguments

n1, n2

counts of the two element types.

r1, r2

run counts for the joint pmf (optional).

r

total runs for the total pmf (optional).

Value

list: joint (if r1, r2 given), marginal_r1 (vector over r1 = 1..n1), total (vector over r = 2..n1+n2), mean, var.

References

Gibbons & Chakraborti (2021), Nonparametric Statistical Inference, 5th ed., Theorems 3.2.1-3.2.2, eqs. (3.2.6), (3.2.8).

Examples

morie_runs_pmf(4, 5)$mean
#> [1] 5.444444