condition: Conditioning of prior distributions

Description Usage Arguments See Also Examples

Description

Prior objects can be conditioned on lower or upper boundaries, intervals, or single values to restrict their support. Various shorthand notations are supported (see examples).

Usage

1
2
3
4
5
6
7
8
9
condition(prior, low = 0, high = 1)

## S4 method for signature 'Prior'
condition(prior, low = 0, high = 1)

prior %|% interval

## S4 method for signature 'Prior,numeric'
prior %|% interval

Arguments

prior

Prior distribution object representing a prior on the unit interval [0,1]

low

[optional] lower boundary to condition on

high

[optional] upper boundary to condition on

See Also

Prior, updating for Bayesian updating

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
badr::load_julia_package()

load_julia_package()
condition(Beta(2, 3), low = 0.2)
condition(Beta(2, 3), high = 0.9)
condition(Beta(2, 3), low = 0.2, high = 0.9)

Beta(5, 7) %|% c(0.2, 0.7) # shorthand for conditioning on interval
Beta(5, 7) %|% 0.5 # condition on single point

Beta(5, 7) <= 0.5 # = condition(Beta(5, 7), high = 0.5)
0.2 <= Beta(5, 7) # = condition(Beta(5, 7), low = 0.2)

kkmann/badr documentation built on Oct. 18, 2020, 5:22 p.m.