fit_tktd: Fit TK/TD parameters

fit_tktdR Documentation

Fit TK/TD parameters

Description

[Experimental]

Usage

fit_tktd(x, data, ...)

## S4 method for signature 'LemnaSetac,missing'
fit_tktd(x, data, par, log_scale = TRUE, verbose = FALSE, ...)

## S4 method for signature 'LemnaSchmitt,missing'
fit_tktd(x, data, par, log_scale = TRUE, verbose = FALSE, ...)

## S4 method for signature 'Magma,missing'
fit_tktd(x, data, par, log_scale = TRUE, verbose = FALSE, ...)

Arguments

x

a scenario or a list of caliset objects

data

toxicological trial data to fit TK/TD parameters to: required if x is either a scenario or the result of a fit. See Section Data for details.

...

additional arguments passed through to calibrate()

par

named vector, of parameters to fit and their starting values

log_scale

logical, if TRUE then fitting will be performed on log-transformed observations and predictions, else the data will be used as-is

verbose

logical, if TRUE then info messages are printed to the console

Details

Data

The function can be used in three basic ways: Fit parameters of

  1. a single scenario to a data set

  2. a list of calisets

  3. a list of calisets in a chain of fit functions

For option 1), scenario and data are supplied separately. In this case, supported types of argument data are data.frames and tox_data objects. Any data.frame must have a format that is compatible with the tox_data() function.

In option 2), all conditions are fully described by a list of calibration sets. The user is responsible to set up all caliset objects to their needs.

Option 3) is for convenience purposes and allows the chaining of fit functions. The latter alternative accepts the return value of e.g. fit_growth() as argument x and the fitted parameter values are applied to all calibration sets in argument data.

Value

a list

Methods (by class)

  • fit_tktd(x = LemnaSetac, data = missing): Fit TK/TD parameters of Lemna_SETAC scenarios

  • fit_tktd(x = LemnaSchmitt, data = missing): Fit TK/TD parameters of Lemna_Schmitt scenarios

  • fit_tktd(x = Magma, data = missing): Fit TK/TD parameters of Magma scenarios

Examples

# Use experimental data from control trial ('T0') to fit growth rate
ctrl <- schmitt2013[schmitt2013$trial == "T0" ,]

# Set up a scenario, provide dummy parameter values where necessary
sc <- Lemna_Schmitt() %>%
  set_init(c(BM=0.0012)) %>%
  set_param(c(EC50=1, b=1, P_up=1))

# Run fitting routine
fit_growth(sc, data=ctrl, verbose=TRUE)

# Use fitted growth parameter to adapt scenario
sc2 <- sc %>% set_param(c(k_phot_max=0.43925))

# Use experimental ecotox data for various concentrations of 'metsulfuron-methyl'
trials <- schmitt2013[schmitt2013$trial != "T0" ,]

# Fit remaining TK/TD parameters
fit_tktd(sc2, data=trials, verbose=TRUE)

cvasi documentation built on Sept. 11, 2025, 5:11 p.m.