diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2016-11-17 18:14:32 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2016-11-17 18:23:31 +0100 |
commit | f3f415520c89f9d8526bf6fadc862ebd44be220d (patch) | |
tree | e80d26e3b4f56ebe872888bed8f01a21d49b7ff4 /vignettes/mkin.Rmd | |
parent | f52fffd9eab13b7902bf767dd9cd7f0e7abf8069 (diff) |
Remove trailing whitespace, clean headers
Also ignore test.R in the top level directory, as it is not meant to
be public
Diffstat (limited to 'vignettes/mkin.Rmd')
-rw-r--r-- | vignettes/mkin.Rmd | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/vignettes/mkin.Rmd b/vignettes/mkin.Rmd index a3982df9..062bfdac 100644 --- a/vignettes/mkin.Rmd +++ b/vignettes/mkin.Rmd @@ -26,8 +26,8 @@ opts_chunk$set(engine='R', tidy=FALSE) # Abstract 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 has been developed, based on nonlinear optimisation. +important role. For the evaluation of pesticide degradation experiments, +detailed guidance has been developed, based on nonlinear optimisation. The `R` add-on package `mkin` [@pkg:mkin] implements fitting some of the models recommended in this guidance from within R and calculates some statistical measures for data series within one or more compartments, for parent and @@ -38,23 +38,23 @@ library(mkin) # Define the kinetic model m_SFO_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"), M1 = mkinsub("SFO", "M2"), - M2 = mkinsub("SFO"), + M2 = mkinsub("SFO"), use_of_ff = "max", quiet = TRUE) # Produce model predictions using some arbitrary parameters sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) d_SFO_SFO_SFO <- mkinpredict(m_SFO_SFO_SFO, - c(k_parent = 0.03, - f_parent_to_M1 = 0.5, k_M1 = log(2)/100, + c(k_parent = 0.03, + f_parent_to_M1 = 0.5, k_M1 = log(2)/100, f_M1_to_M2 = 0.9, k_M2 = log(2)/50), c(parent = 100, M1 = 0, M2 = 0), sampling_times) -# Generate a dataset by adding normally distributed errors with +# Generate a dataset by adding normally distributed errors with # standard deviation 3, for two replicates at each sampling time d_SFO_SFO_SFO_err <- add_err(d_SFO_SFO_SFO, reps = 2, - sdfunc = function(x) 3, + sdfunc = function(x) 3, n = 1, seed = 123456789 ) # Fit the model to the dataset @@ -67,7 +67,7 @@ plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright", "bottomright")) # Background Many approaches are possible regarding the evaluation of chemical degradation -data. +data. The now deprecated `kinfit` package [@pkg:kinfit] in `R` [@rcore2016] implements the approach recommended in the kinetics report provided by the @@ -91,10 +91,10 @@ models based on differential equations to data. The code was first uploaded to the BerliOS platform. When this was taken down, the version control history was imported into the R-Forge site, where the code -is still mirrored today (see *e.g.* +is still mirrored today (see *e.g.* [the initial commit on 11 May 2010](http://cgit.jrwb.de/mkin/commit/?id=30cbb4092f6d2d3beff5800603374a0d009ad770)). -At that time, the R package `FME` (Flexible Modelling Environment) +At that time, the R package `FME` (Flexible Modelling Environment) [@soetaert2010] was already available, and provided a good basis for developing a package specifically tailored to the task. The remaining challenge was to make it as easy as possible for the users (including the author of this @@ -133,16 +133,16 @@ but until 2014, only simple first-order models could be specified for transformation products. Starting with KinGUII version 2.1, biphasic modelling of metabolites was also available in KinGUII. -A further graphical user interface (GUI) that has recently been brought to a decent -degree of maturity is the browser based GUI named `gmkin`. Please see its -[documentation page](http://kinfit.r-forge.r-project.org/gmkin_static) and +A further graphical user interface (GUI) that has recently been brought to a decent +degree of maturity is the browser based GUI named `gmkin`. Please see its +[documentation page](http://kinfit.r-forge.r-project.org/gmkin_static) and [manual](http://kinfit.r-forge.r-project.org/gmkin_static/vignettes/gmkin_manual.html) for further information. ## Recent developments Currently (June 2016), the main features available in `mkin` which are -not present in KinGUII or CAKE, are the speed increase by using compiled code when +not present in KinGUII or CAKE, are the speed increase by using compiled code when a compiler is present, parallel model fitting on multicore machines using the `mmkin` function, and the estimation of parameter confidence intervals based on transformed parameters. These are explained in more detail below. @@ -156,9 +156,9 @@ constants [compare @bates1988, p. 135], *i.e.* for their logarithms. Confidence intervals for the rate constants are then obtained using the appropriate backtransformation using the exponential function. -In the first version of `mkin` allowing for specifying models using +In the first version of `mkin` allowing for specifying models using formation fractions, a home-made reparameterisation was used in order to ensure -that the sum of formation fractions would not exceed unity. +that the sum of formation fractions would not exceed unity. This method is still used in the current version of KinGUII (v2.1 from April 2014), with a modification that allows for fixing the pathway to sink to zero. @@ -175,7 +175,7 @@ confidence intervals. ## Confidence intervals based on transformed parameters In the first attempt at providing improved parameter confidence intervals -introduced to `mkin` in 2013, confidence intervals obtained from +introduced to `mkin` in 2013, confidence intervals obtained from FME on the transformed parameters were simply all backtransformed one by one to yield asymetric confidence intervals for the backtransformed parameters. @@ -186,14 +186,14 @@ fractions that quantify the paths to each of the compounds formed from a specific parent compound, and no such 1:1 relation exists. Therefore, parameter confidence intervals for formation fractions obtained with -this method only appear valid for the case of a single transformation product, where +this method only appear valid for the case of a single transformation product, where only one formation fraction is to be estimated, directly corresponding to one component of the ilr transformed parameter. -The confidence intervals obtained by backtransformation for the cases where a -1:1 relation between transformed and original parameter exist are considered by +The confidence intervals obtained by backtransformation for the cases where a +1:1 relation between transformed and original parameter exist are considered by the author of this vignette to be more accurate than those obtained using a -re-estimation of the Hessian matrix after backtransformation, as implemented +re-estimation of the Hessian matrix after backtransformation, as implemented in the FME package. ## Parameter t-test based on untransformed parameters @@ -208,7 +208,7 @@ of the estimator for the parameters, is not fulfilled in the case of nonlinear r [@ranke2015]. However, this test is commonly used by industry, consultants and national authorities in order to decide on the reliability of parameter estimates, based on the FOCUS guidance mentioned above. Therefore, the results of this one-sided -t-test are included in the summary output from `mkin`. +t-test are included in the summary output from `mkin`. As it is not reasonable to test for significant difference of the transformed parameters (*e.g.* $log(k)$) from zero, the t-test is calculated based on the |