Package 'odeGUTS'

Title: Solve ODE for GUTS-RED-SD and GUTS-RED-IT Using Compiled Code
Description: Allows performing forwards prediction for the General Unified Threshold model of Survival using compiled ode code. This package was created to avoid dependency with the 'morse' package that requires the installation of 'JAGS'. This package is based on functions from the 'morse' package v3.3.1: Virgile Baudrot, Sandrine Charles, Marie Laure Delignette-Muller, Wandrille Duchemin, Benoit Goussen, Nils Kehrein, Guillaume Kon-Kam-King, Christelle Lopes, Philippe Ruiz, Alexander Singer and Philippe Veber (2021) <https://CRAN.R-project.org/package=morse>.
Authors: Benoit Goussen [aut, cre]
Maintainer: Benoit Goussen <[email protected]>
License: GPL (>= 3)
Version: 1.0.3
Built: 2025-03-06 05:34:19 UTC
Source: https://github.com/bgoussen/odeguts

Help Index


Model calibration results for a GUTS-SD theoretical species exposed to a compound.

Description

Model calibration results for a GUTS-SD theoretical species exposed to a compound.

Usage

data(fit_odeGUTS)

Format

A list of class survFit constructed

mcmc

A list of mcmc chain results

model_type

A character string containing the type of GUTS model used (here 'SD').


Checking goodness-of-fit method for survFitPredict and survFitPredict_Nsurv objects

Description

Function from the morse v 3.3.1 package. It returns measures of goodness-of-fit for predictions.

Function from the morse v 3.3.1 package. Provide various criteria for assessment of the model performance: (i) percentage of observation within the 95\ interval of the Posterior Prediction Check (PPC), the Normalised Root Mean Square Error (NRMSE) and the Survival Probability Prediction Error (SPPE) as recommended by the recent Scientific Opinion from EFSA (2018).

Usage

predict_Nsurv_check(object, ...)

## S3 method for class 'survFitPredict_Nsurv'
predict_Nsurv_check(object, ...)

Arguments

object

an object of class survFitPredict_Nsurv

...

Further arguments to be passed to generic methods

Value

The function return a list with three items:

PPC

The criterion, in percent, compares the predicted median numbers of survivors associated to their uncertainty limits with the observed numbers of survivors. Based on experience, PPC resulting in less than 50%50\% of the observations within the uncertainty limits indicate poor model performance. A fit of 100%100\% may hide too large uncertainties of prediction (so covering all data).

PPC_global

percentage of PPC for the whole data set by gathering replicates.

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.

NRMSE_global

NRMSE for the whole data set by gathering replicates.

SPPE

The SPPE indicator, in percent, is negative (between 00 and 100%-100\%) for an underestimation of effects, and positive (between 00 and 100100) for an overestimation of effects. An SPPE value of 00 means an exact prediction of the observed survival probability at the end of the exposure profile.

@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


Predict method for survFit objects

Description

Function from the morse v 3.3.1 package. This is a method to replace function predict used on survFit object when computing issues happen. predict_ode uses the deSolve library to improve robustness. However, time to compute may be longer.

Function from the morse v 3.3.1 package. This is the generic predict S3 method for the survFit class. It provides predicted survival rate for "SD" or "IT" models under constant or time-variable exposure.

Function from the morse v 3.3.1 package. This is a method to replace function predict_Nsurv used on survFit object when computing issues happen. predict_nsurv_ode uses the deSolve library to improve robustness. However, time to compute may be longer.

Usage

predict_ode(object, ...)

## S3 method for class 'survFit'
predict_ode(
  object,
  data_predict = NULL,
  spaghetti = FALSE,
  mcmc_size = 1000,
  hb_value = FALSE,
  interpolate_length = 100,
  interpolate_method = "linear",
  hb_valueFORCED = 0,
  ...
)

predict_Nsurv_ode(
  object,
  data_predict,
  spaghetti,
  mcmc_size,
  hb_value,
  hb_valueFORCED,
  extend_time,
  interpolate_length,
  interpolate_method,
  ...
)

## S3 method for class 'survFit'
predict_Nsurv_ode(
  object,
  data_predict = NULL,
  spaghetti = FALSE,
  mcmc_size = 1000,
  hb_value = FALSE,
  hb_valueFORCED = 0,
  extend_time = 100,
  interpolate_length = NULL,
  interpolate_method = "linear",
  ...
)

Arguments

object

An object of class survFit.

...

Further arguments to be passed to generic methods

data_predict

A dataframe with three columns time, conc and replicate used for prediction. If NULL, prediction is based on x object of class survFit used for fitting.

spaghetti

If TRUE, return a set of survival curves using parameters drawn from the posterior distribution.

mcmc_size

Can be used to reduce the number of mcmc samples in order to speed up the computation. mcmc_size is the number of selected iterations for one chain. Default is 1000. If all MCMC is wanted, set argument to NULL.

hb_value

If TRUE, the background mortality hb is taken into account from the posterior. If FALSE, parameter hb is set to 0. The default is FALSE.

interpolate_length

Length of the time sequence for which output is wanted.

interpolate_method

The interpolation method for concentration. See package deSolve for details. Default is linear.

hb_valueFORCED

If hb_value is FALSE, it fix hb. Default is 0

extend_time

Length of time points interpolated with variable exposure profiles.

Value

The function returns an object of class survFitPredict or survFitPredict_Nsurv with two items:

df_quantile

Predicted quantiles (q50, qinf95, and qsup95)

df_spaghetti

Predicted survival curve (if spaghetti = TRUE)

Examples

library("odeGUTS")
data(fit_odeGUTS)

data_4prediction <- data.frame(time = 1:10,
                               conc = c(0,5,30,30,0,0,5,30,15,0),
                               replicate= rep("predict", 10))

predict_out <- predict_ode(object = fit_odeGUTS, data_predict = data_4prediction,
                           mcmc_size = 200, spaghetti = FALSE)