subject_to: Create a collection of constraints

Description Usage Arguments Value See Also Examples

View source: R/constraints.R

Description

subject_to(...) can be used to generate an object of class ConstraintsCollection from an arbitrary number of (un)conditional constraints.

Usage

1
2
3
4
subject_to(...)

## S4 method for signature 'ConstraintsCollection,TwoStageDesign'
evaluate(s, design, optimization = FALSE, ...)

Arguments

...

either constraint objects (for subject_to or optional arguments passed to evaluate)

s

object of class ConstraintCollection

design

object

optimization

logical, if TRUE uses a relaxation to real parameters of the underlying design; used for smooth optimization.

Value

an object of class ConstraintsCollection

See Also

subject_to is intended to be used for constraint specification the constraints in minimize.

Examples

1
2
3
4
5
6
7
8
9
# define type one error rate and power
toer  <- Power(Normal(), PointMassPrior(0.0, 1))
power <- Power(Normal(), PointMassPrior(0.4, 1))

# create constrain collection
subject_to(
  toer  <= 0.025,
  power >= 0.9
)

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