R/Prior.R
, R/PointMassPrior.R
, R/ContinuousPrior.R
posterior.Rd
Return posterior distribution given observing stage-one outcome.
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, ...)
a univariate distribution
object
a Prior
object
stage-one test statistic
stage-one sample size
further optional arguments
Object of class Prior
posterior(Normal(), PointMassPrior(0, 1), 2, 20)
#> PointMass<0.00>
tmp <- ContinuousPrior(function(x) dunif(x, .2, .4), c(.2, .4))
posterior(Normal(), tmp, 2, 20)
#> ContinuousPrior<[0.2,0.4]>