Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter fitting example from the documentation throws an error #1188

Closed
PBrdng opened this issue Feb 26, 2025 · 8 comments
Closed

The parameter fitting example from the documentation throws an error #1188

PBrdng opened this issue Feb 26, 2025 · 8 comments
Labels

Comments

@PBrdng
Copy link

PBrdng commented Feb 26, 2025

Hi all,

I'm trying to run the parameter fitting example from the documentation. The line

optsol = solve(optprob, NLopt.LN_NELDERMEAD())

throws an error, namely

ArgumentError: invalid index: ModelingToolkit.ParameterIndex{SciMLStructures.Tunable, Int64}(SciMLStructures.Tunable(), 1, false) of type ModelingToolkit.ParameterIndex{SciMLStructures.Tunable, Int64}
Stacktrace:
  [1] to_index(i::ModelingToolkit.ParameterIndex{SciMLStructures.Tunable, Int64})
...

Any ideas what is the problem here? I updated all packages and Julia today, so I'm running the most recent version.

Thanks for your help!

@PBrdng PBrdng added the bug label Feb 26, 2025
@PBrdng
Copy link
Author

PBrdng commented Feb 26, 2025

Update: on the master branch everything works fine.

@isaacsas
Copy link
Member

@TorkelE can hopefully help as he has some experience with DiffEqParamEstim, but my impression is that package really isn't being super maintained anymore.

Do you have issues if you directly use Optimization.jl and build your own custom loss function instead?

For the master version of docs we have already removed DiffEqParamEstimation from the tutorials, and now suggest just directly using Optimization.jl or PEtab.jl. The updated version of the tutorial you were looking at is:

https://docs.sciml.ai/Catalyst/dev/inverse_problems/optimization_ode_param_fitting/

@isaacsas
Copy link
Member

(And at least for me, the updated tutorial works with the latest release version too.)

@PBrdng
Copy link
Author

PBrdng commented Feb 26, 2025

Thanks. Maybe, it's an issue with my setup. Nevermind, I will look into Petab. That's also what Torkel recommended to me.

@PBrdng PBrdng closed this as completed Feb 26, 2025
@isaacsas
Copy link
Member

Please do let us know if you try the newer tutorial version and it doesn't work for you too! Purely Optimization.jl workflows should work and are intended to be supported. It is just that DiffEqParamEstim.jl really isn't being maintained much (it's last release is over a year ago, for example).

All that said, my impression too is that if your use case fits within the functionality it provides, PEtab.jl is probably the best option for parameter inference in ODE reaction network models.

@isaacsas
Copy link
Member

Here is the latest version of the PEtab.jl tutorial:

https://docs.sciml.ai/Catalyst/dev/inverse_problems/petab_ode_param_fitting/

@TorkelE
Copy link
Member

TorkelE commented Feb 26, 2025

Yes, just follow the latest PEtab tutorial, and that should hopefully have what you got. Unfortunately there has been a chain of MTK updates that have been stopping any Catalyst updates, so the docs are a bit outdated. Hopefully it is sorted out soon.

@ChrisRackauckas
Copy link
Member

Yeah I need to update DiffEqParamEstim...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants