I am maximizing a somewhat difficult likelihood function, for which the values are occasionally non-finite. I run into stack traces like
ERROR: AssertionError: isfinite(phid) && isfinite(gphi)
Stacktrace:
[1] bisect!(::Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::LineSearches.LineSearchResults{Float64}, ::Int64, ::Int64, ::Float64, ::Int64) at /home/tamas/.julia/v0.6/LineSearches/src/hagerzhang.jl:473
[2] _hagerzhang!(::Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::LineSearches.LineSearchResults{Float64}, ::Float64, ::Bool, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Int64, ::Float64, ::Int64) at /home/tamas/.julia/v0.6/LineSearches/src/hagerzhang.jl:188
[3] perform_linesearch!(::Optim.LBFGSState{Array{Float64,1},Array{Array{Float64,1},1},Array{Array{Float64,1},1},Float64,Array{Float64,1}}, ::Optim.LBFGS{Void,LineSearches.InitialStatic{Float64},LineSearches.HagerZhang{Float64},Optim.##76#78}, ::Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}}) at /home/tamas/.julia/v0.6/Optim/src/utilities/perform_linesearch.jl:47
[4] update_state!(::NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}, ::Optim.LBFGSState{Array{Float64,1},Array{Array{Float64,1},1},Array{Array{Float64,1},1},Float64,Array{Float64,1}}, ::Optim.LBFGS{Void,LineSearches.InitialStatic{Float64},LineSearches.HagerZhang{Float64},Optim.##76#78}) at /home/tamas/.julia/v0.6/Optim/src/multivariate/solvers/first_order/l_bfgs.jl:198
[5] optimize(::NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}, ::Array{Float64,1}, ::Optim.LBFGS{Void,LineSearches.InitialStatic{Float64},LineSearches.HagerZhang{Float64},Optim.##76#78}, ::Optim.Options{Float64,Void}, ::Optim.LBFGSState{Array{Float64,1},Array{Array{Float64,1},1},Array{Array{Float64,1},1},Float64,Array{Float64,1}}) at /home/tamas/.julia/v0.6/Optim/src/multivariate/optimize/optimize.jl:51
[6] optimize(::NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1},Val{false}}, ::Array{Float64,1}, ::Optim.LBFGS{Void,LineSearches.InitialStatic{Float64},LineSearches.HagerZhang{Float64},Optim.##76#78}) at /home/tamas/.julia/v0.6/Optim/src/multivariate/optimize/optimize.jl:25
Can I somehow convince Optim.optimize
to just gracefully ignore these proposed values? Using BGFS()
with autodiff = :forward
.