condition: Condition a prior on an interval

Description Usage Arguments Value Examples

Description

Restrict an object of class Prior to a sub-interval and re-normalize the PDF.

Usage

1
2
3
4
5
6
7
condition(dist, interval, ...)

## S4 method for signature 'PointMassPrior,numeric'
condition(dist, interval, ...)

## S4 method for signature 'ContinuousPrior,numeric'
condition(dist, interval, ...)

Arguments

dist

a univariate distribution object

interval

length-two numeric vector giving the parameter interval to condition on

...

further optional arguments

Value

conditional Prior on given interval

Examples

1
2
3
4
5
6
7
8
tmp <- condition(PointMassPrior(c(0, .5), c(.3, .7)), c(-1, .25))
expectation(tmp, identity) # 0

tmp <- condition(
    ContinuousPrior(function(x) dunif(x, .2, .4), c(.2, .4)),
    c(.3, .5)
)
bounds(tmp) # c(.3, .4)

adoptr documentation built on June 28, 2021, 5:11 p.m.