Learn R Programming

Boom (version 0.4)

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)

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.

Value

the function name. All of these inherit from "DiscreteUniformPrior" and from "Prior".The PoissonPrior assumes a potentially truncated Poisson distribution with the given mean.

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