MyNixOS website logo
Description

Feldman-Cousins Confidence Intervals.

Provides support for building Feldman-Cousins confidence intervals [G. J. Feldman and R. D. Cousins (1998) <doi:10.1103/PhysRevD.57.3873>].

fcci

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. R-CMD-check Codecov testcoverage CRANstatus R-universestatus Website Tweet

fcci is an R package providing support for building Feldman-Cousins confidence intervals.

Motivation

The Feldman-Cousins construction was originally developed in the context of High-Energy Physics, as a consistent method for building classical (frequentist) confidence intervals for Poisson rates of rare events. In experiments which expect only few events, it is often the case that the number of observed events is actually zero or, more generally, lower than the expected number of spurious background events (if the latter is significantly larger than zero).

In these situations, classical central intervals (such as those produced by stats::poisson.test()) are not satisfying, as they can lead both to significant overcoverage and to non-physical negative rates in the presence of a non-negligible background. Moreover, a naive special treatment of boundary values, which chooses to report an upper limit or a confidence interval depending on the data (the so-called “flip-flopping” policy), can lead to undercoverage.

Feldman and Cousins provide a unified treatment of boundary and regular values, by explicitly constructing the Neyman confidence belt for physical rates, using an ordering for count values based on a likelihood ratio.

Installation

You can install the latest release of fcci from CRAN using:

install.packages("fcci")

and the development version from my R-universe with:

install.packages("fcci", repos = "https://vgherard.r-universe.dev/")

Example

library(fcci)

To compute a confidence interval for, e.g., a Poisson rate, use:

# 95% C.L. interval for n = 10 events and b = 2 expected background events
confint_pois(n = 10, b = 2, cl = 0.95)
#> [1]  2.9205 15.8130
#> attr(,"cl")
#> [1] 0.95

Let us compare the 68% C.L. intervals for n = 0 events and no background obtained from fcci and from stats::poisson.test()

confint_pois(n = 0, cl = 0.68)
#> [1] 0.000 1.275
#> attr(,"cl")
#> [1] 0.68
stats::poisson.test(0, conf.level = 0.68, alternative = "two.sided")$conf.int
#> [1] 0.000000 1.832581
#> attr(,"conf.level")
#> [1] 0.68

Notice that the latter is significantly larger, and it corresponds in fact to an 84% C.L. upper limit on the rate:

stats::poisson.test(0, conf.level = 0.84, alternative = "less")$conf.int
#> [1] 0.000000 1.832581
#> attr(,"conf.level")
#> [1] 0.84

Getting Help

For further help, you can consult the reference page of the fcciwebsite or open an issue on the GitHub repository of fcci.

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows