MyNixOS website logo
Description

One-Sided Multinomial Probabilities.

Implements multinomial CDF (P(N1<=n1, ..., Nk<=nk)) and tail probabilities (P(N1>n1, ..., Nk>nk)), as well as probabilities with both constraints (P(l1<N1<=u1, ..., lk<Nk<=uk)). Uses a method suggested by Bruce Levin (1981) <doi:10.1214/aos/1176345593>.

pmultinom is a library for calculating multinomial probabilities. The probabilities that can be calculated include the multinomial cumulative distribution function: $$P(N_1 \le u_1, N_2 \le u_2, \cdots, N_k \le u_k)$$ In this case the usage would be

pmultinom(upper=us, size=n, probs=ps, method="exact")

where us is the vector containing $u_1, u_2, \cdots, u_k$, and n and ps are the parameters of the multinomial distribution. This usage is analogous to the use of pbinom. Another important case is the probability of seeing more than some minimum number of observations in each category: $$P(N_1 > l_1, N_2 > l_2, \cdots, N_k > l_k)$$ In this case the usage would be

pmultinom(lower=ls, size=n, probs=ps, method="exact")

where this time ls is the vector containing $l_1, l_2, \cdots, l_k$. Notice that in this case these are greater than signs, not greater than or equal signs. This is analogous to the usage of pbinom with lower.tail=FALSE. With some creativity, these can be adapted to calculate the probability that the maximum or minimum of a multinomial random vector is a given number, or that a given category will be the most or least observed. pmultinom also supports a more general usage, in which both lower and upper bounds are specified: $$P(l_1 < N_1 \le u_1, l_2 < N_2 \le u_2, \cdots, l_k < N_k \le u_k)$$ In this case the usage would be

pmultinom(lower=ls, upper=us, size=n, probs=ps, method="exact")

See vignette("pmultinom") for the above text in Latex plus an example application. Many thanks to Aislyn Schalck for advice and encouragement.

Metadata

Version

1.0.0

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