metrumresearchgroup / Torsten

library of C++ functions that support applications of Stan in Pharmacometrics
BSD 3-Clause "New" or "Revised" License
52 stars 11 forks source link

[FEATURE] Passing fixed data as ODE parameters in pmx_solve_xxx functions #13

Closed yizhang-yiz closed 3 years ago

yizhang-yiz commented 5 years ago

Description

Referenced in https://github.com/metrumresearchgroup/math/issues/5

Example

Quote @charlesm93 in above issue

Sometimes we want to fit a PK/PD model with fixed PK parameters. Currently however, users must pass both PK and PD parameters in the array theta. We should relax this, and allow users to pass variables in the ODE system using x_r and x_i (i.e. real and integer data). This should lead to an appreciable speed-up.

Even more so, in fact, with the mixed solver (for the Friberg-Karlsson model, the theoretical speed-up would be around 70 - 80 %). The coding shouldn't be too bad; we need to make sure we promote variables only when necessary.

The only major drawback I see (other than development effort) is that this would make the function signature heavier. It might be worth thinking about ways around it.

Expected Output

Allow users to pass variables in the ODE system using x_r and x_i (i.e. real and integer data). An example can be found at #17.

Current Version:

v0.87.1

yizhang-yiz commented 5 years ago

@charlesm93 I don't have plan for this soon so if you or anyone interested to dig in I'd be appreciated.

yizhang-yiz commented 3 years ago

This has been added.