Skip to content

Commit

Permalink
Fix NLopt relative solution tolerance, add max feval NLopt criterion (#…
Browse files Browse the repository at this point in the history
…75)

The relative X tolerance criterion was previously set to optsum.ftol_rel
(this may have been a typo). This change changes it to optsum.xtol_rel

In addition, the NLopt maxeval stopping criterion was set to
optsum.feval ( -1 by default)
  • Loading branch information
kaskarn authored and dmbates committed Mar 28, 2017
1 parent fffc2d1 commit 979ae6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ function StatsBase.fit!{T}(m::LinearMixedModel{T}, verbose::Bool=false)
opt = NLopt.Opt(optsum.optimizer, length(x))
NLopt.ftol_rel!(opt, optsum.ftol_rel) # relative criterion on objective
NLopt.ftol_abs!(opt, optsum.ftol_abs) # absolute criterion on objective
NLopt.xtol_rel!(opt, optsum.ftol_rel) # relative criterion on parameter values
NLopt.xtol_rel!(opt, optsum.xtol_rel) # relative criterion on parameter values
NLopt.xtol_abs!(opt, optsum.xtol_abs) # absolute criterion on parameter values
NLopt.lower_bounds!(opt, lb)
NLopt.maxeval!(opt, optsum.feval)
feval = 0
function obj(x, g)
length(g) == 0 || error("gradient not defined")
Expand Down

0 comments on commit 979ae6e

Please sign in to comment.