Python SBML import: add support for `factorial()`
Factorials are not differentiable and thus incompatible with sensitivity analysis.
As we discussed supporting SED-ML for simulations (outside the parameter estimation context), it might be worth thinking about handling models where no symbolic sensitivities are available and where potentially no sensitivities are required.
Technically using the gamma function as meromorphic continuation might work.
As we discussed supporting SED-ML for simulations (outside the parameter estimation context), it might be worth thinking about handling models where no symbolic sensitivities are available and where potentially no sensitivities are required.
In favor! A mere simulation tool would be good for a couple of situations. Additionally, we might then need to adapt pypesto which, I think, assumes that the gradient is always available.
In cases where one is only interested in simulation, why not use http://libroadrunner.org?
Fully agreeing that there might be more appropriate tools for that use case. But then the benefits of supporting SEDML in AMICI are not clear to me.
Because then I would need to learn how to use it ;) . How much effort would it be to allow 0 order output in amici? If it involves rewriting parts of its logic, then maybe not. If it's only about adding some options, might be worth the try, to extend amici's capabilities.
Oh to clarify, it's not only a problem for the computation of sensitivities, but also for the computation of the ODE jacobian, which also applies to zero order simulations. You can try to simulate those systems, but you are unlikely to obtain numerically robust results.
Sympy is able to correctly compute the derivative gamma(x + 1)*polygamma(0, x + 1) for factorial(x). Although gamma is available from C++11 as tgamma, polygamma or here specifically digamma is not part of any C++ standard but requires boost as external dependency. Now we could certainly try to implement our own poly/digamma function but that doesn't really sound like too much fun, and I honestly don't see too much added value.
I think support of sed-ml is still reasonable. Models from JWS and in parts from Biomodels specify simulation procedures as sed-ml. If one wants to do exhaustive benchmarks on these models without spending tens to hundreds of hours manually reimplementing these procedures, support for sed-ml is a sane thing to do. Moreover export of simulations from petab/expdata formats to something that is also interpretable by pure simulation tools would be helpful (why should they support petab when they only do simulations?). Our current approach of having simulation specifications and experimental data so intertwined effectively breaks the modularity between pypesto and amici.
polygamma or here specifically digamma is not part of any C++ standard but requires boost as external dependency
Scipy polygamma computes that from gamma and zeta. The latter is available in the C++ standard library from C++17. :)
I don't really need it. It was mostly to keep track of SBML things that are currently not supported. 1) So somebody who may want to contribute can pick up on them. 2) To mention why they won't happen.
Moreover export of simulations from petab/expdata [...]
Export, agreed. By "support" I meant "import".
If one wants to do exhaustive benchmarks [...]
For simulation or optimization? For the former, we are back to why not using other tools or supporting no-sensitivity models. For the latter, I guess there is anyways quite some manual intervention required.
(Maybe should have gone for a separate sedml thread :sweat_smile: )
@paulstapor @LeonardSchmiester @yannikschaelte What did Philipp do regarding the sed-ml import. As he is using JWS online models I'm wondering if he implemented something like an sed-ml import.
For my bachelor thesis I wrote a sedml import script to automatically download all available 293 sedml files from JWS.
The script uses the json format and the individual url of the sedml files.
After one downloads all sedml files, one can use the existing sbml files given by the sedml files to simulate all models automatically.
Additionally some sedml models have experimental data files with data points that can be simulated too.
In the end the model trajectories and the experimental data points can be plotted.