Draws kinetic parameter vectors from the prior, simulates the mechanistic trajectory, evaluates a censoring-aware discrepancy, and retains the lowest-discrepancy candidates.
Usage
mbmm_abc_fit(
id,
obs,
simulate_fn,
prior_sample_fn,
n_draws = 10000,
n_keep = NULL,
accept_frac = 0.025,
distance_fn = NULL,
seed = NULL,
failure = c("discard", "error")
)Arguments
- id
Subject identifier.
- obs
Subject observation data.frame containing
timeandy, and optionallycensoredandlod.- simulate_fn
Function with signature
simulate_fn(theta_row, times).- prior_sample_fn
Function with signature
prior_sample_fn(n)returning a data.frame.- n_draws
Number of prior draws.
- n_keep
Optional number of particles to retain.
- accept_frac
Optional fraction of valid draws to retain. Used when
n_keep = NULL.- distance_fn
Optional custom function with signature
distance_fn(theta_row, obs, pred).- seed
Optional random seed.
- failure
Either
"discard"or"error". With"discard", failed simulations receive infinite discrepancy.