Title: | General Unified Threshold Model of Survival for Bees using Bayesian Inference |
---|---|
Description: | Tools to calibrate, validate, and make predictions with the General Unified Threshold model of Survival adapted for Bee species. The model is presented in the publication from Baas, J., Goussen, B., Miles, M., Preuss, T.G., Roessing, I. (2022) <doi:10.1002/etc.5423> and Baas, J., Goussen, B., Taenzler, V., Roeben, V., Miles, M., Preuss, T.G., van den Berg, S., Roessink, I. (2024) <doi:10.1002/etc.5871>, and is based on the GUTS framework Jager, T., Albert, C., Preuss, T.G. and Ashauer, R. (2011) <doi:10.1021/es103092a>. The authors are grateful to Bayer A.G. for its financial support. |
Authors: | Benoit Goussen [aut, cre] , Liubov Zakharova [ctb], Romoli Carlo [ctb], Bayer AG [cph], ibacon GmbH [cph] |
Maintainer: | Benoit Goussen <[email protected]> |
License: | GPL-3 |
Version: | 1.3.0 |
Built: | 2024-10-24 04:27:50 UTC |
Source: | CRAN |
Provide tools to analyse the survival toxicity tests performed for bee species. It can be used to fit a Toxicokinetic-Toxicodynamic (TKTD) model adapted for bee standard studies (acute oral, acute contact, and chronic oral studies). The TKTD model used is the General Unified Threshold model of Survival (GUTS).
The package follows the concept and assumptions presented in Baas et al. (2022)
Baas, J., Goussen, B., Taenzler, V., Roeben, V., Miles, M., Preuss, T.G., van den Berg, S. and Roessink, I. (2024), Comparing Sensitivity of Different Bee Species to Pesticides: A TKTD modeling approach. Environ Toxicol Chem, 43: 1431-1441. doi:10.1002/etc.5871
Baas, J., Goussen, B., Miles, M., Preuss, T.G., Roessing, I. (2022). BeeGUTS—A Toxicokinetic–Toxicodynamic Model for the Interpretation and Integration of Acute and Chronic Honey Bee Tests. doi:10.1002/etc.5423
Jager, T., Albert, C., Preuss, T.G. and Ashauer, R. (2011). General Unified Threshold model of Survival - a toxicokinetic-toxicodynamic framework for ecotoxicology. doi:10.1021/es103092a
Jager, T. and Ashauer, R. (2018). Modelling survival under chemical stress. A comprehensive guide to the GUTS framework. Version 1.0 https://leanpub.com/guts_book
EFSA PPR Scientific Opinion (2018). Scientific Opinion on the state of the art of Toxicokinetic/Toxicodynamic (TKTD) effect models for regulatory risk assessment of pesticides for aquatic organisms. https://www.efsa.europa.eu/en/efsajournal/pub/5377
EFSA (European Food Safety Authority), Adriaanse P, Arce A, Focks A, Ingels B, Jölli D, Lambin S, Rundlöf M, Süßenbach D, Del Aguila M, Ercolano V, Ferilli F, Ippolito A, Szentes Cs, Neri FM, Padovani L, Rortais A, Wassenberg J and Auteri D, (2023). Revised guidance on the risk assessment of plant protection products on bees (Apis mellifera, Bombus spp. and solitary bees). EFSA Journal doi:10.2903/j.efsa.2023.7989
Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org
Survival datasets for Honey bees exposed to constant concentration of Betacyfluthrin for 10 days.
data(betacyfluthrinChronic)
data(betacyfluthrinChronic)
A list of class beeSurvData
constructed by dataGUTS
containing:
nDatasets
An integer representing the number of datasets used.
survData
A data frame containing the survival information over time for five treatments and a control in a wide format.
survData_long
A data frame containing the survival information over time for five treatments and a control in a long format.
concData
A data frame containing the concentration information over time for five treatments and a control in a wide format.
concData_long
A data frame containing the concentration information over time for five treatments and a control in a long format.
unitData
A character string containing the units of the concentration data.
typeData
A character string containing the type of data (here Chronic_Oral).
beeSpecies
A character string containing the species of bee of interest (here Honey_Bee).
concModel
A data frame containing the concentration information recalculated for the species of bee and test type of interest in a wide format.
concModel_long
A data frame containing the concentration information recalculated for the species of bee and test type of interest in a long format.
messages
A data frame containing the warning messages returned by the function.
Bayer data.
Recalculate the concentrations for the acute contact tests for bees
concAC(cExt, expTime, k_ca = 0.4, ...)
concAC(cExt, expTime, k_ca = 0.4, ...)
cExt |
The concentration applied |
expTime |
The duration of the experiment in days |
k_ca |
Contact availability rate (d-1), default is 0.4 |
... |
Not used |
A data frame containing a column with the time points and a column with the recalculated concentrations
conc <- concAC(cbind(3.1, 4, 6, 8), 4)
conc <- concAC(cbind(3.1, 4, 6, 8), 4)
Recalculate concentration for the acute oral tests for bees
concAO(cExt, cTime = 0.25, expTime, k_sr = 0.625, ...)
concAO(cExt, cTime = 0.25, expTime, k_sr = 0.625, ...)
cExt |
A dataframe of concentrations at time 0 concentration applied |
cTime |
The duration of exposure in days, default is 0.25 d |
expTime |
The duration of the experiment in days |
k_sr |
Stomach release rate (d-1), default is 0.625 |
... |
Not used |
A data frame containing a column with the time points and a column with the recalculated concentrations
conc <- concAO(cExt = cbind(3.5, 6, 8, 10), cTime = 0.25, expTime = 4)
conc <- concAO(cExt = cbind(3.5, 6, 8, 10), cTime = 0.25, expTime = 4)
g/beeRecalculate the concentrations for the chronic oral tests for bees from
mg a.s./kg feed to g/bee
concCst(cExt, f_rate = c(25), targConc = 1, cstConcCal = TRUE, ...)
concCst(cExt, f_rate = c(25), targConc = 1, cstConcCal = TRUE, ...)
cExt |
The concentration dataframe in mg a.s./kg feed |
f_rate |
A vector containing the feeding rates of the bees in mg/bee/day. If the vector is of size 1, the same feeding rate is used for all test conditions. If the vector is of size >1, it should be of the same size as the number of condition and one feeding rate must be provided per condition. Default is 25 mg/bee/day |
targConc |
A numerical scalar representing the unit of the target concentration amongst (default = 1)
|
cstConcCal |
Logical. Indicate if concentrations should be recalculated from mg a.s./kg feed to Xg/bee |
... |
Not used |
A data frame containing a column with the time points and a column with the recalculated concentrations
cExt <- data.frame(SurvivalTime = c(0,10), Control = c(0,0), T1 = c(1, 1), T2 = c(5, 5), Dataset = c(1, 1)) conc <- concCst(cExt, targConc = 2)
cExt <- data.frame(SurvivalTime = c(0,10), Control = c(0,0), T1 = c(1, 1), T2 = c(5, 5), Dataset = c(1, 1)) conc <- concCst(cExt, targConc = 2)
beeSurvFit
objectsIt plots the correlations between the parameters of the GUTS IT or GUTS SD. The plots do not include warmup iterations
correlation_plot(object)
correlation_plot(object)
object |
An object of class |
A graphic with the plot of the correlations between parameters or a a list of graphics in case multiple datasets are present. If a list is returned, the first graphic is the correlation between hb values and the second is the correlation between all other parameters
data(fitBetacyfluthrin_Chronic) correlation_plot(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) correlation_plot(fitBetacyfluthrin_Chronic)
Computes PPC and NRMSE as defined in EFSA 2018
criteriaCheck(x)
criteriaCheck(x)
x |
an object of class |
The function returns a list with three items:
PPC |
The criterion, in percent, compares the predicted median number of survivors associated
to their uncertainty limits with the observed numbers of survivors.
Based on experience, PPC resulting in more than |
NRMSE |
The criterion, in percent, is based on the classical root-mean-square error (RMSE), used to aggregate the magnitudes of the errors in predictions for various time-points into a single measure of predictive power. In order to provide a criterion expressed as a percentage, NRMSE is the normalised RMSE by the mean of the observations. EFSA (2018) recognised that a NRMSE of less than 50% indicates good model performance |
SPPE |
A list with the Survival Probability Prediction Error per dataset and condition. Each dataset is in a sublist. |
@references EFSA PPR Scientific Opinion (2018) Scientific Opinion on the state of the art of Toxicokinetic/Toxicodynamic (TKTD) effect models for regulatory risk assessment of pesticides for aquatic organisms https://www.efsa.europa.eu/en/efsajournal/pub/5377
@example data(fitBetacyfluthrin_Chronic) out <- criteriaCheck(fitBetacyfluthrin_Chronic)
Read data from a text
or csv
file and recalculate the
exposure profile depending on the type of experiment (acute oral, acute contact, chronic oral).
dataGUTS( file_location = NULL, test_type = NULL, bee_species = "Honey_Bee", NA_string = getOption("datatable.na.strings", "NA"), ... )
dataGUTS( file_location = NULL, test_type = NULL, bee_species = "Honey_Bee", NA_string = getOption("datatable.na.strings", "NA"), ... )
file_location |
List of Locations of text files containing each two datasets, one for the survival data, and one for the concentration data. Both datasets must be included in the same file and contain the same number of column in the same order. The following columns must be included in the survival dataset:
A line containing the The following columns must be included in the concentration dataset
For the See detail section for example |
test_type |
list of test types amongst "Acute_Oral", "Acute_Contact", and "Chronic_Oral" this list must have the same length of the list of file locations |
bee_species |
the bee type among "Honey_Bee", "Bumble_Bee", "Osmia_bicornis", and "User_Bee". If "User_Bee" is selected, optional arguments to be passed to the concentration reconstruction need to be defined. |
NA_string |
a character vector of strings which are to be interpreted as NA values |
... |
Optional arguments to be passed to the concentration reconstruction (e.g.
|
The filename must begin with name of the chemical substance being tested and each word of the filename should be separated via an underscore '_'.
#' Example of formatting of the input file for a chronic oral study
Survival time [d] | Control | T1 | T2 | T3 | T4 | T5 |
0 | 120 | 120 | 120 | 120 | 120 | 120 |
1 | 120 | 118 | 117 | 112 | 115 | 94 |
2 | 120 | 118 | 115 | 112 | 98 | 88 |
3 | 120 | 118 | 114 | 106 | 83 | 27 |
4 | 119 | 118 | 113 | 103 | 67 | 9 |
5 | 119 | 118 | 112 | 100 | 43 | 3 |
Concentration unit: ug/bee/day | ||||||
Concentration time [d] | Control | T1 | T2 | T3 | T4 | T5 |
0 | 0 | 3 | 7 | 12 | 41 | 68 |
5 | 0 | 3 | 7 | 12 | 41 | 68 |
An object of class beeSurvData
, which is a list with the following information:
nDatasets |
Number of files passed to the function |
survData |
A table containing the survival data as entered by the user in the input file |
survData_long |
A data frame containing the survival data in long format for model purposes |
concData |
A table containing the concentration data as entered by the user in the input file |
concData_long |
A data frame containing concentration data in long format |
unitData |
A character vector containing the units of the data as entered in the line |
typeData |
A character vector containing the type of experiment |
beeSpecies |
A character vector containing the type bee |
concModel |
A data frame containing the concentration data as recalculated by the model |
concModel_long |
A data frame containing the concentration data as recalculated by the model in a long format |
Each element of the list is itself a list to account for multiple files that can be passed as input.
file_location <- system.file("extdata", "betacyfluthrin_chronic_ug.txt", package = "BeeGUTS") lsData <- dataGUTS(file_location = c(file_location), test_type = c('Chronic_Oral'), bee_species = "Honey_Bee", cstConcCal = FALSE)
file_location <- system.file("extdata", "betacyfluthrin_chronic_ug.txt", package = "BeeGUTS") lsData <- dataGUTS(file_location = c(file_location), test_type = c('Chronic_Oral'), bee_species = "Honey_Bee", cstConcCal = FALSE)
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.
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, ... )
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, ... )
data |
An object of class |
modelType |
A model type between |
distribution |
A distribution for the IT death mechanism. To be chosen between
|
priorsList |
A list containing the prior distribution for the parameter considered.
By default, when no priors are provided (default is |
parallel |
Logical indicating whether parallel computing should be used or not. Default is |
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 |
odeIntegrator |
A string specifying the integrator used to solve the system of
differential equations (ODE) in the |
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 |
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.
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 |
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
|
distribution |
A character vector specifying the type of distribution used in case |
messages |
A character vector containing warning messages |
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
data(betacyfluthrinChronic) fit <- fitBeeGUTS(betacyfluthrinChronic, modelType = "SD", nIter = 1000, nCores = 2)
data(betacyfluthrinChronic) fit <- fitBeeGUTS(betacyfluthrinChronic, modelType = "SD", nIter = 1000, nCores = 2)
Model calibration results datasets for Honey bees exposed to constant concentration of Betacyfluthrin for 10 days.
data(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic)
A list of class beeSurvFit
constructed by fitBeeGUTS
containing:
stanFit
A 'stanfit' object containing the results of the calibration.
data
A 'beeSurvData' objects with the user data used for the calibration.
dataFit
A list containing the priors and data formatted for the calibration algorithm.
setupMCMC
A list containing the setup used for the MCMC.
modelType
A character string containing the type of GUTS model used (here 'SD').
distribution
A character string containing the distribution used (IT only, here 'NA').
messages
A character string containing the error messages if Rhat >1.1 (here 'NA').
Bayer data.
of organisms die for any
specified time-point for a beeSurvFit
objectPredict median and 95% credible interval of the Lethal Concentration.
LCx(object, ...)
LCx(object, ...)
object |
An object used to select a method |
... |
Further arguments to be passed to generic methods |
When class of object
is beeSurvFit
, see LCx.beeSurvFit.
A LCx
object containing the results of the lethal concentration predictions
of organisms die for any
specified time-point for a beeSurvFit
objectPredict the Lethal Concentration at which of organisms die for any
specified time-point for a
beeSurvFit
object
## S3 method for class 'beeSurvFit' LCx( object, X = 50, testType = "Chronic_Oral", timeLCx = NULL, concRange = NULL, nPoints = 100, ... )
## S3 method for class 'beeSurvFit' LCx( object, X = 50, testType = "Chronic_Oral", timeLCx = NULL, concRange = NULL, nPoints = 100, ... )
object |
An object of class |
X |
Percentage of individuals dying (e.g., |
testType |
Test type for which the |
timeLCx |
A scalar giving the time at which |
concRange |
A vector of length 2 with minimal and maximal value of the
range of concentration. If |
nPoints |
Number of time point in |
... |
Further arguments to be passed to generic methods |
A object of class LCx
containing the results of the lethal concentration predictions
data(fitBetacyfluthrin_Chronic) out <- LCx(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) out <- LCx(fitBetacyfluthrin_Chronic)
beeSurvData
objectsThis is the generic plot
S3 method for the beeSurvData
class. It plots the number of survivors as a function of time as well as the reconstructed
concentrations for "Acute_Oral"
and "Acute_Contact"
test types.
## S3 method for class 'beeSurvData' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Data from a", x$typeData, "test on", x$beeSpecies) )
## S3 method for class 'beeSurvData' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Data from a", x$typeData, "test on", x$beeSpecies) )
x |
An object of class |
... |
Additional parameters to generic plot function (not used) |
xlab |
A character string for the label of the x-axis |
ylab1 |
A character string for the label of the y-axis of the survivor plots |
ylab2 |
A character string for the label of the y-axis of the concentration plots |
main |
A character string for the title label plot |
A graphic with the input data
data(betacyfluthrinChronic) plot(betacyfluthrinChronic)
data(betacyfluthrinChronic) plot(betacyfluthrinChronic)
beeSurvFit
objectsThis is the generic plot
S3 method for the beeSurvFit
class. It plots the number of survivors as a function of time as well as the reconstructed
concentrations for "Acute_Oral"
and "Acute_Contact"
test types.
## S3 method for class 'beeSurvFit' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Calibration results for a", x$data$typeData, "test on", x$data$beeSpecies) )
## S3 method for class 'beeSurvFit' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Calibration results for a", x$data$typeData, "test on", x$data$beeSpecies) )
x |
An object of class |
... |
Additional parameters to generic plot functions (not used) |
xlab |
A character string for the label of the x-axis |
ylab1 |
A character string for the label of the y-axis of the survivor plots |
ylab2 |
A character string for the label of the y-axis of the concentration plots |
main |
A character string for the title label plot |
A graphic with the results of the fit
data(fitBetacyfluthrin_Chronic) plot(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) plot(fitBetacyfluthrin_Chronic)
beeSurvPred
objectsThis is the generic plot
S3 method for the beeSurvPred
class. It plots the predicted number of survivors for the exposure concentration entered by the user.
## S3 method for class 'beeSurvPred' plot( x, ..., xlab = "Time [d]", ylab1 = "Survival probability", ylab2 = "Concentration", main = paste("Predictions results for a BeeGUTS", x$modelType, "calibrated for", x$beeSpecies) )
## S3 method for class 'beeSurvPred' plot( x, ..., xlab = "Time [d]", ylab1 = "Survival probability", ylab2 = "Concentration", main = paste("Predictions results for a BeeGUTS", x$modelType, "calibrated for", x$beeSpecies) )
x |
An object of class |
... |
Additional parameters to generic plot functions (not used) |
xlab |
A character string for the label of the x-axis |
ylab1 |
A character string for the label of the y-axis of the survivor plots |
ylab2 |
A character string for the label of the y-axis of the concentration plots |
main |
A character string for the title label plot |
A graphic with results of the forward prediction
dataPredict <- data.frame(time = c(1:10, 1:10, 1:10), conc = c(rep(5, 10), rep(10, 10), rep(15, 10)), replicate = c(rep("rep1", 10), rep("rep2", 10), rep("rep3", 10)), NSurv = c(rep(5, 10), rep(10, 10), rep(15, 10))) data(fitBetacyfluthrin_Chronic) prediction <- predict(fitBetacyfluthrin_Chronic, dataPredict) plot(prediction)
dataPredict <- data.frame(time = c(1:10, 1:10, 1:10), conc = c(rep(5, 10), rep(10, 10), rep(15, 10)), replicate = c(rep("rep1", 10), rep("rep2", 10), rep("rep3", 10)), NSurv = c(rep(5, 10), rep(10, 10), rep(15, 10))) data(fitBetacyfluthrin_Chronic) prediction <- predict(fitBetacyfluthrin_Chronic, dataPredict) plot(prediction)
beeSurvValidation
objectsThis is the generic plot
S3 method for the beeSurvValid
class. It plots the number of survivors as a function of time as well as the reconstructed
concentrations for "Acute_Oral"
and "Acute_Contact"
test types.
## S3 method for class 'beeSurvValidation' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Validation of a BeeGUTS model calibrated for", x$beeSpecies, "on a ", x$typeData, "for", x$beeSpeciesVal) )
## S3 method for class 'beeSurvValidation' plot( x, ..., xlab = "Time [d]", ylab1 = "Number of survivors", ylab2 = "Concentration", main = paste("Validation of a BeeGUTS model calibrated for", x$beeSpecies, "on a ", x$typeData, "for", x$beeSpeciesVal) )
x |
An object of class |
... |
Additional parameters to generic plot functions (not used) |
xlab |
A character string for the label of the x-axis |
ylab1 |
A character string for the label of the y-axis of the survivor plots |
ylab2 |
A character string for the label of the y-axis of the concentration plots |
main |
A character string for the title label plot |
A graphic with the results of the validation
data(betacyfluthrinChronic) # Load dataset for validation data(fitBetacyfluthrin_Chronic) validation <- validate(fitBetacyfluthrin_Chronic, betacyfluthrinChronic) plot(validation)
data(betacyfluthrinChronic) # Load dataset for validation data(fitBetacyfluthrin_Chronic) validation <- validate(fitBetacyfluthrin_Chronic, betacyfluthrinChronic) plot(validation)
ppc
objectsPlotting method for ppc
objects
## S3 method for class 'ppc' plot(x, ...)
## S3 method for class 'ppc' plot(x, ...)
x |
An object of class |
... |
Further arguments to be passed to generic methods. |
an object of class ggplot
.
data(fitBetacyfluthrin_Chronic) out <- ppc(fitBetacyfluthrin_Chronic) plot(out)
data(fitBetacyfluthrin_Chronic) out <- ppc(fitBetacyfluthrin_Chronic) plot(out)
beeSurvFit
, beeSurvPred
Generates an object to be used in posterior predictive check for beeSurvFit
, beeSurvPred
ppc(x)
ppc(x)
x |
an object used to select a method |
a data.frame
of class ppc
beeSurvFit
objectsPosterior predictive check method for beeSurvFit
objects
## S3 method for class 'beeSurvFit' ppc(x)
## S3 method for class 'beeSurvFit' ppc(x)
x |
an object of class |
a data.frame
of class ppc
data(fitBetacyfluthrin_Chronic) out <- ppc(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) out <- ppc(fitBetacyfluthrin_Chronic)
beeSurvValidation
objectsPosterior predictive check method for beeSurvValidation
objects
## S3 method for class 'beeSurvValidation' ppc(x)
## S3 method for class 'beeSurvValidation' ppc(x)
x |
an object of class |
a data.frame
of class ppc
data(fitBetacyfluthrin_Chronic) data(betacyfluthrinChronic) valid <- validate(fitBetacyfluthrin_Chronic,betacyfluthrinChronic) out <- ppc(valid)
data(fitBetacyfluthrin_Chronic) data(betacyfluthrinChronic) valid <- validate(fitBetacyfluthrin_Chronic,betacyfluthrinChronic) out <- ppc(valid)
beeSurvFit
objectsThis is the generic predict
S3 method for the beeSurvFit
class. It predict the survival over time for the concentration profiles entered by the user.
No concentration reconstructions are performed here. Functions odeGUTS::predict_ode()
from the morse
package is used. This might be changed in a future update
## S3 method for class 'beeSurvFit' predict(object, dataPredict, ...)
## S3 method for class 'beeSurvFit' predict(object, dataPredict, ...)
object |
An object of class |
dataPredict |
Data to predict in the format as a dataframe containing the following column:
|
... |
Additional arguments to be parsed to the |
A beeSurvPred
object containing the results of the forwards prediction
dataPredict <- data.frame(time = c(1:5, 1:15), conc = c(rep(5, 5), rep(15, 15)), replicate = c(rep("rep1", 5), rep("rep2", 15))) data(fitBetacyfluthrin_Chronic) prediction <- predict(fitBetacyfluthrin_Chronic, dataPredict)
dataPredict <- data.frame(time = c(1:5, 1:15), conc = c(rep(5, 5), rep(15, 15)), replicate = c(rep("rep1", 5), rep("rep2", 15))) data(fitBetacyfluthrin_Chronic) prediction <- predict(fitBetacyfluthrin_Chronic, dataPredict)
beeSurvFit
objectsThis is an updated predict
method for the beeSurvFit
class. It predict the survival over time for the concentration profiles entered by the user.
No concentration reconstructions are performed here. Functions odeGUTS::predict_ode()
from the morse
package is used. This might be changed in a future update
predict2( object, dataPredict, userhb_value = 0, calib_hb = FALSE, ndatahb = 1, ... )
predict2( object, dataPredict, userhb_value = 0, calib_hb = FALSE, ndatahb = 1, ... )
object |
An object of class |
dataPredict |
Data to predict in the format as a dataframe containing the following column:
|
userhb_value |
User defined background mortality rate parameter.
If a single value is provided, a single fixed value is used. If an array of
two elements is give, the first element is the |
calib_hb |
Logical argument. If |
ndatahb |
Used in combination with |
... |
Additional arguments to be parsed to the |
A beeSurvPred
object containing the results of the forwards prediction
dataPredict <- data.frame(time = c(1:5, 1:15), conc = c(rep(5, 5), rep(15, 15)), replicate = c(rep("rep1", 5), rep("rep2", 15))) data(fitBetacyfluthrin_Chronic) prediction <- predict2(fitBetacyfluthrin_Chronic, dataPredict)
dataPredict <- data.frame(time = c(1:5, 1:15), conc = c(rep(5, 5), rep(15, 15)), replicate = c(rep("rep1", 5), rep("rep2", 15))) data(fitBetacyfluthrin_Chronic) prediction <- predict2(fitBetacyfluthrin_Chronic, dataPredict)
beeSurvFit
objectsIt plots the comparison between the prior and the posterior distributions of the parameters of the GUTS IT or GUTS SD models. The plots do not include warmup iterations
priorposterior_plot(object)
priorposterior_plot(object)
object |
An object of class |
A list of graphic objects with the plot of the comparison between prior and posterior distribution of the parameters. The first entry of the list is dedicated to the hb value (multiple plots in case of multiple datasets), the second element of the list is dedicated to the other model parameters
data(fitBetacyfluthrin_Chronic) priorposterior_plot(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) priorposterior_plot(fitBetacyfluthrin_Chronic)
When class of object
is beeSurvFit
,
see ShortTimeEffects.beeSurvFit.
ShortTimeEffects( object, fullcalculation = FALSE, concRange = NULL, nPoints = NULL )
ShortTimeEffects( object, fullcalculation = FALSE, concRange = NULL, nPoints = NULL )
object |
An object used to select a method |
fullcalculation |
Compute the LDD50 from day 1 to day 10 of the Chronic test. This can increase the computation time |
concRange |
Argument of LCx, range of concentrations to find LDD50 |
nPoints |
Argument of LCx, Number of time point in |
Copyright 2024 C. Romoli, ibacon GmbH
A object of class ggplot
containing the graph of the comparison
between LDD50 at day 2 and day 10 and the data.frame with the plotted values.
beeSurvFit
object.Calculate the presence of Time Reinforced Toxicity for the compound from the
calibrated model beeSurvFit
object.
## S3 method for class 'beeSurvFit' ShortTimeEffects( object, fullcalculation = FALSE, concRange = NULL, nPoints = NULL )
## S3 method for class 'beeSurvFit' ShortTimeEffects( object, fullcalculation = FALSE, concRange = NULL, nPoints = NULL )
object |
An object of class |
fullcalculation |
Compute the LDD50 from day 1 to day 10 of the Chronic test. This can increase the computation time |
concRange |
Argument of LCx, range of concentrations to find LDD50 |
nPoints |
Argument of LCx, Number of time point in |
A object of class ggplot
containing the graph of the comparison
between LDD50 at day 2 and day 10 and the data.frame with the plotted values.
data(fitBetacyfluthrin_Chronic) ShortTimeEffects(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) ShortTimeEffects(fitBetacyfluthrin_Chronic)
beeSurvFit
objectsThis is the generic summary
S3 method for the beeSurvFit
class.
It shows the quantiles of priors and posteriors on parameters.
## S3 method for class 'beeSurvFit' summary(object, ...)
## S3 method for class 'beeSurvFit' summary(object, ...)
object |
An object of class |
... |
Additional arguments to be parsed to the generic |
A summary of the beeSurvFit
object
data(fitBetacyfluthrin_Chronic) summary(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) summary(fitBetacyfluthrin_Chronic)
LCx
objectsThis is the generic summary
S3 method for the LCx
class.
It shows the median and 95% credible interval of the calculated LCx.
## S3 method for class 'LCx' summary(object, ...)
## S3 method for class 'LCx' summary(object, ...)
object |
An object of class |
... |
Additional arguments to be parsed to the generic |
A summary of the LCx
object
data(fitBetacyfluthrin_Chronic) out <- LCx(fitBetacyfluthrin_Chronic) summary(out)
data(fitBetacyfluthrin_Chronic) out <- LCx(fitBetacyfluthrin_Chronic) summary(out)
beeSurvFit
objectsThis is the generic traceplot
S3 method for the beeSurvFit
class. It plots the traces with as well as the densities for the parameters of
the GUTS IT or GUTS SD. The traceplot includes by default the warmup iterations,
the density plot does not include them
traceplot(object, ..., incWarmup_trace = TRUE, incWarmup_dens = FALSE) ## S3 method for class 'beeSurvFit' traceplot(object, ..., incWarmup_trace = TRUE, incWarmup_dens = FALSE)
traceplot(object, ..., incWarmup_trace = TRUE, incWarmup_dens = FALSE) ## S3 method for class 'beeSurvFit' traceplot(object, ..., incWarmup_trace = TRUE, incWarmup_dens = FALSE)
object |
An object of class |
... |
Additional parameters to be parsed to generic |
incWarmup_trace |
A logical indicating whether the warmup iterations should be plotted in the traceplot (default TRUE) |
incWarmup_dens |
A logical indicating whether the warmup iterations should be plotted in the density plot (default FALSE) |
A graphic with the traceplots and densities of the fit
data(fitBetacyfluthrin_Chronic) traceplot(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) traceplot(fitBetacyfluthrin_Chronic)
When class of object
is beeSurvFit
, see TRT.beeSurvFit.
TRT(object, concRange = NULL)
TRT(object, concRange = NULL)
object |
An object used to select a method |
concRange |
Argument of LCx, range of concentrations to find LDD50 |
Copyright 2023-2024 C. Romoli, ibacon GmbH
A ggplot
object with graph of the LDD extrapolation compared
to the Haber's law and a data.frame with the calculations
beeSurvFit
object.Calculate the presence of Time Reinforced Toxicity for the compound from the
calibrated model beeSurvFit
object.
## S3 method for class 'beeSurvFit' TRT(object, concRange = NULL)
## S3 method for class 'beeSurvFit' TRT(object, concRange = NULL)
object |
An object of class |
concRange |
Argument of LCx, range of concentrations to find LDD50 |
A object of class ggplot
containing the graph of the comparison
between Haber's law and the predicted lethal doses at 10 and 27 days and a
data.frame with the plotted values.
data(fitBetacyfluthrin_Chronic) TRT(fitBetacyfluthrin_Chronic)
data(fitBetacyfluthrin_Chronic) TRT(fitBetacyfluthrin_Chronic)
beeSurvFit
objectsThis is a validation
method for the
beeSurvFit
object. It perform forwards predictions for a specific concentration
profile and compare these prediction to the respective experimental data.
validate(object, dataValidate, fithb = FALSE, ...)
validate(object, dataValidate, fithb = FALSE, ...)
object |
An object of class |
dataValidate |
Data to validate in the format of the experimental data used for fit (dataGUTS) |
fithb |
Logical argument. If |
... |
Additional arguments to be parsed to the |
An object of class beeSurvValidation
.
beeSurvFit
objectsThis is the generic validate
S3 method for the beeSurvFit
class. It predict the survival over time for the concentration profiles entered by the user.
## S3 method for class 'beeSurvFit' validate(object, dataValidate, fithb = FALSE, ...)
## S3 method for class 'beeSurvFit' validate(object, dataValidate, fithb = FALSE, ...)
object |
An object of class |
dataValidate |
Data to validate in the format of the experimental data used for fit (dataGUTS) |
fithb |
Logical argument. If |
... |
Additional arguments to be parsed to the |
A beeSurvValidation
object with the results of the validation
data(betacyfluthrinChronic) data(fitBetacyfluthrin_Chronic) validation <- validate(fitBetacyfluthrin_Chronic, betacyfluthrinChronic)
data(betacyfluthrinChronic) data(fitBetacyfluthrin_Chronic) validation <- validate(fitBetacyfluthrin_Chronic, betacyfluthrinChronic)