Learn R Programming

Boom (version 0.9.15)

discrete-uniform-prior: Discrete prior distributions

Description

Prior distributions over a discrete quantities.

Usage

PointMassPrior(location)
PoissonPrior(mean, lower.limit = 0, upper.limit = Inf)
DiscreteUniformPrior(lower.limit, upper.limit)

Value

Each function returns a prior object whose class is the same as the function name. All of these inherit from "DiscreteUniformPrior" and from "Prior".

The PoissonPrior assumes a potentially truncated Poisson distribution with the given mean.

Arguments

location

The location of the point mass.

mean

The mean of the Poisson distribution.

lower.limit

The smallest value within the support of the distribution. The prior probability for numbers less than lower.limit is zero.

upper.limit

The largest value within the support of the distribution. The prior probability for numbers greater than upper.limit is zero.

Author

Steven L. Scott steve.the.bayesian@gmail.com

Examples

Run this code

## Specify an exact number of trees in a Bart model (see the BoomBart
## package).

ntrees <- PointMassPrior(200)

## Uniform prior between 50 and 100 trees, including the endpoints.
ntrees <- DiscreteUniformPrior(50, 100)

## Truncated Poisson prior, with a mean of 20, a lower endpoint of 1,
## and an upper endpoint of 50.
ntrees <- PoissonPrior(20, 1, 50)

Run the code above in your browser using DataLab