Skip to content

Derivative w.r.t lag times #3

@charlesm93

Description

@charlesm93

Summary:

A bolus dosing event causes a discontinuity in amounts w.r.t time. This leads to potential issues with NUTS because the gradient of the log posterior cannot be properly computed.

Description:

A bolus dosing event causes a discontinuity in X (the returned matrix that contains drug amounts) w.r.t time and time-dependent parameters. This is problematic when we try to estimate lag times. Consider a bolus dosing at time t = 0 with amt = 1000 and cmt = 1. The derivatives of X w.r.t t or tlag 1 at t = 0 is ill-defined because the function is discontinuous.

This issue propagates to all events and all compartments (I'm not sure why the latter happens). I have not yet tested derivatives with respect to time.

Reproducible Steps:

One can observe this issue with the unit test prim/PKModelOneCpt_test.cpp by setting discontinuous = false in util_torsten.hpp before the if (discontinuous == false) statement, line 131.

Current Output:

The unit tests do not check derivatives at discontinuous points. They do not compute derivatives w.r.t lag times in dosing compartments. We need to figure out how this impacts NUTS. We may need to revise our algorithm.

Current Version:

Stan v2.13.1
Torsten v0.82 - beta

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions