Skip to content

Commit

Permalink
Update acceptable statuses to include MOI.LOCALLY_SOLVED
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Mar 9, 2019
1 parent ac5d4c5 commit 895b60f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/fitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ function fit_mle(::Type{GeneralizedExtremeValue}, bm::BlockMaxima)
status₀ = termination_status(mle₀)

# acceptable statuses
OK = MOI.OPTIMAL
OK = (MOI.OPTIMAL, MOI.LOCALLY_SOLVED)

if status == OK && status₀ == OK
if status OK && status₀ OK
# choose the maximum amongst the two
if objective_value(mle) > objective_value(mle₀)
GeneralizedExtremeValue(value(μ), value(σ), value(ξ))
else
GeneralizedExtremeValue(value(μ₀), value(σ₀), 0.)
end
elseif status == OK
elseif status OK
GeneralizedExtremeValue(value(μ), value(σ), value(ξ))
elseif status₀ == OK
elseif status₀ OK
GeneralizedExtremeValue(value(μ₀), value(σ₀), 0.)
else
error("could not fit distribution to maxima")
Expand Down Expand Up @@ -110,18 +110,18 @@ function fit_mle(::Type{GeneralizedPareto}, pm::PeakOverThreshold)
status₀ = termination_status(mle₀)

# acceptable statuses
OK = MOI.OPTIMAL
OK = (MOI.OPTIMAL, MOI.LOCALLY_SOLVED)

if status == OK && status₀ == OK
if status OK && status₀ OK
# choose the maximum amongst the two
if objective_value(mle) > objective_value(mle₀)
GeneralizedPareto(0.0, value(σ), value(ξ))
else
GeneralizedPareto(0.0, value(σ₀), 0.0)
end
elseif status == OK
elseif status OK
GeneralizedPareto(0.0, value(σ), value(ξ))
elseif status₀ == OK
elseif status₀ OK
GeneralizedPareto(0.0, value(σ₀), 0.0)
else
error("could not fit distribution to maxima")
Expand Down

0 comments on commit 895b60f

Please sign in to comment.