How to debug "Initial guess is not an interior point" in Optim.jl?

I’m trying to do constrained optimization using `IPointNewton` in Optim.jl, but running `optimize(objective, dfc, θ0, IPNewton(), autodiff=:forward)` produces:

Initial guess is not an interior point

…and then the results are all `NaN`s.

However, I’m pretty sure the initial point `θ0` is fine:

1. It lies within its boundaries: `all(θ0 .≥ θ_lo) == true` and `all(θ0 .≤ θ_hi) == true`
2. Constraints also lie within boundaries at this point: `all(constr(θ0) .≥ constr_lo) == true` and `all(constr(θ0) .≤ constr_hi) == true`
3. The objective function is well-defined at this point: `objective(θ0) == 124.83061652726853`

Here, `constr` returns a vector of two constraints like `[c1, c2]`.

What else should I check?

I posted to the wrong category by mistake. Is it possible to move this post to “Optimization”?

In this context, interior point means strictly interior. That is l_i < x_i < u_i for all i.

1 Like

Right, I found the `isinterior` function in Optim whose documentation comment says:

``````Return `true` if point `x` is on the interior of the allowed region,
given the `constraints` which specify bounds `lx`, `ux`, `lc`, and
`uc`. `x` is in the interior if
lx[i] < x[i] < ux[i]
lc[i] < c[i] < uc[i]
for all possible `i`.
``````

Indeed, the inequalities are strict, but one of my `theta`s was right on the boundary of the parameter space (exactly equal to zero). I changed it to `1e-5`, and now everything works fine.

2 Likes