From 3010c9dcbc7f90f15b55c14919f6688d61d14414 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sat, 4 Mar 2017 09:58:00 +0100 Subject: Mention pkgdown.jrwb.de/mkin in README Add very small twa vignette, update pkgdown docs --- README.html | 4 +- README.md | 4 +- docs/index.html | 97 ++++++++++++------ docs/news/index.html | 254 +++++++++++++++++++++++++++++++--------------- docs/reference/index.html | 101 +++++++++++------- docs/reference/twa.html | 174 +++++++++++++++++++++++++++++++ vignettes/twa.pdf | Bin 0 -> 147283 bytes vignettes/twa.rmd | 57 +++++++++++ 8 files changed, 539 insertions(+), 152 deletions(-) create mode 100644 docs/reference/twa.html create mode 100644 vignettes/twa.pdf create mode 100644 vignettes/twa.rmd diff --git a/README.html b/README.html index a661505d..f9d8eff9 100644 --- a/README.html +++ b/README.html @@ -121,7 +121,7 @@ $(document).ready(function () {

mkin

-

+

The R package mkin provides calculation routines for the analysis of chemical degradation data, including multicompartment kinetics as needed for modelling the formation and decline of transformation products, or if several compartments are involved.

Installation

@@ -138,7 +138,7 @@ $(document).ready(function () {

Documentation

-

The HTML documentation is available at github and at R-Forge.

+

The HTML documentation is available at jrwb.de, at github and at R-Forge.

Features

diff --git a/README.md b/README.md index c042a7d6..41d9ec46 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,9 @@ at the package vignettes ## Documentation -The HTML documentation is available at [github](http://jranke.github.io/mkin) +The HTML documentation is available at +[jrwb.de](http://pkgdown.jrwb.de/mkin), at +[github](http://jranke.github.io/mkin) and at [R-Forge](http://kinfit.r-forge.r-project.org/mkin_static/index.html). ## Features diff --git a/docs/index.html b/docs/index.html index a8d8521d..4ec9fd79 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,8 +1,20 @@ -Kinetic Evaluation of Chemical Degradation Data • mkin + + + + + +Kinetic Evaluation of Chemical Degradation Data • mkin + + + + + + +
-
+ +
+ +
+ + +
- +

The R package mkin provides calculation routines for the analysis of chemical degradation data, including multicompartment kinetics as needed for modelling the formation and decline of transformation products, or if several compartments are involved.

@@ -66,7 +88,7 @@

Background

-

In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance and helpful tools have been developed as detailed in ‘Credits and historical remarks’ below.

+

In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance and helpful tools have been developed as detailed in ‘Credits and historical remarks’ below.

@@ -76,23 +98,25 @@

Documentation

-

The HTML documentation is available at github and at R-Forge.

+

The HTML documentation is available at jrwb.de, at github and at R-Forge.

Features

-
  • Highly flexible model specification using mkinmod, including equilibrium reactions and using the single first-order reversible binding (SFORB) model, which will automatically create two latent state variables for the observed variable.
  • -
  • As of version 0.9-39, fitting of several models to several datasets, optionally in parallel, is supported, see for example plot.mmkin.
  • -
  • Model solution (forward modelling) in the function mkinpredict is performed either using the analytical solution for the case of parent only degradation, an eigenvalue based solution if only simple first-order (SFO) or SFORB kinetics are used in the model, or using a numeric solver from the deSolve package (default is lsoda).
  • +
      +
    • Highly flexible model specification using mkinmod, including equilibrium reactions and using the single first-order reversible binding (SFORB) model, which will automatically create two latent state variables for the observed variable.
    • +
    • As of version 0.9-39, fitting of several models to several datasets, optionally in parallel, is supported, see for example plot.mmkin.
    • +
    • Model solution (forward modelling) in the function mkinpredict is performed either using the analytical solution for the case of parent only degradation, an eigenvalue based solution if only simple first-order (SFO) or SFORB kinetics are used in the model, or using a numeric solver from the deSolve package (default is lsoda).
    • If a C compiler is installed, the kinetic models are compiled from automatically generated C code, see
      vignette compiled_models. The autogeneration of C code was inspired by the ccSolve package. Thanks to Karline Soetaert for her work on that.
    • -
    • By default, kinetic rate constants and kinetic formation fractions are transformed internally using transform_odeparms so their estimators can more reasonably be expected to follow a normal distribution. This has the side effect that no constraints are needed in the optimisation. Thanks to René Lehmann for the nice cooperation on this, especially the isometric logration transformation that is now used for the formation fractions.
    • +
    • By default, kinetic rate constants and kinetic formation fractions are transformed internally using transform_odeparms so their estimators can more reasonably be expected to follow a normal distribution. This has the side effect that no constraints are needed in the optimisation. Thanks to René Lehmann for the nice cooperation on this, especially the isometric logration transformation that is now used for the formation fractions.
    • A side effect of this is that when parameter estimates are backtransformed to match the model definition, confidence intervals calculated from standard errors are also backtransformed to the correct scale, and will not include meaningless values like negative rate constants or formation fractions adding up to more than 1, which can not occur in a single experiment with a single defined radiolabel position.
    • The usual one-sided t-test for significant difference from zero is nevertheless shown based on estimators for the untransformed parameters.
    • Summary and plotting functions. The summary of an mkinfit object is in fact a full report that should give enough information to be able to approximately reproduce the fit with other tools.
    • The chi-squared error level as defined in the FOCUS kinetics guidance (see below) is calculated for each observed variable.
    • Iteratively reweighted least squares fitting is implemented in a similar way as in KinGUII and CAKE (see below). Simply add the argument reweight = "obs" to your call to mkinfit and a separate variance componenent for each of the observed variables will be optimised in a second stage after the primary optimisation algorithm has converged.
    • When a metabolite decline phase is not described well by SFO kinetics, SFORB kinetics can be used for the metabolite.
    • -
+ +

GUI

@@ -111,29 +135,42 @@

Also, it was inspired by the first version of KinGUI developed by BayerCropScience, which is based on the MatLab runtime environment.

The companion package kinfit (now deprecated) was started in 2008 and first published on CRAN on 01 May 2010.

The first mkin code was published on 11 May 2010 and the first CRAN version on 18 May 2010.

-

In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named KinGUII whose R code is based on mkin, but which added, amongst other refinements, a closed source graphical user interface (GUI), iteratively reweighted least squares (IRLS) optimisation of the variance for each of the observed variables, and Markov Chain Monte Carlo (MCMC) simulation functionality, similar to what is available e.g. in the FME package.

+

In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named KinGUII whose R code is based on mkin, but which added, amongst other refinements, a closed source graphical user interface (GUI), iteratively reweighted least squares (IRLS) optimisation of the variance for each of the observed variables, and Markov Chain Monte Carlo (MCMC) simulation functionality, similar to what is available e.g. in the FME package.

Somewhat in parallel, Syngenta has sponsored the development of an mkin and KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is more limited in the model formulation, but puts more weight on usability. CAKE is available for download from the CAKE website, where you can also find a zip archive of the R scripts derived from mkin, published under the GPL license.

Finally, there is KineticEval, which contains a further development of the scripts used for KinGUII, so the different tools will hopefully be able to learn from each other in the future as well.

Development

-

Contributions are welcome! Your mkin fork is just a mouse click away… The master branch on github should always be in good shape, I implement new features in separate branches now. If you prefer subversion, project members for the r-forge project are welcome as well. Generally, the source code of the latest CRAN version should be available there. You can also browse the source code at cgit.jrwb.de/mkin.

+

Contributions are welcome! Your mkin fork is just a mouse click away… The master branch on github should always be in good shape, I implement new features in separate branches now. If you prefer subversion, project members for the r-forge project are welcome as well. Generally, the source code of the latest CRAN version should be available there. You can also browse the source code at cgit.jrwb.de/mkin.

+ + +

Dev status

+
    +
  • +
+ +
@@ -145,6 +182,8 @@

Site built with pkgdown.

- + + - + + diff --git a/docs/news/index.html b/docs/news/index.html index cbf35a73..2e7f0e34 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -100,16 +100,29 @@
+
+

+ mkin 0.9.45.1 (2016-12-20)

+
+

+ New features

+
    +
  • A twa function, calculating maximum time weighted average concentrations for the parent (SFO, FOMC and DFOP).
  • +
+
+

mkin 0.9.45 (2016-12-08)

Minor changes

-
  • plot.mkinfit and plot.mmkin: If the plotting device is tikz, LaTeX markup is being used for the chi2 error in the graphs.

  • +
      +
    • plot.mkinfit and plot.mmkin: If the plotting device is tikz, LaTeX markup is being used for the chi2 error in the graphs.

    • Use pkgdown, the successor of staticdocs for generating static HTML documentation. Include example output and graphs also for dontrun sections.

    • plot.mkinfit: Plotting does not fail any more when the compiled model is not available, e.g. because it was removed from the temporary directory. In this case, the uncompiled model is now used for plotting

    • -
+ +

@@ -117,8 +130,10 @@

Bug fixes

-
  • The test test_FOMC_ill-defined failed on several architectures, so the test is now skipped
  • -
+
    +
  • The test test_FOMC_ill-defined failed on several architectures, so the test is now skipped
  • +
+

@@ -126,31 +141,37 @@

Major changes

-
  • The title was changed to Kinetic evaluations of chemical degradation data

  • +
      +
    • The title was changed to Kinetic evaluations of chemical degradation data

    • plot.mkinfit: Add the possibility to show fits (and residual plots if requested) separately for the observed variables

    • plot.mkinfit: Add the possibility to show the chi2 error levels in the plot, similar to the way they are shown in plot.mmkin

    • plot_sep: Add this function as a convenience wrapper for plotting observed variables of mkinfit objects separately, with chi2 error values and residual plots.

    • Vignettes: The main vignette mkin was converted to R markdown and updated. The other vignettes were also updated to show current improved functionality.

    • The function add_err was added to the package, making it easy to generate simulated data using an error model based on the normal distribution

    • -
+ +

Minor changes

-
+ +

Bug fixes

-
+ +

@@ -158,15 +179,19 @@

Major changes

-
  • Add the argument from_max_mean to mkinfit, for fitting only the decline from the maximum observed value for models with a single observed variable
  • -
+
    +
  • Add the argument from_max_mean to mkinfit, for fitting only the decline from the maximum observed value for models with a single observed variable
  • +
+

Minor changes

-
+ +

@@ -174,17 +199,21 @@

Minor changes

-
  • Add an R6 class mkinds representing datasets with a printing method

  • +
      +
    • Add an R6 class mkinds representing datasets with a printing method

    • Add a printing method for mkinmod objects

    • Make it possible to specify arbitrary strings as names for the compounds in mkinmod, and show them in the plot

    • Use an index.r file to group help topics in static documentation

    • -
+ +

Bug fixes

-
+ +

@@ -192,15 +221,19 @@

Bug fixes

-
  • +
      +
    • endpoints(): For DFOP and SFORB models, where optimize() is used, make use of the fact that the DT50 must be between DT50_k1 and DT50_k2 (DFOP) or DT50_b1 and DT50_b2 (SFORB), as optimize() sometimes did not find the minimum. Likewise for finding DT90 values. Also fit on the log scale to make the function more efficient.
    • -
+ +

Internal changes

-
+ +

@@ -208,15 +241,19 @@

Major changes

-
  • New function mmkin(): This function takes a character vector of model shorthand names, or alternatively a list of mkinmod models, as well as a list of dataset as main arguments. It returns a matrix of mkinfit objects, with a row for each model and a column for each dataset. A subsetting method with single brackets is available. Fitting the models in parallel using the parallel package is supported.

  • +
      +
    • New function mmkin(): This function takes a character vector of model shorthand names, or alternatively a list of mkinmod models, as well as a list of dataset as main arguments. It returns a matrix of mkinfit objects, with a row for each model and a column for each dataset. A subsetting method with single brackets is available. Fitting the models in parallel using the parallel package is supported.

    • New function plot.mmkin(): Plots single-row or single-column mmkin objects including residual plots.

    • -
+ +

Bug fixes

-
+ +

@@ -224,15 +261,19 @@

Minor changes

-
  • vignettes/compiled_models.html: Show the performance improvement factor actually obtained when building the vignette, as well as mkin version, some system info and the CPU model used for building the vignette.

  • +
      +
    • vignettes/compiled_models.html: Show the performance improvement factor actually obtained when building the vignette, as well as mkin version, some system info and the CPU model used for building the vignette.

    • GNUMakefile,vignettes/*: Clean up vignette generation and include table of contents in HTML vignettes.

    • -
+ +

Bug fixes

-
+ +

@@ -240,16 +281,20 @@

Major changes

-
  • summary.mkinfit(): A one-sided t-test for significant difference of untransformed parameters from zero is now always shown, based on the assumption of normal distribution for estimators of all untransformed parameters. Use with caution, as this assumption is unrealistic e.g. for rate constants in these nonlinear kinetic models.

  • +
      +
    • summary.mkinfit(): A one-sided t-test for significant difference of untransformed parameters from zero is now always shown, based on the assumption of normal distribution for estimators of all untransformed parameters. Use with caution, as this assumption is unrealistic e.g. for rate constants in these nonlinear kinetic models.

    • If a compiler (gcc) is installed, use a version of the differential equation model compiled from C code, which is a huge performance boost for models where only the deSolve method works.

    • mkinmod(): Create a list component $cf (of class CFuncList) in the list returned by mkinmod, if a version can be compiled from autogenerated C code (see above).

    • mkinfit(): Set the default solution_type to deSolve when a compiled version of the model is present, except when an analytical solution is possible.

    • -
+ +

Minor changes

-
+ +

@@ -257,97 +302,119 @@

Major changes

-
  • Switch from RUnit to testthat for testing
  • -
+
    +
  • Switch from RUnit to testthat for testing
  • +
+

Bug fixes

-
-
+ +
+

- New features

-
+ +

mkin 0.9-34 (2014-11-22)

-
+

- New features

-
  • Add the convenience function mkinsub() for creating the lists used in mkinmod()

  • + New features +
      +
    • Add the convenience function mkinsub() for creating the lists used in mkinmod()

    • Add the possibility to fit indeterminate order rate equation (IORE) models using an analytical solution (parent only) or a numeric solution. Paths from IORE compounds to metabolites are supported when using formation fractions (use_of_ff = ‘max’). Note that the numerical solution (method.ode = ‘deSolve’) of the IORE differential equations sometimes fails due to numerical problems.

    • Switch to using the Port algorithm (using a model/trust region approach) per default. While needing more iterations than the Levenberg-Marquardt algorithm previously used per default, it is less sensitive to starting parameters.

    • -
+ +

Minor changes

-
  • The formatting of differential equations in the summary was further improved

  • +
      +
    • The formatting of differential equations in the summary was further improved

    • Always include 0 on y axis when plotting during the fit

    • -
+ +

mkin 0.9-33 (2014-10-22)

-
+

- New features

-
  • The initial value (state.ini) for the observed variable with the highest observed residue is set to 100 in case it has no time zero observation and state.ini = "auto"

  • + New features +
      +
    • The initial value (state.ini) for the observed variable with the highest observed residue is set to 100 in case it has no time zero observation and state.ini = "auto"

    • A basic unit test for mkinerrmin() was written

    • -
+ +

Bug fixes

-
  • mkinfit(): The internally fitted parameter for g was named g_ilr even when transform_fractions=FALSE

  • +
      +
    • mkinfit(): The internally fitted parameter for g was named g_ilr even when transform_fractions=FALSE

    • mkinfit(): The initial value (state.ini) for the parent compound was not set when the parent was not the (only) variable with the highest value in the observed data.

    • mkinerrmin(): When checking for degrees of freedom for metabolites, check if their time zero value is fixed instead of checking if the observed value is zero. This ensures correct calculation of degrees of freedom also in cases where the metabolite residue at time zero is greater zero.

    • plot.mkinfit(): Avoid a warning message about only using the first component of ylim that occurred when ylim was specified explicitly

    • -
+ +

Minor changes

-
+ +

mkin 0.9-32 (2014-07-24)

-
+

- New features

-
  • The number of degrees of freedom is difficult to define in the case of ilr transformation of formation fractions. Now for each source compartment the number of ilr parameters (=number of optimised parameters) is divided by the number of pathways to metabolites (=number of affected data series) which leads to fractional degrees of freedom in some cases.

  • + New features +
      +
    • The number of degrees of freedom is difficult to define in the case of ilr transformation of formation fractions. Now for each source compartment the number of ilr parameters (=number of optimised parameters) is divided by the number of pathways to metabolites (=number of affected data series) which leads to fractional degrees of freedom in some cases.

    • The default for the initial value for the first state value is now taken from the mean of the observations at time zero, if available.

    • The kinetic model can alternatively be specified with a shorthand name for parent only degradation models, e.g. SFO, or DFOP.

    • Optimisation method, number of model evaluations and time elapsed during optimisation are given in the summary of mkinfit objects.

    • The maximum number of iterations in the optimisation algorithm can be specified using the argument maxit.modFit to the mkinfit function.

    • mkinfit gives a warning when the fit does not converge (does not apply to SANN method). This warning is included in the summary.

    • -
+ +

Bug fixes

-
  • Avoid plotting an artifical 0 residual at time zero in mkinresplot

  • +
      +
    • Avoid plotting an artifical 0 residual at time zero in mkinresplot

    • In the determination of the degrees of freedom in mkinerrmin, formation fractions were accounted for multiple times in the case of parallel formation of metabolites. See the new feature described above for the solution.

    • transform_rates=FALSE in mkinfit now also works for FOMC and HS models.

    • Initial values for formation fractions were not set in all cases.

    • No warning was given when the fit did not converge when a method other than the default Levenberg-Marquardt method Marq was used.

    • -
+ +

Minor changes

-
+ +

@@ -355,52 +422,65 @@

Bug fixes

-
  • The internal renaming of optimised parameters in Version 0.9-30 led to errors in the determination of the degrees of freedom for the chi2 error level calulations in mkinerrmin() used by the summary function.
  • -
+
    +
  • The internal renaming of optimised parameters in Version 0.9-30 led to errors in the determination of the degrees of freedom for the chi2 error level calulations in mkinerrmin() used by the summary function.
  • +
+

mkin 0.9-30 (2014-07-11)

-
+

- New features

-
  • It is now possible to use formation fractions in combination with turning off the sink in mkinmod().
  • -
+ New features +
    +
  • It is now possible to use formation fractions in combination with turning off the sink in mkinmod().
  • +
+

Major changes

-
  • The original and the transformed parameters now have different names (e.g. k_parent and log_k_parent. They also differ in how many they are when we have formation fractions but no pathway to sink.

  • +
      +
    • The original and the transformed parameters now have different names (e.g. k_parent and log_k_parent. They also differ in how many they are when we have formation fractions but no pathway to sink.

    • The order of some of the information blocks in print.summary.mkinfit.R() has been ordered in a more logical way.

    • -
+ +

Minor changes

-
+ +

mkin 0.9-29 (2014-06-27)

-
+ +

mkin 0.9-28 (2014-05-20)

-
+ +

mkin 0.9-27 (2014-05-10)

-
+ +

mkin 0.9-24 (2013-11-06)

-
+ +

mkin 0.9-22 (2013-10-26)

- +

For a detailed list of changes to the mkin source please consult the commit history on http://github.com/jranke/mkin

@@ -448,6 +533,7 @@

Contents

-

Plot model fits (observed and fitted) and the residuals for a row or column of an mmkin object

+

+

@@ -168,42 +178,50 @@

-

Datasets A to F from the FOCUS Kinetics report from 2006

+

+

-

Results of fitting the SFO model to Datasets A to F of FOCUS (2006)

+

+

-

Results of fitting the FOMC model to Datasets A to F of FOCUS (2006)

+

+

-

Results of fitting the HS model to Datasets A to F of FOCUS (2006)

+

+

-

Results of fitting the DFOP model to Datasets A to B of FOCUS (2006)

+

+

-

Datasets on aerobic soil metabolism of 2,4,5-T in six soils

+

+

-

Metabolism data set used for checking the software quality of KinGUI

+

+

-

Synthetic datasets for one parent compound with two metabolites

+

+

@@ -213,7 +231,8 @@
  • mkinds
  • -

    Print mkinds objects

    +

    +

    @@ -221,42 +240,49 @@

    -

    Convert a dataframe with observations over time into long format

    +

    +

    -

    Convert a dataframe from long to wide format

    +

    +

    -

    Function to set up a kinetic submodel for one state variable

    +

    +

    -

    Print mkinmod objects

    +

    +

    -

    Produce predictions from a kinetic model using specific parameters

    +

    +

    -

    Functions to transform and backtransform kinetic parameters for fitting

    +

    +

    -

    Function to perform isometric log-ratio transformation

    +

    +

    -

    Calculate the geometric mean

    +

    Calculate the geometric mean

    @@ -264,32 +290,33 @@

    Parent only model solutions

    -

    Single First-Order kinetics

    +

    Single First-Order kinetics

    -

    First-Order Multi-Compartment kinetics

    +

    First-Order Multi-Compartment kinetics

    -

    Double First-Order in Parallel kinetics

    +

    +

    -

    Single First-Order Reversible Binding kinetics

    +

    Single First-Order Reversible Binding kinetics

    -

    Hockey-Stick kinetics

    +

    Hockey-Stick kinetics

    -

    Indeterminate order rate equation kinetics

    +

    Indeterminate order rate equation kinetics

    @@ -297,7 +324,8 @@

    -

    Add normally distributed errors to simulated kinetic degradation data

    +

    +

    @@ -305,7 +333,8 @@

    Functions that have been superseeded

    -

    Plot the observed data and the fitted model of an mkinfit object

    +

    +

    diff --git a/docs/reference/twa.html b/docs/reference/twa.html new file mode 100644 index 00000000..9c2efd10 --- /dev/null +++ b/docs/reference/twa.html @@ -0,0 +1,174 @@ + + + + + + + + + + — twa • mkin + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + + +

    This function calculates maximum moving window time weighted average concentrations +(TWAs) for kinetic models fitted with mkinfit. Currently, only +calculations for the parent are implemented for the SFO, FOMC and DFOP models, +using the analytical formulas given in the PEC soil section of the FOCUS +guidance.

    + + +
    twa(fit, windows)
    + +

    Arguments

    +
    +
    fit
    +
    + An object of class mkinfit. +
    +
    windows
    +
    + The width of the time windows for which the TWAs should be calculated. +
    +
    + +

    Value

    + +

    A numeric vector, named using the windows argument.

    + +

    References

    + +

    FOCUS (2006) “Guidance Document on Estimating Persistence and + Degradation Kinetics from Environmental Fate Studies on Pesticides in EU + Registration” Report of the FOCUS Work Group on Degradation Kinetics, + EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, + http://http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + + +

    Examples

    +
    fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) + twa(fit, c(7, 21))
    #> Error in eval(expr, envir, enclos): konnte Funktion "twa" nicht finden
    +
    + +
    + + +
    + + + diff --git a/vignettes/twa.pdf b/vignettes/twa.pdf new file mode 100644 index 00000000..f39c64a7 Binary files /dev/null and b/vignettes/twa.pdf differ diff --git a/vignettes/twa.rmd b/vignettes/twa.rmd new file mode 100644 index 00000000..5c3f0ca3 --- /dev/null +++ b/vignettes/twa.rmd @@ -0,0 +1,57 @@ +--- +title: Calculation of time weighted average concentrations with mkin +author: Johannes Ranke +date: "`r Sys.Date()`" +bibliography: references.bib +vignette: > + %\VignetteEngine{knitr::rmarkdown} + %\VignetteIndexEntry{Calculation of time weighted average concentrations with mkin} + %\VignetteEncoding{UTF-8} +--- + +Since version 0.9.45.1 of the 'mkin' package, a function for calculating +time weighted average concentrations for decline kinetics (*i.e.* only +for the compound applied in the experiment) is included. + +Time weighted average concentrations for the DFOP model are calculated using +the formulas given in the FOCUS kinetics guidance [@FOCUSkinetics2014, p. 251]: + +SFO: + +$$c_\textrm{twa} = c_0 \left( 1 - e^{- k t} \right) $$ + +FOMC: + +$$c_\textrm{twa} = c_0 \frac{\beta}{t (1 - \alpha)} + \left( \left(\frac{t}{\beta} + 1 \right)^{1 - \alpha} - 1 \right) $$ + +DFOP: + +$$c_\textrm{twa} = \frac{c_0}{t} \left( + \frac{g}{k_1} \left( 1 - e^{- k_1 t} \right) + + \frac{1-g}{k_2} \left( 1 - e^{- k_2 t} \right) \right) $$ + +Often, the ratio between the time weighted average concentration $c_\textrm{twa}$ +and the initial concentration $c_0$ + +$$f_\textrm{twa} = \frac{c_\textrm{twa}}{c_0}$$ + +is needed. This can be calculated from the fitted initial concentration $c_0$ and +the time weighted average concentration $c_\textrm{twa}$, or directly from +the model parameters using the following formulas: + +SFO: + +$$f_\textrm{twa} = \left( 1 - e^{- k t} \right) $$ + +FOMC: + +$$f_\textrm{twa} = \frac{\beta}{t (1 - \alpha)} + \left( \left(\frac{t}{\beta} + 1 \right)^{1 - \alpha} - 1 \right) $$ + +DFOP: + +$$f_\textrm{twa} = \frac{1}{t} \left( + \frac{g}{k_1} \left( 1 - e^{- k_1 t} \right) + + \frac{1-g}{k_2} \left( 1 - e^{- k_2 t} \right) \right) $$ + -- cgit v1.2.1