fitBeeGUTS {BeeGUTS}R Documentation

Fit a GUTS model for bees survival analysis using Bayesian Inference (stan)

Description

The function fitBeeGUTS estimates the parameters of a GUTS model for the stochastic death (SD) or individual tolerance (IT) death mechanisms for survival analysis using Bayesian inference.

Usage

fitBeeGUTS(
  data,
  modelType = NULL,
  distribution = "loglogistic",
  priorsList = NULL,
  parallel = TRUE,
  nCores = parallel::detectCores() - 1L,
  nChains = 3,
  nIter = 2000,
  nWarmup = floor(nIter/2),
  thin = 1,
  adaptDelta = 0.95,
  odeIntegrator = "rk45",
  relTol = 1e-08,
  absTol = 1e-08,
  maxSteps = 1000,
  ...
)

Arguments

data

An object of class beeSurvData

modelType

A model type between "SD" for Stochastic Death and "IT" for Individual Tolerance.

distribution

A distribution for the IT death mechanism. To be chosen between "loglogistic" and "lognormal". Default is "loglogistic"

priorsList

A list containing the prior distribution for the parameter considered. By default, when no priors are provided (default is NULL), priors are set automatically based on the experimental design (adapted from Delignette-Muller et al 2017)

parallel

Logical indicating whether parallel computing should be used or not. Default is TRUE

nCores

A positive integer specifying the number of cores to use. Default is one core less than maximum number of cores available

nChains

A positive integer specifying the number of MCMC chains to run. Default is 3.

nIter

A positive integer specifying the number of iteration to monitor for each MCMC chain. Default is 2000

nWarmup

A positive integer specifying the number of warmup iteration per chain. Default is half the number of iteration

thin

A positive integer specifying the interval between the iterations to monitor. Default is 1 (all iterations are monitored)

adaptDelta

A double, bounded between 0 and 1 and controlling part of the sampling algorithms. See the control in the function stan rstan::stan() of the package rstan. The default is 0.95.

odeIntegrator

A string specifying the integrator used to solve the system of differential equations (ODE) in the stan module. To be chosen between "rk45" and "bdf". Default is "rk45".

relTol

A double, bounded between 0 and 1 and controlling the relative tolerance of the accuracy of the solutions generated by the integrator. A smaller tolerance produces more accurate solution at the expanse of the computing time. Default is 1e-8

absTol

A double, bounded between 0 and 1 and controlling the absolute tolerance of the accuracy of the solutions generated by the integrator. A smaller tolerance produces more accurate solution at the expanse of the computing time. Default is 1e-8

maxSteps

A double controlling the maximum number of steps that can be taken before stopping a runaway simulation. Default is 1000

...

Additional parameters to be passed to sampling from stan

Details

The automated prior determination is modified from Delignette-Muller et al. by considering that the minimal concentration for the prior can be close to 0 (1e-6) whereas the original paper considered the lowest non-zero concentration. Similarly, the minimal kd considered for the prior calculation was reduced to allow more chance to capture slow kinetics.

Value

The function fitBeeGUTS returns the parameter estimates of the General Unified Threshold model of Survival (GUTS) in an object of class beeSurvFit. This object is a list composed of the following:

stanFit

An object of S4 class stanfit. More information is available in the package rstan.

data

The data object provided as argument of the function

dataFit

A list of data passed to the Stan model object

setupMCMC

A list containing the setup used for the MCMC chains

modelType

A character vector specifying the type of GUTS model used between SD and IT

distribution

A character vector specifying the type of distribution used in case IT was used; NA otherwise

messages

A character vector containing warning messages

References

Delignette-Muller, M.L., Ruiz P. and Veber P. (2017). Robust fit of toxicokinetic-toxicodynamic models using prior knowledge contained in the design of survival toxicity tests. doi:10.1021/acs.est.6b05326

Examples


data(betacyfluthrinChronic)
fit <- fitBeeGUTS(betacyfluthrinChronic, modelType = "SD", nIter = 1000, nCores = 2)


[Package BeeGUTS version 1.1.3 Index]