From 063ae84c199e1223a620fe512ab8713371119f5f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 28 Mar 2017 10:44:50 +0200 Subject: Change vignette format for twa vignette, update docs --- _pkgdown.yml | 2 + docs/authors.html | 5 ++ docs/index.html | 27 ++++---- vignettes/twa.Rmd | 57 +++++++++++++++++ vignettes/twa.html | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++ vignettes/twa.pdf | Bin 146941 -> 0 bytes vignettes/twa.rmd | 57 ----------------- 7 files changed, 264 insertions(+), 69 deletions(-) create mode 100644 vignettes/twa.Rmd create mode 100644 vignettes/twa.html delete mode 100644 vignettes/twa.pdf delete mode 100644 vignettes/twa.rmd diff --git a/_pkgdown.yml b/_pkgdown.yml index eebb04c5..73e2fe02 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -79,5 +79,7 @@ navbar: href: articles/FOCUS_L.html - text: Performance benefit by using compiled model definitions in mkin href: articles/compiled_models.html + - text: Calculation of time weighted average concentrations with mkin + href: articles/twa.html - text: News href: news/index.html diff --git a/docs/authors.html b/docs/authors.html index b0eac1b8..6a5c2862 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -31,6 +31,8 @@ + + @@ -70,6 +72,9 @@
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Calculation of time weighted average concentrations with mkin +
  • diff --git a/docs/index.html b/docs/index.html index 654bb363..0a353ee5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,6 +50,9 @@
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Calculation of time weighted average concentrations with mkin +
  • @@ -76,33 +79,33 @@
    +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

    +Installation

    You can install the latest released version from CRAN from within R:

    install.packages("mkin")

    - Background

    +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.

    - Usage

    +Usage

    For a start, have a look a the code examples provided for plot.mkinfit and plot.mmkin, and at the package vignettes FOCUS L and FOCUS D.

    - Documentation

    +Documentation

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

    - Features

    +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.
    • @@ -119,17 +122,17 @@

    - GUI

    +GUI

    There is a graphical user interface that I consider useful for real work. Please refer to its documentation page for installation instructions and a manual.

    - News

    +News

    Yes, there is a ChangeLog, for the latest CRAN release and one for the github master branch.

    - Credits and historical remarks

    +Credits and historical remarks

    mkin would not be possible without the underlying software stack consisting of R and the packages deSolve and FME, to say the least.

    It could not have been written without me being introduced to regulatory fate modelling of pesticides by Adrian Gurney during my time at Harlan Laboratories Ltd (formerly RCC Ltd). mkin greatly profits from and largely follows the work done by the FOCUS Degradation Kinetics Workgroup, as detailed in their guidance document from 2006, slightly updated in 2011 and in 2014.

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

    @@ -141,7 +144,7 @@

    - Development

    +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.

    @@ -164,12 +167,12 @@
  • Johannes Ranke
    Author, maintainer, copyright holder
  • All authors...
  • - +

    Dev status

    - +
    diff --git a/vignettes/twa.Rmd b/vignettes/twa.Rmd new file mode 100644 index 00000000..60188223 --- /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 \frac{\left( 1 - e^{- k t} \right)}{ k t} $$ + +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} = \frac{\left( 1 - e^{- k t} \right)}{k t} $$ + +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) $$ + diff --git a/vignettes/twa.html b/vignettes/twa.html new file mode 100644 index 00000000..6861d9fc --- /dev/null +++ b/vignettes/twa.html @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + +Calculation of time weighted average concentrations with mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +

    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 (FOCUS Work Group on Degradation Kinetics 2014, 251):

    +

    SFO:

    +

    \[c_\textrm{twa} = c_0 \frac{\left( 1 - e^{- k t} \right)}{ k t} \]

    +

    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} = \frac{\left( 1 - e^{- k t} \right)}{k t} \]

    +

    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) \]

    +
    +
    +

    FOCUS Work Group on Degradation Kinetics. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://focus.jrc.ec.europa.eu/dk.

    +
    +
    + + + + +
    + + + + + + + + diff --git a/vignettes/twa.pdf b/vignettes/twa.pdf deleted file mode 100644 index 879d10c7..00000000 Binary files a/vignettes/twa.pdf and /dev/null differ diff --git a/vignettes/twa.rmd b/vignettes/twa.rmd deleted file mode 100644 index 60188223..00000000 --- a/vignettes/twa.rmd +++ /dev/null @@ -1,57 +0,0 @@ ---- -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 \frac{\left( 1 - e^{- k t} \right)}{ k t} $$ - -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} = \frac{\left( 1 - e^{- k t} \right)}{k t} $$ - -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