Skip to content

Commit 895b60f

Browse files
committed
Update acceptable statuses to include MOI.LOCALLY_SOLVED
1 parent ac5d4c5 commit 895b60f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/fitting.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ function fit_mle(::Type{GeneralizedExtremeValue}, bm::BlockMaxima)
4848
status₀ = termination_status(mle₀)
4949

5050
# acceptable statuses
51-
OK = MOI.OPTIMAL
51+
OK = (MOI.OPTIMAL, MOI.LOCALLY_SOLVED)
5252

53-
if status == OK && status₀ == OK
53+
if status OK && status₀ OK
5454
# choose the maximum amongst the two
5555
if objective_value(mle) > objective_value(mle₀)
5656
GeneralizedExtremeValue(value(μ), value(σ), value(ξ))
5757
else
5858
GeneralizedExtremeValue(value(μ₀), value(σ₀), 0.)
5959
end
60-
elseif status == OK
60+
elseif status OK
6161
GeneralizedExtremeValue(value(μ), value(σ), value(ξ))
62-
elseif status₀ == OK
62+
elseif status₀ OK
6363
GeneralizedExtremeValue(value(μ₀), value(σ₀), 0.)
6464
else
6565
error("could not fit distribution to maxima")
@@ -110,18 +110,18 @@ function fit_mle(::Type{GeneralizedPareto}, pm::PeakOverThreshold)
110110
status₀ = termination_status(mle₀)
111111

112112
# acceptable statuses
113-
OK = MOI.OPTIMAL
113+
OK = (MOI.OPTIMAL, MOI.LOCALLY_SOLVED)
114114

115-
if status == OK && status₀ == OK
115+
if status OK && status₀ OK
116116
# choose the maximum amongst the two
117117
if objective_value(mle) > objective_value(mle₀)
118118
GeneralizedPareto(0.0, value(σ), value(ξ))
119119
else
120120
GeneralizedPareto(0.0, value(σ₀), 0.0)
121121
end
122-
elseif status == OK
122+
elseif status OK
123123
GeneralizedPareto(0.0, value(σ), value(ξ))
124-
elseif status₀ == OK
124+
elseif status₀ OK
125125
GeneralizedPareto(0.0, value(σ₀), 0.0)
126126
else
127127
error("could not fit distribution to maxima")

0 commit comments

Comments
 (0)