poisson.blaker.acc {BlakerCI} R Documentation

## Blaker's Poisson acceptability function, optionally unimodalized.

### Description

Calculates values of the acceptability function for the Poisson distribution (see Blaker (2000)) in a sequence of points (for, e.g., plotting purposes). The acceptability function may optionally be “unimodalized”, i.e. replaced with the smallest greater or equal unimodal function.

### Usage

```poisson.blaker.acc(x, p, type = c("orig", "unimod"),
acc.tol = 1e-10, ...)
```

### Arguments

 `x` number of events. `p` vector (length 1 allowed) of hypothesized Poisson parameters. In case of more than one point, an increasing sequence required. `type` for `type = "orig"`, original acceptability function calculated. For `type = "unimod"`, smallest unimodal function greater or equal to the acceptability function calculated instead. `acc.tol` numerical tolerance (relevant only for `type = "unimod"`). `...` additional arguments to be passed to `poisson.blaker.acc.single.p`; in fact, just `maxiter` (see `BlakerCI-internal`).

### Details

Single values of the “unimodalized” acceptability function (for `type = "unimod"`) are computed by an iterative numerical algorithm implemented in internal function
`poisson.blaker.acc.single.p`. The function cited is called just once in each of the intervals where the acceptability function is continuous (namely in the leftmost one of those points of `p` that fall into the interval when dealing with points below `x`, and the rightmost one when above `x`). The rest is done by function `cummax`. This is considerably faster than calling `poisson.blaker.acc.single.p` for every point of `p`. Note that applying `cummax` directly to a vector of unmodified acceptability values is even faster and provides a unimodal output; it may, nevertheless, lack accuracy.

### Value

Vector of acceptability values (with or without unimodalization) in points of `p`.

### Note

Inspired by M.P. Fay (2010), mentioning “unavoidable inconsistencies” between tests with non-unimodal acceptability functions and confidence intervals derived from them. When the acceptability functions are unimodalized and the test modified accordingly (i.e. p-values slightly increased in some cases), a perfectly matching test-CI pair is obtained.

### Author(s)

Jan Klaschka klaschka@cs.cas.cz

### References

Blaker, H. (2000) Confidence curves and improved exact confidence intervals for discrete distributions. Canadian Journal of Statistics 28: 783-798.
(Corrigenda: Canadian Journal of Statistics 29: 681.)

Fay, M.P. (2010). Two-sided Exact Tests and Matching Confidence Intervals for Discrete Data. R Journal 2(1): 53-58.

### Examples

```p <- seq(0,10,length=1001)
acc <- poisson.blaker.acc(3,p)
acc1 <- poisson.blaker.acc(3,p,type="unimod")
plot(p,acc,type="l")
lines(p,acc1,col="red")
legend(x=7,y=.8,c("orig","unimod"),col=c("black","red"),lwd=1)

## The two lines -- the unimodalized and original acceptabilities --
## look almost the same but some small differences are slightly
## visible.

## They can be seen better this way:
plot(p,acc1-acc,type="l")

## Focussing on one of them:
p <- seq(5.05,5.6,length=1001)
acc <- poisson.blaker.acc(3,p)
acc1 <- poisson.blaker.acc(3,p,type="unimod")
plot(p,acc,type="l",ylim=c(.391,.396))
lines(p,acc1,col="red")
legend(x=5.4,y=.395,c("orig","unimod"),col=c("black","red"),lwd=1)

```

[Package BlakerCI version 1.0-6 Index]