Addressing Unsuccessful Minimization

Does anyone have recommendations on steps you should take when your model fit is unable to successfully minimize? I saw the prior feed on failed minimization (Successful minimization:) and looked at my ft.optim, but I am not sure how to go about addressing it. Is there a systematic approach/things I can adjust that may lead to successful minimization?

Hi adunn34:
I would recommend to fix some parameters that you believe they are similar to literature values. Example include the physiologic parameters in case of Friberg model (semiphysiologic model for neutrophil count). You can also reduce the number of random effects for less influential parameters (for example the etas on peripheral volume of distribution or intercompartmental clearance). Also there could be influential subjects or outliers in you data. I am not sure about your specific case, it will be helpful if you shared some context of your problem.

Sometimes it might also be that you are fine with the result even if the status of the minimization is failed. It might be difficult to compute standard errors for such results but the parameters might still be reasonable for prediction applications. At least I’ve seen many output files from out competitors where the final gradient is still huge and I don’t think that has stopped the analysts from using the final estimates for prediction purposes.

Got it, thank you for your input @andreasnoack . @ahmed.salem I’ll try your suggestions as well to see - My question is more general of how you should systematically approach minimization (key things you should check, when it is ok, etc.). But this all makes sense! Thank you both.

Good afternoon. I did want to follow up on this post. I have seen this happen in the past from update to update with certain models having successful minimizations and when running after updates they do not have successful minimizations. However recently I noticed on friday morning (9/22) i ran a model with successful minimization. On Sunday( 9/25) i ran the exact same model, with the exact same initial estimates and the exact same data. I got the exact same parameter estimates, and I got the exact same model metrics from the metric output except the minimization was false and the estimation time was shorter. Is there an explanation for why this may occur, and are there steps we should take to address this concern?
Thank you very much in advance.

Can you post the model for us?

I am curious if you are sure that you were using the same version of Pumas or if it could have different? If it was the same, then is there any simulation involved? How do you know the metrics were the same, did you store the old and the new?

Sorry for the many questions, but any explanation or solution relies on the details.

The conclusion of “true” or “false” for “Successful minimization” is more of an indication than anything else. It tells you if optimization stopped in a way where one of the pre-set stopping criteria was met. Due to numerical complications, it is not always possible to satisfy them. That said, a way to resolve this can sometimes be to follow this pattern:

ft = fit(model, data, param, approx) # this one gives you false, ...
f2 = fit(ft; reset_optim=true) # ... so let's restart the optimization algorithm at the final parameters

The reason why it works is that the outer optimization (over fixed effects) include an approximation to the second order derivative information, and by doing the above, you restart that approximation. The ebes will start at the final ebes from the first run. If you want to start completely over from the final fixed effects (restart the outer and inner optimization) you can do

ft3 =  fit(model, data, coef(ft), approx)

First thank you very much, this explanation is very helpful. To address some of the questions: I did not save the pumas version at each of these runs, it was whatever the default at each of those dates were, and while i am not aware of any updates, it is certainly possible one occurred between those two cases (and this would match with past experiences when this occurred) and there is no simulation involved in this model. As for the metrics I had screenshot the previous metrics and and parameter estimates and was able to compare.
Applying the provided solution did give successful minimization as did slightly adjusting an initial parameter value.

Re the request for the model I will include it below.
suc_2_cmt_oral = @model begin
@param begin
tvcl ∈ RealDomain(lower=0.0001)
tvdur ∈ RealDomain(lower=0.0001)
tvvc ∈ RealDomain(lower=0.0001)
tvvbm ∈ RealDomain(lower=0.0001)
tvvp ∈ RealDomain(lower=0.0001)
tvq ∈ RealDomain(lower=0.0001)
tvkeq ∈ RealDomain(lower=0.0001)
tvpc ∈ RealDomain(lower=0.0001, upper=1)
Ω ∈ PDiagDomain(4)
σ²_add_p ∈ RealDomain(lower=0.00001)
σ²_add_bm ∈ RealDomain(lower=0.00001)
σ²_prop_p ∈ RealDomain(lower=0.00001)
σ²_prop_bm ∈ RealDomain(lower=0.00001)
end

@random begin
η ~ MvNormal(Ω)
end
@covariates baseline_p baseline_bm

@pre begin

 CL     =  tvcl   * exp(η[1])  
 Vc     =  tvvc   * exp(η[2])  
 Vp     =  tvvp    
 Q      =  tvq   
vbm     = tvvbm
 PC     = tvpc    * exp(η[3]) 
 keq   =  tvkeq   

 b_p=baseline_p
 b_bm=baseline_bm

end

@dosecontrol begin
duration = (; Central=tvdur* exp(η[4]))
end
@init begin
Central= b_p
Bmilk = b_bm
end

@vars begin
cp = (Central / Vc)
cbm = (Bmilk/vbm)

end

@dynamics begin
Central’ = - CL/Vc * Central -Q/VcCentral+Q/VpPeripheal
Peripheal’ = Q/VcCentral-Q/VpPeripheal
transit1’ = PC*keq * Central/Vc -keq *transit1
transit2’ = keq *transit1 -keq *transit2
transit3’ = keq *transit2 -keq *transit3
transit4’ = keq *transit3 -keq *transit4
Bmilk’ = keq transit4 - keq Bmilk/vbm
end
@derived begin
Sucralose ~@. Normal(cp, sqrt((cp^2
σ²_prop_p)+σ²_add_p))
bm_s ~@. Normal(cbm, sqrt((cbm^2
σ²_prop_bm)+σ²_add_bm))
end
end`

1 Like