minimize
takes an unconditional score and
a constraint set (or no constraint) and solves the corresponding
minimization problem using
nloptr
(using COBYLA by default).
An initial design has to be defined. It is also possible to define
lower- and upper-boundary designs. If this is not done, the boundaries are
determined automatically heuristically.
minimize(
objective,
subject_to,
initial_design,
lower_boundary_design = get_lower_boundary_design(initial_design),
upper_boundary_design = get_upper_boundary_design(initial_design),
opts = list(algorithm = "NLOPT_LN_COBYLA", xtol_rel = 1e-05, maxeval = 10000),
...
)
objective function
constraint collection
initial guess (x0 for nloptr)
design specifying the lower boundary.
design specifying the upper boundary
options list passed to nloptr
further optional arguments passed to nloptr
a list with elements:
The resulting optimal design
Output of the corresponding nloptr call
The arguments given to the optimization call
# Define Type one error rate
toer <- Power(Normal(), PointMassPrior(0.0, 1))
# Define Power at delta = 0.4
pow <- Power(Normal(), PointMassPrior(0.4, 1))
# Define expected sample size at delta = 0.4
ess <- ExpectedSampleSize(Normal(), PointMassPrior(0.4, 1))
# Compute design minimizing ess subject to power and toer constraints
if (FALSE) {
minimize(
ess,
subject_to(
toer <= 0.025,
pow >= 0.9
),
initial_design = TwoStageDesign(50, .0, 2.0, 60.0, 2.0, 5L)
)
}