Learn R Programming

HelpersMG (version 5.1)

qSnbinom: Quantile function for the sum of random variable with negative binomial distributions.

Description

Quantile function for the sum of random variable with negative binomial distributions.

Usage

qSnbinom(
  p = stop("At least one probability must be provided"),
  size = stop("size parameter is mandatory"),
  prob = NULL,
  mu = NULL,
  lower.tail = TRUE,
  log.p = FALSE,
  tol = 1e-06
)

Arguments

p

vector of probabilities.

size

target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.

prob

probability of success in each trial. 0 < prob <= 1.

mu

alternative parametrization via mean.

lower.tail

logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].

log.p

logical; if TRUE, probabilities p are given as log(p).

tol

Tolerance for recurrence

Value

qSnbinom returns quantile function

Details

qSnbinom returns the quantile function for the sum of random variable with negative binomial distributions

See Also

Other Distribution of sum of random variable with negative binomial distributions: dSnbinom(), pSnbinom(), rSnbinom()

Examples

Run this code
# NOT RUN {
alpha <- c(2.1, 2.05, 2)
mu <- c(10, 30, 20)
q <- qSnbinom(p=0.1, size=alpha, mu=mu, lower.tail = TRUE)
# }

Run the code above in your browser using DataLab