Skip to contents

Simulate from posterior or prior draws using PKPDsim::sim()

Usage

sim_from_draws(
  post,
  model,
  map = NULL,
  prior = FALSE,
  n = NULL,
  variable = "y",
  summarize = FALSE,
  ci = c(0.05, 0.95),
  ...
)

Arguments

post

posterior object from get_mcmc_posterior()

model

PKPDsim model function

map

list with parameter name remapping between Stan model and PKPDsim model.

prior

simulate from prior (TRUE) or posterior (FALSE)

n

number of parameter draws / simulations to do. A value of NULL indicates all draws should be used.

variable

use a variable from the simulated data, defaults to y.

summarize

should data be summarized to median and confidence interval? Defaults to FALSE, i.e. to return all simulated observations from parameter draws.

ci

confidence interval to use when summary=TRUE.

...

arguments passed on to PKPDsim::sim