Coverage is the property a confidence construction claims and the one thing a simulation can check directly. Under-coverage is the failure that matters, so the test is one-sided: the number of covering replications is binomial with the nominal success probability and the reported p-value is its exact lower tail. A two-sided test would flag conservative procedures, which are not wrong in the same way.
Value
List with coverage, nominal, n_covered,
R, p_value, reject, mean_width.
R, p_value, reject, mean_width.
Details
Formula: coverage = mean(lower <= theta <= upper) and
p = P(Bin(R, 1 - alpha) <= n_covered).
References
The coverage requirements distinguished here are equations (4.11) to (4.14) of Molinari, F. (2021), Handbook of Econometrics 7A (arXiv:2004.11751 pp. 97-100). See also Andrews, D. W. K. and Soares, G. (2010), Econometrica 78(1), 119-157, doi:10.3982/ECTA7502 .
Examples
Bndcvr(lower = c(1, 2, 3, 4, 5, 6, 7, 8), upper = c(1, 2, 3, 4, 5, 6, 7, 8),
theta_true = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $coverage
#> [1] 0.125
#>
#> $nominal
#> [1] 0.95
#>
#> $n_covered
#> [1] 1
#>
#> $R
#> [1] 8
#>
#> $p_value
#> [1] 5.976563e-09
#>
#> $reject
#> [1] 1
#>
#> $mean_width
#> [1] 0
#>
#> $method
#> [1] "Coverage probability check"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
