Longitudinal Adherence Trajectory modeling and simulation. Pre-computed parameter calibration and Monte Carlo simulation for healthcare adherence modeling.
Exhaustive parameter grid across 5 screening intervals
Sub-10ms lookup for matching LAT parameters by target adherence
Logistic growth + Hill decay simulation with seeded RNG
Single-patient timelines with step-by-step adherence probabilities
Find LAT parameter sets matching a target adherence rate from the pre-computed database. Returns ranked results with subpopulation breakdown and age-stratified stats.
| Parameter | Type | Description |
|---|---|---|
screening_interval required | integer | Years between screenings: 1, 2, 3, 5, or 10 |
target_adherence required | float | Target adherence rate (0.0 - 1.0) |
tolerance optional | float | Search tolerance band (default: 0.01) |
constraints optional | object | max_never_screener, min_always_screener |
sort_by optional | string | adherence_distance | never_screener | always_screener |
limit optional | integer | Max results (default: 20) |
curl -X POST http://localhost:3000/api/calibrate \ -H "Content-Type: application/json" \ -d '{ "screening_interval": 3, "target_adherence": 0.65, "tolerance": 0.02, "limit": 5 }'
// 200 OK { "count": 5, "computation_time_ms": 3, "results": [ { "params": { "P_0": 0.12, "P_max": 0.85, "r_g": 0.3, "L": 0.15, "K": 8, "n": 2.5 }, "adherence": { "mean": 0.649, "std": 0.021, "median": 0.652 }, "subpopulations": { "never_screener": 12.3, "always_screener": 28.7, "early_adopter": 34.5, "intermittent": 24.5 }, "age_brackets": { ... } }, ... ] }
Run a Monte Carlo LAT simulation with specified parameters. Returns population-level adherence statistics, subpopulation ratios, and age-stratified results.
| Parameter | Type | Description |
|---|---|---|
P_0 required | float | Initial adherence probability (0-1) |
P_max required | float | Maximum adherence ceiling (0-1) |
r_g required | float | Growth rate (0-5) |
L required | float | Decay floor probability (0-1) |
K required | float | Half-max time for Hill decay (0.1-50) |
n required | float | Hill coefficient / cooperativity (0.1-10) |
screening_interval optional | integer | Years between screenings (default: 3) |
population_size optional | integer | Number of individuals (default: 1000, max: 10000) |
curl -X POST http://localhost:3000/api/simulate \ -H "Content-Type: application/json" \ -d '{ "P_0": 0.12, "P_max": 0.85, "r_g": 0.3, "L": 0.15, "K": 8, "n": 2.5, "screening_interval": 3, "population_size": 1000 }'
// 200 OK { "adherence": { "mean": 0.649, "std": 0.023, "median": 0.652, "ci_lower": 0.604, "ci_upper": 0.694 }, "subpopulations": { ... }, "age_brackets": { ... }, "computation_time_ms": 45 }
Generate a single patient trajectory for visualization. Returns step-by-step adherence probabilities, screening decisions, and a summary with adherence rate.
| Parameter | Type | Description |
|---|---|---|
P_0 ... n required | float | Same 6 LAT parameters as /api/simulate |
screening_interval optional | integer | Years between screenings (default: 3) |
seed optional | string | RNG seed for reproducible trajectories |
curl -X POST http://localhost:3000/api/trajectory \ -H "Content-Type: application/json" \ -d '{ "P_0": 0.12, "P_max": 0.85, "r_g": 0.3, "L": 0.15, "K": 8, "n": 2.5, "screening_interval": 3, "seed": "patient_42" }'
// 200 OK { "steps": [ { "age": 45, "probability": 0.12, "screened": false, "phase": "growth" }, { "age": 48, "probability": 0.34, "screened": true, "phase": "growth" }, ... ], "summary": { "adherence_rate": 0.6, "screenings": 6, "opportunities": 10 } }
API info and available endpoints.
Health check. Returns { status: "ok" }.
All API endpoints require an API key. Include it in every request:
curl -X POST http://localhost:3000/api/calibrate \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ ... }'
Response headers include X-RateLimit-Limit,
X-RateLimit-Remaining, and
X-RateLimit-Reset.
Create a free account to get your API key. Manage keys, track usage, and upgrade your plan from your dashboard.
5 free API calls per month. No credit card required.