Learn R Programming

brr (version 1.0.0)

Prior_y: Prior predictive distribution of the count in the control group

Description

Density, distribution function, quantile function and random generation for the prior predictive distribution of the count in the control group.

Usage

dprior_y(y, a, b, T, ...)
pprior_y(q, a, b, T, ...)
qprior_y(p, a, b, T, ...)
rprior_y(n, a, b, T)
sprior_y(a, b, T, ...)

Arguments

y,q
vector of non-negative integer quantiles
a,b
non-negative shape parameter and rate parameter of the Gamma prior distribution on the rate $\mu$
T
sample size of the control group
...
other arguments passed to NegBinomial or summary_nbinom (for sprior_y)
p
vector of probabilities
n
number of observations to be simulated

Value

dprior_y gives the density, pprior_y the distribution function, qprior_y the quantile function, rprior_y samples from the distribution, and sprior_y gives a summary of the distribution.

Details

The prior predictive distribution of the count $y$ is the Poisson-Gamma distribution with shape parameter $a$ and hyperrate parameter $b/T$, which is also the negative binomial distribution with shape $a$ and probability of success $b/(b+T)$.

Examples

Run this code
barplot(dprior_y(0:10, 2, 2, 1))
sprior_y(2, 2, 1, output="pandoc")

Run the code above in your browser using DataLab