I have a simple optimizing code that I would like to add a constraint to. I think it may fall under nonlinear optimization (so potentially
NLopt.jl) but I have no idea.
The function is defined as the sum of squared differences.
f(p) = sum((data_vector .- (p)*x_values.^p ).^2 optz = optimize(f, p0; autodiff = :forward) println(Optim.minimizer(optz))
so I am trying to estimate
p here. I would like to add a constraint to
p such that
p < 1.
It seems easy enough, but I am not sure how to really do it. Do I need “boxed constraints”?