---
title: "K-PD Models: Kinetics of Drug Action Without PK Data"
execute:
  cache: true
  error: false
engine: julia
author:
  - Vijay Ivaturi
format:
  html:
    include-in-header:
      text: |
        <style>
          .header-container {
            width: 100%;
          }
          .logo {
            display: block;
            width: 150px;
            margin-left: -2.5%;
          }
        </style>
        <link rel = "shortcut icon" href = "https://pumas.ai/favicon.ico" />
    include-before-body:
      text: |
        <div class="header-container">
          <img src="https://pumas-assets.s3.amazonaws.com/CompanyLogos/PumasAI/RGB/PNG/Pumas+AI+Primary%404x.png" alt="Pumas Logo" class="logo">
        </div>
    self-contained-math: true
    html-math-method: katex
    anchor-sections: true
    theme: default
    toc: true
    toc-depth: 4
    toc-expand: 2
    toc-location: left
    toc-title: Contents
    number-sections: true
    code-summary: Show/Hide Code
fig-format: svg
fig-width: 8
fig-height: 6
license: CC BY-SA 4.0
bibliography: references.bib
mermaid:
  theme: neutral
---

```{julia}
#| echo: false
#| output: false
using Pumas
using PumasUtilities
using PumasPlots
using CairoMakie
using AlgebraOfGraphics
using DataFrames
using DataFramesMeta
using Random
```

## Learning Objectives

By the end of this tutorial, you will be able to:

  - Understand the K-PD modeling framework and its historical development
  - Model pharmacodynamic responses when PK concentration data is unavailable
  - Apply the virtual compartment approach with EDK50 and KDE parameters
  - Implement K-PD models in Pumas
  - Recognize the limitations and assumptions of the K-PD approach
  - Decide when to use K-PD versus traditional PK-PD modeling

## Introduction

K-PD (Kinetics of Pharmacodynamics) is a modeling methodology for describing
**pharmacodynamic responses without PK concentration data**.
The approach uses a **virtual compartment** to link dose directly to effect,
enabling PD modeling when plasma concentrations are unavailable [@jacqmin2007; @gabrielsson2000].

### Historical Context

The K-PD framework was formally established by Jacqmin and colleagues,
who recognized that many clinical studies collect response data without corresponding
plasma concentration measurements [@jacqmin2007].
Traditional PK-PD modeling requires drug concentrations to drive the effect model,
but the K-PD approach introduces a **virtual compartment** that links dose directly
to response without explicit PK measurements.

Earlier work by Gabrielsson and Jusko demonstrated that dose-response-time data alone
can provide estimates of turnover parameters and system dynamics [@gabrielsson2000].
This approach has been validated across multiple therapeutic areas,
but comes with important limitations regarding study design and drug properties [@gonzalez2017].

```{mermaid}
%%| label: fig-kpd-concept
%%| fig-cap: "K-PD model: Virtual compartment links dose to effect without explicit PK"
flowchart LR
    subgraph Input["Dosing"]
        Dose[Dose]
    end

    subgraph Virtual["Virtual Compartment"]
        A["Drug Amount A(t)"]
    end

    subgraph PD["Pharmacodynamic Model"]
        E["Effect E(t)"]
    end

    Dose -->|Input| A
    A -->|KDE| Elimination["Elimination"]
    A -->|EDK50| E

    style Virtual fill:#e3f2fd
    style PD fill:#fff3e0
```

### When to Use K-PD Models

K-PD models are appropriate when **PK concentration data is unavailable**:

  - Phase I studies with limited sampling
  - Sparse sampling designs where PK collection is impractical
  - Exploratory dose-finding studies
  - Retrospective analysis of response-only data
  - Studies where bioanalytical assays are unavailable

:::{.callout-warning}

## Critical Assumption

K-PD modeling assumes **linear (first-order) drug elimination**.
The approach is **not valid** for drugs with nonlinear (Michaelis-Menten) pharmacokinetics [@gonzalez2017].
:::

:::{.callout-note}

## K-PD vs Traditional PK-PD

**Traditional PK-PD**: Requires plasma concentration measurements to drive the effect model.

**K-PD**: Uses a virtual compartment with dose as input; no concentration measurements needed.
The trade-off is that K-PD cannot predict concentrations or separate PK from PD variability.
:::

## The K-PD Virtual Compartment Approach

When PK concentration data is unavailable, the K-PD approach uses a **virtual compartment**
to represent drug kinetics. Instead of measuring actual plasma concentrations,
the model uses dose and time to infer a driving function for the PD model [@jacqmin2007].

### Key Parameters

The K-PD model introduces two fundamental parameters that replace traditional PK parameters:

$$
\text{KDE} = \frac{CL}{V}
$$

$$
\text{EDK50} = EC_{50} \times CL
$$

Where:

| Parameter | Description                                                            | Units         |
|:--------- |:---------------------------------------------------------------------- |:------------- |
| **KDE**   | Elimination rate constant from virtual compartment (= $CL/V$)          | 1/time        |
| **EDK50** | Apparent in vivo potency; infusion rate producing 50% effect at steady | amount/time   |
| **EC50**  | Concentration producing 50% of maximum effect                          | concentration |
| **CL**    | Clearance (not directly estimated)                                     | volume/time   |
| **V**     | Volume of distribution (not directly estimated)                        | volume        |

:::{.callout-tip}

## Interpreting EDK50

EDK50 represents the **infusion rate** that would produce 50% of the maximum effect at steady state.
Unlike EC50 (a concentration), EDK50 is directly related to dosing rate and can guide dose selection
even without knowing absolute concentrations.
:::

### Virtual Compartment Dynamics

The virtual compartment follows first-order kinetics:

$$
\frac{dA}{dt} = \text{Input}(t) - \text{KDE} \cdot A
$$

For an Emax model, the effect becomes:

$$
E = E_0 + \frac{E_{max} \cdot A \cdot \text{KDE}}{EDK50 + A \cdot \text{KDE}}
$$

At steady state infusion:

$$
A_{ss} \cdot KDE = \text{Infusion Rate}
$$

So when Infusion Rate = EDK50:

$$
E = E_0 + \frac{E_{max}}{2}
$$

### K-PD Model Without PK Measurements

```{julia}
kpd_virtual_model = @model begin
    @metadata begin
        desc = "K-PD Model: Virtual Compartment Without PK Measurements"
        timeu = u"hr"
    end

    @param begin
        """
        Elimination rate constant from virtual compartment (1/hr)
        """
        pop_KDE ∈ RealDomain(; lower = 0, init = 0.1)
        """
        Apparent potency - infusion rate producing 50% effect (mg/hr)
        """
        pop_EDK50 ∈ RealDomain(; lower = 0, init = 10.0)
        """
        Baseline effect
        """
        pop_E0 ∈ RealDomain(; lower = 0, init = 100.0)
        """
        Maximum effect
        """
        pop_Emax ∈ RealDomain(; init = 50.0)

        # Random effects
        Ω_pd ∈ PDiagDomain(2)
        σ_add ∈ RealDomain(; lower = 0, init = 5.0)
    end

    @random begin
        η_pd ~ MvNormal(Ω_pd)
    end

    @pre begin
        KDE = pop_KDE * exp(η_pd[1])
        EDK50 = pop_EDK50 * exp(η_pd[2])
        E0 = pop_E0
        Emax = pop_Emax
    end

    @init begin
        # Virtual compartment starts empty
        A = 0.0
    end

    @dynamics begin
        # Virtual compartment - first-order elimination
        # Ka is assumed very fast (instant absorption) for simplicity
        A' = -KDE * A
    end

    @vars begin
        # Rate out of virtual compartment
        rate_out = KDE * A
        # Effect using Emax model driven by rate
        Effect = E0 + Emax * rate_out / (EDK50 + rate_out)
    end

    @derived begin
        effect ~ @. Normal(Effect, σ_add)
    end
end
```

### Demonstration: K-PD Without Concentrations

Let's simulate a scenario where we only have PD measurements:

```{julia}
#| label: fig-kpd-virtual
#| fig-cap: "K-PD virtual compartment approach: modeling effect without concentration data"

# K-PD parameters (without explicit PK)
params_virtual = (
    pop_KDE = 0.2,     # Elimination rate: ~3.5 hr half-life
    pop_EDK50 = 5.0,   # Infusion rate producing 50% effect
    pop_E0 = 100.0,
    pop_Emax = -80.0,  # Inhibitory effect
    Ω_pd = Diagonal([0.0, 0.0]),
    σ_add = 0.0,
)

# Single dose administered to depot (virtual compartment with Ka)
dosing_virtual = DosageRegimen(100, time = 0, cmt = 1)
subject_virtual = Subject(id = 1, events = dosing_virtual)

# Simulate
sim_virtual = simobs(
    kpd_virtual_model,
    subject_virtual,
    params_virtual,
    obstimes = 0:0.5:48,
    simulate_error = false,
)

# Create plot
virtual_df = DataFrame(sim_virtual)

fig = Figure(size = (700, 400))
ax = Axis(
    fig[1, 1],
    xlabel = "Time (hr)",
    ylabel = "Effect",
    title = "K-PD Model: Effect Predicted from Dose (No Concentration Data)",
)
lines!(ax, virtual_df.time, virtual_df.Effect, linewidth = 2, color = :coral)
hlines!(ax, [100 - 80 / 2], linestyle = :dash, color = :gray, label = "50% Effect")
text!(ax, 25, 65, text = "Effect at EDK50", fontsize = 11)

fig
```

:::{.callout-note}

## Key Insight

The K-PD model describes the time course of effect using only:

  - Dose and dosing schedule
  - KDE (apparent elimination rate)
  - EDK50 (apparent potency)
  - PD parameters (E0, Emax)

**No plasma concentrations are needed!**
:::

## Limitations and Assumptions

The K-PD approach, while powerful, comes with important limitations that must be considered
before applying it to a given dataset [@jacqmin2007; @gonzalez2017].

### Critical Assumptions

:::{.callout-warning}

## Assumption 1: Linear Pharmacokinetics

K-PD is **only valid for drugs with linear (first-order) elimination**.
For drugs with nonlinear (Michaelis-Menten) elimination,
parameter estimates (KDE, EDK50) will be biased,
predictions at different doses will be unreliable,
and traditional PK-PD modeling should be used instead [@gonzalez2017].
:::

:::{.callout-warning}

## Assumption 2: Identifiability

K-PD parameters are only identifiable under specific conditions.
A **wide dose range** with at least 3-4 different dose levels is recommended.
**Multiple time points** with minimum 4 PD samples per subject are needed [@gonzalez2017].
Both onset and offset of effect should be captured for **adequate response** characterization.
:::

### Known Limitations

| Limitation                  | Description                                                                  | Mitigation                                |
|:--------------------------- |:---------------------------------------------------------------------------- |:----------------------------------------- |
| **IIV overestimation**      | Total inter-individual variability is always overestimated in K-PD           | Account for this in interpretation        |
| **No PK predictions**       | Cannot predict concentrations or exposure metrics (AUC, Cmax)                | Use PK-PD if concentration data exists    |
| **Dose proportionality**    | Assumes linear PK; deviations from dose proportionality invalidate the model | Verify linearity before applying K-PD     |
| **Absorption variability**  | Cannot separate absorption from distribution variability                     | Use sparse PK sampling if possible        |
| **Bioavailability changes** | Changes in F between formulations or foods will alter apparent EDK50         | Conduct dedicated bioavailability studies |

### Study Design Considerations

Based on the methodological literature [@jacqmin2007; @gabrielsson2000; @gonzalez2017]:

**Minimum Requirements:**

 1. At least **3-4 dose levels** spanning the expected therapeutic range
 2. Minimum of **4 PD observations per subject** capturing effect time course
 3. **Wide dose range** to ensure identifiability of EDK50

**Improved Designs:**

 1. **Multiple routes of administration** improve parameter identifiability
 2. **Multiple dosing** (not just single dose) strengthens inference
 3. **Design points matter more than sample size** - strategic timing improves precision

:::{.callout-tip}

## When to Collect PK Data Instead

If your study can collect even **1 PK sample plus 2 PD samples**,
this may provide better parameter estimates than K-PD with 3 PD samples alone [@gonzalez2017].
Consider sparse PK sampling as an alternative to pure K-PD modeling.
:::

## K-PD vs PK-PD: Choosing the Right Approach

The decision between K-PD and traditional PK-PD modeling depends on
data availability, drug properties, and study objectives.

### Decision Framework

```{mermaid}
%%| label: fig-kpd-decision
%%| fig-cap: "Decision tree for choosing between K-PD and PK-PD modeling"
flowchart TD
    A[Do you have concentration data?] -->|Yes| B[Use PK-PD Modeling]
    A -->|No| C[Is elimination linear?]
    C -->|Yes| D["Are there ≥4 PD samples?"]
    C -->|No| E["K-PD NOT valid - Need PK data"]
    D -->|Yes| F[Is there a wide dose range?]
    D -->|No| G["Consider sparse PK sampling"]
    F -->|Yes| H[K-PD is appropriate]
    F -->|No| I["K-PD may have identifiability issues"]

    style B fill:#c8e6c9
    style H fill:#c8e6c9
    style E fill:#ffcdd2
    style I fill:#fff9c4
```

### Comparison Table

| Criterion                    | K-PD Modeling                       | PK-PD Modeling                 |
|:---------------------------- |:----------------------------------- |:------------------------------ |
| **Data required**            | Dose + PD response only             | Concentration + PD response    |
| **Parameters**               | KDE, EDK50 (composite)              | CL, V, EC50 (separable)        |
| **Concentration prediction** | Not possible                        | Yes                            |
| **Exposure metrics**         | Cannot calculate AUC, Cmax directly | Full exposure characterization |
| **Nonlinear PK**             | Invalid                             | Valid with appropriate model   |
| **IIV partitioning**         | Combined PK+PD variability          | Separate PK and PD variability |
| **Dose optimization**        | Limited (EDK50-based)               | Exposure-based optimization    |
| **Regulatory acceptance**    | Limited; exploratory use            | Standard for registration      |

### Recommendations by Scenario

**Use K-PD when:**

  - Concentration measurements are not feasible
  - Exploratory dose-finding studies
  - Retrospective analysis of response-only data
  - Phase 0/Phase I studies with PD-only endpoints
  - Drug has very short half-life making PK sampling impractical

**Use PK-PD when:**

  - Any concentration data is available (even sparse)
  - Regulatory submissions are planned
  - Nonlinear PK is suspected
  - Precise exposure-response characterization is needed
  - Dose optimization across populations is required

:::{.callout-note}

## Best Practice

When possible, design studies to collect at least sparse PK data.
Even 1-2 concentration samples per subject can significantly improve
parameter estimation compared to pure K-PD analysis [@gonzalez2017].
:::

## Summary

In this tutorial, we covered:

 1. **K-PD definition**: A methodology for modeling PD responses without PK concentration data
 2. **Virtual compartment approach**: Using KDE and EDK50 parameters when concentration
    data is unavailable [@jacqmin2007]
 3. **Key parameters**: KDE (apparent elimination rate constant) and EDK50 (apparent potency)
 4. **Limitations**: Linear PK assumption, identifiability requirements,
    IIV overestimation [@gonzalez2017]
 5. **Study design**: Minimum requirements for reliable K-PD modeling

### Key Takeaways

  - K-PD enables PD modeling when concentration data is unavailable
  - EDK50 represents the infusion rate producing 50% effect at steady state
  - K-PD is **only valid for drugs with linear elimination**
  - Minimum 4 PD samples and wide dose range needed for reliable K-PD
  - When possible, collect sparse PK data for improved parameter estimation

### When to Use K-PD

  - PK concentration data is unavailable or impractical to collect
  - Drug elimination follows first-order kinetics
  - Exploratory dose-finding studies
  - Retrospective analysis of response-only data

### When NOT to Use K-PD

  - Drug has nonlinear (Michaelis-Menten) elimination
  - Concentration data is available (use PK-PD instead)
  - Regulatory submissions require exposure-response characterization
  - Fewer than 4 PD samples per subject
  - Narrow dose range in study design

### Next Steps

For guidance on choosing between model types:
See [Model Selection Tutorial](05-model-selection.qmd)
