Learn R Programming

brr (version 1.0.0)

Prior_x_given_y: Prior predictive distribution of the count $x$ in the treated group conditionally to the count $y$ in the treated group

Description

Density, distribution function, quantile function and random generation for the conditional prior predictive distribution of $x$ given $y$.

Usage

dprior_x_given_y(x, y, a, c, d)
pprior_x_given_y(q, y, a, c, d)
qprior_x_given_y(p, y, a, c, d)
rprior_x_given_y(n, y, a, c, d)
sprior_x_given_y(y, a, c, d, ...)

Arguments

x,q
vector of non-negative integer quantiles
y
count (integer) in the control group
a
non-negative shape parameter of the Gamma prior distribution on the rate $\mu$
c,d
non-negative shape parameters of the prior distribution on $\phi$
p
vector of probabilities
n
number of observations to be simulated
...
arguments passed to summary_beta_nbinom

Value

dprior_x_given_y gives the density, pprior_x_given_y the distribution function, qprior_x_given_y the quantile function, rprior_x_given_y samples from the distribution, and sprior_x_given_y gives a summary of the distribution.

Details

The prior predictive distribution of the count $x$ is the Beta-negative binomial distribution with shape parameters $a+y$, $d$, $c$.

Examples

Run this code
barplot(dprior_x_given_y(0:10, 5, 3, 10, 20))
sprior_x_given_y(5, 3, 10, 20, output="pandoc")

Run the code above in your browser using DataLab