binomTestMSE | R Documentation |

Generates lower and upper confidence interval limits for a binomial proportion that minimizes the root mean square error (RMSE) of the actual coverage function.

```
binomTestMSE(n, x,
alpha = 0.05,
smooth = 1,
showRMSE = TRUE,
showAll = FALSE)
```

`n` |
sample size |

`x` |
number of successes |

`alpha` |
significance level for confidence interval |

`smooth` |
smoothness index |

`showRMSE` |
a logical variable indicating whether to show the value of RSME |

`showAll` |
a logical variable indicating whether to show confidence intervals of all possible number of successes |

Generates lower and upper confidence interval limits for a binomial proportion for

various sample sizes,

various numbers of successes.

When the `binomTestMSE`

function is called, it returns a two-element vector in which

the first element is the lower bound of the RMSE-minimizing confidence interval, and

the second element is the upper bound of the RMSE-minimizing confidence interval.

An RMSE-minimizing two-sided 100 * (1 - alpha) percent confidence interval
for p is constructed from a random sample of size n from a Bernoulli(p)
population. The parameter `x`

gives the number of successes in the n
mutually independent Bernoulli trials. For n <= 15, all possible jumps
between acceptance curves associated with the actual coverage function are
enumerated based on their one-to-one relationship with the symmetric Dyck
paths. For each sequence of jumps between acceptance curves, the confidence
interval bounds that are returned are associated with discontinuities in the
actual coverage function that together result in the lowest possible RMSE. A
set of smoothness constraints that build on four existing non-conservative
confidence intervals (Wilson-score, Jeffreys, Arcsine, and Agresti-Coull) is
used if the smoothness index `smooth`

is set to one. These constraints
ensure that the RMSE-confidence interval achieves smoothness, a preferable
property of the binomial confidence interval that is related to lower bound
differences for adjacent values of `x`

. There is a trade-off between
the RMSE and the smoothness. For n > 100, smoothness is required. The RMSE
usually increases if the smoothness constraints are used. For n > 15, only
the symmetric Dyck paths associated with the Wilsonâ€“score, Jeffreys, Arcsine,
and Agrestiâ€“Coull confidence interval procedures are used instead of
enumerating because the computation time increases in a factorial fashion in
n. The minimal RMSE is not guaranteed for n > 15 because another symmetric
Dyck path other than those associated with the four existing confidence
interval procedures might prove to be optimal. However, this procedure does
ensure a lower RMSE than any of the four existing confidence intervals for
all n.

Kexin Feng (kfeng@caltech.edu), Larry Leemis (leemis@math.wm.edu), Heather Sasinowska (hdsasinowska@wm.edu)

Feng, K., Sasinowska, H., Leemis, L. (2022), "RMSE-Minimizing Confidence Interval for the Binomial Parameter", Computational Statistics, 37 (4), 2022, 1855-1885.

```
binomTestMSE(10, 3)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.