fitPBK {rPBK}R Documentation

Bayesian inference of TK model with Stan

Description

Bayesian inference of TK model with Stan

Usage

fitPBK(stanPBKdata, ...)

## S3 method for class 'stanPBKdata'
fitPBK(stanPBKdata, ...)

Arguments

stanPBKdata

List of Data require for computing

...

Arguments passed to rstan::sampling (e.g. iter, chains).

Value

An object of class fitPBK containing two object: stanPBKdata the data set used for inference and stanfit returned by rstan::sampling

Examples

# (1) load data file
data("dataCompartment4")
# (2) prepare data set
dataPBK_C4 <- dataPBK(
  object = dataCompartment4,
  col_time = "temps",
  col_replicate = "replicat",
  col_exposure = "condition",
  col_compartment = c("intestin", "reste", "caecum", "cephalon"),
  time_accumulation = 7)
# (3) run Bayesian fitting: <5 sec to be executed
# 1 chain and 10 iterations is fast to run but provide
# bad goodness-of-fit
fitPBK_C4_FASTbadGOF <- fitPBK(dataPBK_C4, chains = 1, iter = 10)

  # (3) run Bayesian fitting: > 5 sec to be executed
  # 4 chains and 2000 iterations provides better estimates
  fitPBK_C4 <- fitPBK(dataPBK_C4, chains = 4, iter = 2000)



[Package rPBK version 0.2.4 Index]