> On Aug 16, 2016, at 5:41 AM, Daniel Lee <
bea...@alum.mit.edu> wrote:
>
> Charles, Bill, Sebastian, Andrew, and Bob: thanks for getting on a video call last week to help facilitate my understanding of what you're wanting to do with ODEs. It really helped me understand what's going on.
>
> I didn't want to edit the page without some agreement, so I'll start with edits here. Please feel free to address all, some, or none of it.
>
> Could we rename the wiki page? When I google "complex ode," it leads me to a wiki page on odes where the states are complex variables. I don't think that's what this page is about. Perhaps something like "Advanced techniques for models involving ODEs"?
Title doesn't matter, but -1 for both "advanced" and "complex". This
is all relatively basic and simple!
> One additional remark about renaming the wiki page: it's not focused on the complexity of ODEs at all. It abstracts that away. It's focused on techniques once you have a "solution operator." In the cases you're envisioning, the Stan program may not even specify an ODE. The dyanmic system may indeed have an ODE, but that may have been analytically solved so the representation is no longer an ODE from within the Stan language. (Honestly, this was my confusion going into the discussion and when I left the discussion, I felt much more comfortable about your plans.)
>
> A shift in what we've worked on in the past from what you're suggesting is before we treated the ODE function as the thing that matters and is what the user is interested in specifying. Here, the focus has shifted to the "solution operator." I think we should clearly define this, make it more prominent, and that will make it a lot easier to follow. For example, we should start by defining a "solution operator" (which isn't defined anywhere on the wiki as far as I can tell):
> A *solution operator* is a function that accepts a start time, a start state, and an end time, and provides the end state. The solution is either a numeric integration of an ODE system or an analytic solution (where the ODE is not specified as a Stan function).
>
> Should we change the arguments of integrate_ode_*() to accept a start time, a start state, an end time (instead of vector of times), and the parameters and data? This would play much nicer into what you're trying to do. It would also make life a lot simpler in terms of returning just a single state.
That would be less efficient than solving for multiple states at once
because of the way the integrators interpolate.
> Is "solution operator" the right name to give this thing? Does the community give this a name? Google isn't showing anything useful -- it shows hits related to linear differential operators.
It's not *a* solution operator, because in some cases, I believe
you still do have an ODE in there.
> If I understand a solution operator, it should have a function signature like this:
> vector solution_operator(real t0, vector state0, real t) {
> ... // return a vector the same size as state0
> }
> And what you want to do with this is feed this into an event handler. So what function signature does the event handler have? It would help if this were more clearly defined. (If we had global scope or some way of currying arguments, we could call integrate_ode_*() inside there; for now, we can augment that with roughly the same signature as integrate_ode_*() with the parameters and data and we'd be able to move forward).
>
> For the event handler, is there a real desire to use different solution operators between different times? (It was mentioned in our meeting.) Is there any real use case for that? How would you specify it? If we don't have that requirement, this would be a lot easier.
>
> It helps to have concrete language examples / prototypes. It helps me understand what you're trying to do. If you can provide that for:
> - solution operators
> - event handling
> - DAEs
> I would have some hope of catching up and providing additional information.
>
> Is there any concern with misspecification of the solution operator?
What I'm missing here is how the system is specified in such a way that
it'll work with analytical, numerical-analytical, and numerical-stepwise
solutions.
> What is an "event handler"? Does it just handle the event times? Does it do more? Why does it need a solution operator? I can't tell if an event operator requires a solution operator in order or if the event handler and a solution operator could be used in tandem. And if it's a design decision, why is it described the first way?
I think they mean this to be like NONMEM's notion of "event", so
I believe that encompasses:
* drug inputs
- state delta ("bolus" for PK/PD), with rate and compartment
- state continuous input (output?) ("infusion" for PK/PD), with rate and compartment
- 1st order abs (from PMXStan, no idea what this is)
The problem I have is that I don't really understand NONMEM's
notion of event or how the solutions work when there's not an
explicit numerical integration of an ODE system.
* desired solutions
- states and times (not necessarily every state in system)
- steady state (is this related to matrix exponentials?)
Sebastian mentioned we don't need derivatives with respect to solutions
if the solutions aren't used (that is, only one component of the state
might be used in the likelihood).
Another thing I didn't understand was how the system was going to be specified
if not as an ODE system. Do we have a fixed number of named systems that
we have explicit solvers for? What about these matrix exponential things
that somehow provide alternative solutions---is that just steady state?
Maybe the PMXStan package from Novartis corporate would shed some light?
http://andrewgelman.com/wp-content/uploads/2015/10/poster_PMXstan_ACoP2015_30Sep2015.pdf
- Bob