Title: | Uniformly Most Powerful Tests |
---|---|
Description: | Does uniformly most powerful (UMP) and uniformly most powerful unbiased (UMPU) tests. At present only distribution implemented is binomial distribution. Also does fuzzy tests and confidence intervals (following Geyer and Meeden, 2005, <doi:10.1214/088342305000000340>) for the binomial distribution (one-tailed procedures based on UMP test and two-tailed procedures based on UMPU test). |
Authors: | Charles J. Geyer <[email protected]> and Glen D. Meeden <[email protected]> |
Maintainer: | Charles J. Geyer <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.5-8 |
Built: | 2025-03-06 03:47:29 UTC |
Source: | https://github.com/cran/ump |
Calculate the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution.
arpv.binom(x, n, p, plot = TRUE, ...)
arpv.binom(x, n, p, plot = TRUE, ...)
x |
binomial observations. |
n |
number of observations. |
p |
the success probability under the null hypothesis. |
plot |
if |
... |
additional arguments passed to |
The first three arguments must be scalar. Evaluates the distribution function of the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution, which is a continuous, piecewise linear function. Gives the knots.
a list containing two components:
alpha |
significance level values at the knots. |
phi |
distribution function values at the knots. |
library(ump) print(arpv.binom(10, 10, 0.7, plot = FALSE)) arpv.binom(10, 10, 0.7) arpv.binom(10, 10, 0.7, df = FALSE)
library(ump) print(arpv.binom(10, 10, 0.7, plot = FALSE)) arpv.binom(10, 10, 0.7) arpv.binom(10, 10, 0.7, df = FALSE)
Plot ether the distribution function or the probability density function of an abstract randomized P-value
arpv.plot(alpha, phi, df = TRUE, verticals = TRUE)
arpv.plot(alpha, phi, df = TRUE, verticals = TRUE)
alpha |
significance levels at which the density is discontinuous ("knots"). |
phi |
values of the distribution function at these knots. |
df |
if |
verticals |
if |
none.
out <- arpv.binom(10, 10, 0.7) arpv.plot(out$alpha, out$phi) arpv.plot(out$alpha, out$phi, df = FALSE)
out <- arpv.binom(10, 10, 0.7) arpv.plot(out$alpha, out$phi) arpv.plot(out$alpha, out$phi, df = FALSE)
Calculate the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution.
fci.binom(x, n, alpha = 0.05, p = seq(0, 1, length = 10001), flat = 1 / 4)
fci.binom(x, n, alpha = 0.05, p = seq(0, 1, length = 10001), flat = 1 / 4)
x |
binomial observation. |
n |
number of observations. |
alpha |
the significance level, one minus the coverage probability. |
p |
the vector of parameter values at which (the membership function of) the fuzzy confidence interval is evaluated. |
flat |
the amount of flat parts of the membership function shown, expressed as a fraction of the curved parts. |
prints the core and support of the fuzzy confidence interval and makes one or two plots (as appropriate) showing the edges of the fuzzy interval.
none
library(ump) fci.binom(4, 10) fci.binom(0, 10) fci.binom(9, 10)
library(ump) fci.binom(4, 10) fci.binom(0, 10) fci.binom(9, 10)
Calculate the uniformly most powerful unbiased (UMPU) two-tailed test for the binomial distribution.
umpu.binom(x, n, p, alpha, maxiter = 10, tol = 1e-9)
umpu.binom(x, n, p, alpha, maxiter = 10, tol = 1e-9)
x |
binomial observations. |
n |
number of observations. |
p |
the success probability under the null hypothesis. |
alpha |
the significance level. |
maxiter |
the maximum number of iterations allowed. |
tol |
tolerance used in testing floating point numbers. |
At most one of x
, p
, and alpha
is allowed to be
a vector. Evaluates the critical function for the UMPU two-tailed
test for the binomial distribution, which satisfies the following
x <- seq(0, n) phix <- umpu.binom(x, n, p, alpha) px <- dbinom(x, n, p) sum(phix * px) == alpha sum(x * phix * px) == n * p * alpha
when p
is strictly between zero and one.
a vector of values of the critical function.
library(ump) umpu.binom(0:10, 10, 0.6, 0.1)
library(ump) umpu.binom(0:10, 10, 0.6, 0.1)