Pairs a constraint function with the value it is compared against and the comparison type.
Pass a list of these as constraints to optim_minimize() with
method = "augmented_lagrange".
Usage
optim_constraint(f, value, type = c("eq", "le", "ge"), tolerance = 1e-08)Arguments
- f
a function taking a numeric parameter vector and returning a single number – the left-hand side of the constraint.
- value
the number
fis compared against.- type
"eq"forf(x) == value,"le"forf(x) <= value, or"ge"forf(x) >= value.- tolerance
how far from
valuestill counts as feasible, matching the upstreamConstraintclass's own default.