A Laplace library of parametric nonlinear functions for pharmacokinetics, dose-response modeling, and growth/decay processes — ready to import into any .laplace model with namespaced calls (kinetics::function_name(...)).
Like all Laplace libraries, kinetics compiles down to plain, readable Stan functions. Nothing about how you use it hides what actually ends up in your .stan file.
Parametric functions for dose-response modeling, pharmacological effect and inhibition models, receptor binding and cooperativity, and biological assay calibration.
| Function | Description |
|---|---|
emax(E0, Emax, x, EC50) |
Parametric Emax dose-response: |
sigmoid_emax(E0, Emax, x, EC50, h) |
Sigmoid Emax / Hill: |
four_pl(d, a, x, b, c) |
Four-parameter logistic: |
imax(E0, Imax, x, IC50) |
Parametric Imax inhibitory response: |
inhibitory_emax(E0, Imax, x, IC50, h) |
Sigmoid inhibitory Emax: |
logistic_dose_response(L, U, x, k, xo) |
Logistic dose-response: |
hill(x, n, K) |
Hill equation for binding/cooperativity: |
Functions for biological/population growth, pharmacokinetic elimination, decay processes, organismal growth, and multi-phase exponential processes.
| Function | Description |
|---|---|
exponential_growth(A, k, x) |
Exponential growth: |
exponential_decay(A, k, x) |
Exponential decay: |
logistic_growth(K, A, r, x) |
Logistic growth: |
gompertz(A, B, k, x) |
Gompertz growth: |
von_bertalanffy(Linf, B, k, t) |
Von Bertalanffy growth: |
biexponential(A, B, k1, k2, t) |
Biexponential decay: |
Closed-form deterministic functions for one- and two-compartment PK models, IV bolus and infusion, first-order absorption, extravascular dosing, and Bateman kinetics.
| Function | Description |
|---|---|
one_comp_iv_bolus(D, V, k, t) |
One-compartment IV bolus: |
one_comp_iv_infusion(R0, V, k, t) |
One-compartment IV infusion: |
one_comp_iv_post_infusion(R0, V, k, T, t) |
One-compartment IV post-infusion: |
two_comp_iv_bolus(A, B, alpha, beta, t) |
Two-compartment IV bolus: |
bateman(F, D, V, ka, k, t) |
Bateman function (first-order absorption + elimination): |
first_order_absorption(D, ka, t) |
First-order absorption: |
kinetics is distributed as a git-hosted Laplace library — there's no published registry entry yet, so it's added by pointing laplace (or cmdlaplacer, if you're working from R) directly at the repository.
From inside a Laplace project (a directory with its own laplace.toml):
laplace add kinetics --git https://github.com/mlatinov/laplace-kinetics --tag 0.1.0
library(cmdlaplacer)
laplace_install_git(
"kinetics",
"https://github.com/mlatinov/laplace-kinetics",
tag = "0.1.0"
)Either way, this pins the dependency in your project's laplace.toml/laplace.lock at tag 0.1.0. Check the releases for newer tags as they become available.
Import the library and call its functions with the kinetics:: namespace prefix:
library {
kinetics;
}
model {
mu = kinetics::emax(E0, Emax, x, EC50);
// ...
}
See LICENSE.