From 895b60f59f10f145ac4c58c2e88b79114e9cf5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20Hoffimann?= Date: Fri, 8 Mar 2019 21:41:00 -0300 Subject: [PATCH] Update acceptable statuses to include MOI.LOCALLY_SOLVED --- src/fitting.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fitting.jl b/src/fitting.jl index 330145a..3641298 100644 --- a/src/fitting.jl +++ b/src/fitting.jl @@ -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") @@ -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")