Learn R Programming

adoptr (version 0.2.2)

posterior: Compute posterior distribution

Description

Return posterior distribution given observing stage-one outcome.

Usage

posterior(dist, prior, x1, n1, ...)

# S4 method for DataDistribution,PointMassPrior,numeric posterior(dist, prior, x1, n1, ...)

# S4 method for DataDistribution,ContinuousPrior,numeric posterior(dist, prior, x1, n1, tighten_support = FALSE, check_normalization = FALSE, ...)

Arguments

dist

a univariate distribution object

prior

a Prior object

x1

stage-one test statistic

n1

stage-one sample size

...

further optional arguments

tighten_support

logical indicating if the support should be tightened

check_normalization

logical indicating if it should be checked that pdf defines a density.

Value

Object of class Prior

Examples

Run this code
# NOT RUN {
posterior(Normal(), PointMassPrior(0, 1), 2, 20)

tmp <- ContinuousPrior(function(x) dunif(x, .2, .4), c(.2, .4))
posterior(Normal(), tmp, 2, 20)

# }

Run the code above in your browser using DataLab