# BNBDist: Beta-negative binomial distribution In brr: Bayesian Inference on the Ratio of Two Poisson Rates

## Description

Density, cumulative function, quantile function and random generation for the Beta-negative binomial distribution with shape parameters `a`, `c`, `d`.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```dbeta_nbinom(x, a, c, d, ...) pbeta_nbinom(q, a, c, d, ...) qbeta_nbinom(p, a, c, d, ...) rbeta_nbinom(n, a, c, d) sbeta_nbinom(a, c, d) summary_beta_nbinom(a, c, d, output = "list", ...) ```

## Arguments

 `x,q` vector of non-negative integer quantities `a,c,d` non-negative shape parameters `...` other arguments passed to `ghyper` `p` vector of probabilities `n` number of observations to be sampled `output` type of the `summary_beta_nbinom` output: `"list"` to return a list, `"pandoc"` to print a table

## Details

This is the mixture distribution obtained by sampling a value b from a Beta distribution with parameters c, d, then sampling a value λ from a Gamma distribution with shape a and rate b/(1-b), and then sampling a Poisson distribution with mean λ.

## Value

`dbeta_nbinom` gives the density, `pbeta_nbinom` the cumulative function, `qbeta_nbinom` the quantile function, `rbeta_nbinom` samples from the distribution, `sbeta_nbinom` and `summary_beta_nbinom` give some summaries of the distribution.

## Note

`BNBDist` is a generic name for the functions documented.

## Examples

 ```1 2 3``` ```a <- 2 ; c <- 5 ; d <- 30 barplot(dbeta_nbinom(0:50, a, c, d), names=0:50) summary_beta_nbinom(a, c, d) ```

### Example output

```sh: 1: cannot create /dev/null: Permission denied
\$mean
[1] 15

\$mode
[1] 4

\$sd
[1] 15.96872

\$Q1
[1] 5

\$Q2
[1] 11

\$Q3
[1] 19
```

brr documentation built on May 29, 2017, 3:10 p.m.