- The complexity of your model: If you have a larger model (more ODEs and algebraic equations), it will take longer to numerically solve the model. Generally, the optimization process requires the equations to be solved for each iteration (pooled fit) and/or each individual in your dataset at each iteration (unpooled fit and mixed effects estimation)
- The effective stop time for the simulation. During a fit, this would be determined by the last time point in your dataset. If you only have to simulate your model for 1 day vs 1 month, that makes a difference
- The solver settings for the ODE solver: if you tolerances are unnecessarily low, the ODE solver will take more steps than is necessary to simulate the model. You can set these tolerances in the simulation settings window. I found this documentation page helpful wrt the absolute and relative tolerance: Absolute and Relative Tolerance
- The solver settings for the optimization algorithm: if your termination criteria are too restrictive, the optimization may never terminate. Generally, you have a termination criteria for the objective function (you can glean what a fair termination criterium from the log-likelihood in the progress plot), for the parameter estimate, for the first-order optimality (a measure of the gradient at the optimal point that can also be gleaned from the progress plot, only for gradient-based optimization methods), and the maximum number of iterations (this is not a desirable termination criterion because it doesn't represent a mathematical optimum).
- The number of parameters you are estimating. The higher the number, the higher the dimensionality of your search space.
- The optimization algorithm: local optimization algorithms (lsqnonlin, fmincon, fminsearch, fminunc, nlinfit) are generally fastest, global optimization algorithms (scattersearch, patternseach, ga, particleswarm) generally require many more iterations due to their mathematical approach. Mixed effects algorithms, also require more iterations than local algorithms, so they may also take longer. Especially for the mixed effects algorithms, the default termination criteria tend to be conservative, so you may want loosen these criteria. We are also aware of the nlmefitsa algorithm taking a very long time to converge.
- There may be an identifiability issue where some of the parameters you are trying to estimate are not identifiable. See this webinar for more info on identifiability and sensitivity analysis for parameter estimation: https://www.rosaandco.com/webinars/2019/parameter-estimation-to-establish-confidence-model-predictions
- Make sure your optimization is still progressing after 30 minutes by looking at the progress plot - if so, either wait longer, use parallel computing toolbox (will only help on unpooled, mixed effects or global optimization fits) to speed up the optimization, try changing the termination criteria.
- Investigate identifiability of your parameters, e.g. using the AliasingScore app for SimBiology models
- Reduce the number of parameters you are estimating