Learn R Programming

nimble (version 1.2.1)

Constraint: Constraint calculations in NIMBLE

Description

Calculations to handle censoring

Usage

dconstraint(x, cond, log = FALSE)

rconstraint(n = 1, cond)

Value

dconstraint gives the density and rconstraint generates random deviates, but these are unusual as the density is 1 if x matches cond and 0 otherwise and the deviates are simply the value of cond

Arguments

x

value indicating whether cond is TRUE or FALSE

cond

logical value

log

logical; if TRUE, probability density is returned on the log scale.

n

number of observations (only n=1 is handled currently).

Author

Christopher Paciorek

Details

Used for working with constraints in BUGS code. See the NIMBLE manual for additional details.

See Also

Distributions for other standard distributions

Examples

Run this code
constr <- 3 > 2 && 4 > 0
x <- rconstraint(1, constr)
dconstraint(x, constr)
dconstraint(0, 3 > 4)
dconstraint(1, 3 > 4)
rconstraint(1, 3 > 4)

Run the code above in your browser using DataLab