Why do I get errors when I use the "nlmefit" function to fit a model in SimBiology?

12 views (last 30 days)
I am using SimBiology Model Analyzer to fit a model from my data using nonlinear mixed-effects estimation. I select the 'Fit Data' program after loading the data from the Excel file. I select the model as 'mPBPK_base' and setup the data and response accordingly. I try to run the fit using 'mixed effects' statistical modeling. The transformation is exp(theta1+eta1). The 'error model' is 'constant'. Under 'Algorithm settings', 'ApproximationType' is set to 'FOCE'. This produces the following error:
 
error After the initial refinement of the fixed effects with the Levenberg-Marquardt algorithm some columns of the Jacobian are effectively zero at BETA0, indicating that the model is insensitive to some of its parameters. That may be because those parameters are not present in the model, or otherwise do not affect the predicted values. It may also be due to numerical underflow in the model function, which can sometimes be avoided by choosing better initial parameter values, or by rescaling or recentering.
I then changed the ‘RefineBeta0’ to ‘off’ in the Advanced Algorithm Settings, which was supposed to be more robust in fitting. But I get the following error:
 
error A simulation errored or returned NaN, Inf, or complex values during parameter estimation. This typically indicates that the estimated parameter values converged to values that are invalid for the model.
Why do I get these errors? Is there any robust way to fit my model?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Jan 2023
By R2022b, the 'nlmefit' function for nonlinear mixed-effects estimation is not robust enough for some ill-posed fitting problems, even disabling the 'RefineBeta0' option is insufficient for this situation. The MATLAB development team is aware of this issue and might improve the function in a future release.
 
Essentially, the parameter to be fit cannot be estimated very well if it has relatively little effect on the quality of the fit. The gradient-based estimation approach will attempt a large step to converge, which could cause a problem with the Jacobian (when 'RefineBeta0' is on) or with the simulations (when the 'RefineBeta0' is off). 
In addition, it is unnecessary to use the mixed-effects modeling approach if your dataset has many concentration measurements for each group. As a workaround, you can use a method that is not gradient-based, for example, ‘fminsearch’ as linked below.
It should converge quickly and without error. 

More Answers (0)

Communities

More Answers in the  SimBiology Community

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!