Open jkfindeisen opened 6 years ago
That would make easier to add more complex models. I am not so familiar with C++ libraries, was this just a todo/reminder, or do you have any idea/examples of how to do it?
Also this somehow link to issue #27
This is a reminder for a future improvement to the library.
I have implemented a numerical differentiation that worked well for me, I have created an example file here: Numerical Differentiation I tested it against an analytical derivative for this model (Tofts exchange model) and it had nearly identical performance and accuracy. Due the the multiple value evaluations required I created a helper function get_value() to make the code a little cleaner. This could be added to the main project as an example giving people an easy option to add numerical derivative if they chose. The proposed solution can be added on a model by model basis which is convenient. I'm happy to help with integration.
That is standard in many other packages and also quite useful to check models. It also would allow to use models without an analytical derivative at the cost of performance and maybe numerical accuracy.