Skip to contents

Under independent inclusion with probabilities pi, the Horvitz-Thompson total has mean \(\sum t_i\) (Research.P3.Basu.ht_mean) and variance \(\sum t_i^2(1-\pi_i)/\pi_i\) (ht_variance). One unit with value \(t_e\) and inclusion probability \(\pi_e = t_e^2/(2(B + t_e^2))\) contributes more than any bound \(B\) (elephant_unbounded); the other units' contribution is bounded without reference to \(\pi_e\) (ratio_bounded).

Usage

morie_ht_elephant(t, pi, bound = NULL)

Arguments

t

Unit values.

pi

Inclusion probabilities in (0, 1].

bound

Optional variance bound \(B\); the inclusion probability at which the largest unit alone exceeds it is returned.

Value

A list: mean, variance, terms (per unit) and, with bound, elephant (its index), pi_elephant and term_elephant.

References

Lohr SL (2019). Sampling: Design and Analysis, 2nd ed., section 6.7. CRC.

Examples

morie_ht_elephant(t = c(1, 2, 3, 100), pi = c(0.5, 0.5, 0.5, 0.01), bound = 1e4)
#> $mean
#> [1] 106
#> 
#> $variance
#> [1] 990014
#> 
#> $terms
#> [1]      1      4      9 990000
#> 
#> $elephant
#> [1] 4
#> 
#> $pi_elephant
#> [1] 0.25
#> 
#> $term_elephant
#> [1] 30000
#> 
#> attr(,"theorem")
#> [1] "Research.P3.Basu.ht_variance"