From 01284e456dc6df8e064a7a42f194fcd81d9ce7a1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 12 May 2020 10:58:25 +0200 Subject: Improve documentation, now using a spell checker --- DESCRIPTION | 5 +- GNUmakefile | 2 + NEWS.md | 14 ++- R/add_err.R | 2 +- R/endpoints.R | 2 +- R/mkinfit.R | 2 +- R/mkinpredict.R | 2 +- R/parent_solutions.R | 2 +- R/transform_odeparms.R | 2 +- README.md | 4 +- build.log | 2 +- docs/404.html | 2 +- docs/articles/index.html | 2 +- docs/articles/mkin.html | 8 +- docs/authors.html | 2 +- docs/index.html | 6 +- docs/news/index.html | 21 +++- docs/pkgdown.yml | 2 +- docs/reference/add_err.html | 4 +- docs/reference/endpoints.html | 6 +- docs/reference/index.html | 2 +- docs/reference/logistic.solution.html | 4 +- docs/reference/mccall81_245T.html | 113 ++++++++--------- docs/reference/mkinfit.html | 42 +++---- docs/reference/mkinpredict.html | 14 +-- docs/reference/transform_odeparms.html | 6 +- inst/WORDLIST | 219 +++++++++++++++++++++++++++++++++ man/add_err.Rd | 2 +- man/endpoints.Rd | 2 +- man/logistic.solution.Rd | 2 +- man/mccall81_245T.Rd | 2 +- man/mkinfit.Rd | 2 +- man/mkinpredict.Rd | 2 +- man/transform_odeparms.Rd | 2 +- vignettes/mkin.Rmd | 4 +- vignettes/mkin.html | 8 +- 36 files changed, 370 insertions(+), 148 deletions(-) create mode 100644 inst/WORDLIST diff --git a/DESCRIPTION b/DESCRIPTION index 760d8207..018eb842 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data -Version: 0.9.50.1 -Date: 2020-05-11 +Version: 0.9.50.2 +Date: 2020-05-12 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de", comment = c(ORCID = "0000-0003-4371-6538")), @@ -24,6 +24,7 @@ License: GPL LazyLoad: yes LazyData: yes Encoding: UTF-8 +Language: en-GB VignetteBuilder: knitr BugReports: http://github.com/jranke/mkin/issues URL: https://pkgdown.jrwb.de/mkin diff --git a/GNUmakefile b/GNUmakefile index 830b998d..0c28f3c4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -21,6 +21,8 @@ pkgfiles = \ .Rbuildignore \ data/* \ DESCRIPTION \ + inst/WORDLIST \ + inst/testdata/fit_old_FOCUS_D.rda \ man/* \ NAMESPACE \ NEWS.md \ diff --git a/NEWS.md b/NEWS.md index 49828447..3867320e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,10 @@ -# mkin 0.9.50.1 (unreleased) +# mkin 0.9.50.2 (2020-05-12) + +- Increase tolerance for a platform specific test results on the Solaris test machine on CRAN + +- Updates and corrections (using the spelling package) to the documentation + +# mkin 0.9.50.1 (2020-05-11) - Support SFORB with formation fractions @@ -400,7 +406,7 @@ - The FOCUS_Z vignette was rebuilt with the above improvement and using a width of 70 to avoid output outside of the grey area -- `print.summary.mkinfit()`: Avoid a warning that occurred when gmkin showed summaries ofinitial fits without iterations +- `print.summary.mkinfit()`: Avoid a warning that occurred when gmkin showed summaries of initial fits without iterations - `mkinfit()`: Avoid a warning that occurred when summarising a fit that was performed with maxitmodFit = 0 as done in gmkin for configuring new fits. @@ -422,7 +428,7 @@ ## Bug fixes -- Avoid plotting an artifical 0 residual at time zero in `mkinresplot` +- Avoid plotting an artificial 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. @@ -512,7 +518,7 @@ - Remove warning about constant formation fractions in mkinmod as it was based on a misconception -- Restrict the unit test with the Schaefer data to parent and primary metabolites as formation fraction and DT50 for A2 are higly correlated and passing the test is platform dependent. For example, the test fails in 1 out of 14 platforms on CRAN as of today. +- Restrict the unit test with the Schaefer data to parent and primary metabolites as formation fraction and DT50 for A2 are highly correlated and passing the test is platform dependent. For example, the test fails in 1 out of 14 platforms on CRAN as of today. - Add Eurofins Regulatory AG copyright notices diff --git a/R/add_err.R b/R/add_err.R index 9235223f..d2092a84 100644 --- a/R/add_err.R +++ b/R/add_err.R @@ -25,7 +25,7 @@ #' @references Ranke J and Lehmann R (2015) To t-test or not to t-test, that is #' the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, #' Piacenza, Italy -#' http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf +#' https://jrwb.de/posters/piacenza_2015.pdf #' @examples #' #' # The kinetic model diff --git a/R/endpoints.R b/R/endpoints.R index 586ef9ff..cccd2ff7 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -4,7 +4,7 @@ #' This function calculates DT50 and DT90 values as well as formation fractions #' from kinetic models fitted with mkinfit. If the SFORB model was specified #' for one of the parents or metabolites, the Eigenvalues are returned. These -#' are equivalent to the rate constantes of the DFOP model, but with the +#' are equivalent to the rate constants of the DFOP model, but with the #' advantage that the SFORB model can also be used for metabolites. #' #' @param fit An object of class \code{\link{mkinfit}} or diff --git a/R/mkinfit.R b/R/mkinfit.R index c796f06f..0f478910 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -4,7 +4,7 @@ if(getRversion() >= '2.15.1') utils::globalVariables(c("name", "time", "value")) #' #' This function maximises the likelihood of the observed data using the Port #' algorithm \code{\link{nlminb}}, and the specified initial or fixed -#' parameters and starting values. In each step of the optimsation, the +#' parameters and starting values. In each step of the optimisation, the #' kinetic model is solved using the function \code{\link{mkinpredict}}. The #' parameters of the selected error model are fitted simultaneously with the #' degradation model parameters, as both of them are arguments of the diff --git a/R/mkinpredict.R b/R/mkinpredict.R index 90cd45fb..938d3488 100644 --- a/R/mkinpredict.R +++ b/R/mkinpredict.R @@ -11,7 +11,7 @@ #' @param odeparms A numeric vector specifying the parameters used in the #' kinetic model, which is generally defined as a set of ordinary #' differential equations. -#' @param odeini A numeric vectory containing the initial values of the state +#' @param odeini A numeric vector containing the initial values of the state #' variables of the model. Note that the state variables can differ from the #' observed variables, for example in the case of the SFORB model. #' @param outtimes A numeric vector specifying the time points for which model diff --git a/R/parent_solutions.R b/R/parent_solutions.R index e02bcda7..04226b73 100644 --- a/R/parent_solutions.R +++ b/R/parent_solutions.R @@ -191,7 +191,7 @@ SFORB.solution = function(t, parent_0, k_12, k_21, k_1output) { #' @family parent solutions #' @inherit SFO.solution #' @param kmax Maximum rate constant. -#' @param k0 Minumum rate constant effective at time zero. +#' @param k0 Minimum rate constant effective at time zero. #' @param r Growth rate of the increase in the rate constant. #' @note The solution of the logistic model reduces to the #' \code{\link{SFO.solution}} if \code{k0} is equal to \code{kmax}. diff --git a/R/transform_odeparms.R b/R/transform_odeparms.R index 28e58f87..8f6eb57f 100644 --- a/R/transform_odeparms.R +++ b/R/transform_odeparms.R @@ -2,7 +2,7 @@ #' #' The transformations are intended to map parameters that should only take on #' restricted values to the full scale of real numbers. For kinetic rate -#' constants and other paramters that can only take on positive values, a +#' constants and other parameters that can only take on positive values, a #' simple log transformation is used. For compositional parameters, such as the #' formations fractions that should always sum up to 1 and can not be negative, #' the \code{\link{ilr}} transformation is used. diff --git a/README.md b/README.md index 6da9244d..bb26fc66 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ detailed guidance and helpful tools have been developed as detailed in ## Usage -For a start, have a look a the code examples provided for +For a start, have a look at the code examples provided for [`plot.mkinfit`](https://pkgdown.jrwb.de/mkin/reference/plot.mkinfit.html) and [`plot.mmkin`](https://pkgdown.jrwb.de/mkin/reference/plot.mmkin.html), and @@ -146,7 +146,7 @@ The first `mkin` code was 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 +KinGUII whose R code is based on `mkin`, but which added, among 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 diff --git a/build.log b/build.log index 4c64021a..bd53dcee 100644 --- a/build.log +++ b/build.log @@ -5,5 +5,5 @@ * creating vignettes ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories -* building ‘mkin_0.9.50.1.tar.gz’ +* building ‘mkin_0.9.50.2.tar.gz’ diff --git a/docs/404.html b/docs/404.html index afb82b3f..29b71104 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/articles/index.html b/docs/articles/index.html index 5179c1bc..6f97722c 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -71,7 +71,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html index b828b7dc..0d4ced0f 100644 --- a/docs/articles/mkin.html +++ b/docs/articles/mkin.html @@ -31,7 +31,7 @@ mkin - 0.9.50 + 0.9.50.2 @@ -97,7 +97,7 @@

Introduction to mkin

Johannes Ranke

-

2020-05-11

+

2020-05-12

Source: vignettes/mkin.Rmd @@ -156,7 +156,7 @@ Derived software tools

Soon after the publication of mkin, two derived tools were published, namely KinGUII (available from Bayer Crop Science) and CAKE (commissioned to Tessella by Syngenta), which added a graphical user interface (GUI), and added fitting by iteratively reweighted least squares (IRLS) and characterisation of likely parameter distributions by Markov Chain Monte Carlo (MCMC) sampling.

CAKE focuses on a smooth use experience, sacrificing some flexibility in the model definition, originally allowing only two primary metabolites in parallel. The current version 3.3 of CAKE release in March 2016 uses a basic scheme for up to six metabolites in a flexible arrangement, but does not support back-reactions (non-instantaneous equilibria) or biphasic kinetics for metabolites.

-

KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instanteneous equilibria) were supported early on, 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.

+

KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instantaneous equilibria) were supported early on, 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 and manual for further information.

A comparison of scope, usability and numerical results obtained with these tools has been recently been published by Ranke, Wöltjen, and Meinecke (2018).

@@ -177,7 +177,7 @@

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 FME on the transformed parameters were simply all backtransformed one by one to yield asymetric confidence intervals for the backtransformed parameters.

+

In the first attempt at providing improved parameter confidence intervals introduced to mkin in 2013, confidence intervals obtained from FME on the transformed parameters were simply all backtransformed one by one to yield asymmetric confidence intervals for the backtransformed parameters.

However, while there is a 1:1 relation between the rate constants in the model and the transformed parameters fitted in the model, the parameters obtained by the isometric logratio transformation are calculated from the set of formation 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 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 author of this vignette to be more accurate than those obtained using a re-estimation of the Hessian matrix after backtransformation, as implemented in the FME package.

diff --git a/docs/authors.html b/docs/authors.html index 5ec134d6..c445f8dc 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@ mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/index.html b/docs/index.html index 37ed972a..ce5d6a9a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -37,7 +37,7 @@ mkin - 0.9.50.1 + 0.9.50.2 @@ -118,7 +118,7 @@

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.

+

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

@@ -163,7 +163,7 @@

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, among 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.

diff --git a/docs/news/index.html b/docs/news/index.html index 2874175c..2795b09b 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -71,7 +71,7 @@ mkin - 0.9.50.1 + 0.9.50.2 @@ -138,9 +138,18 @@ Source: NEWS.md -
+
+

+mkin 0.9.50.2 (2020-05-12) Unreleased +

+
    +
  • Increase tolerance for a platform specific test results on the Solaris test machine on CRAN

  • +
  • Updates and corrections (using the spelling package) to the documentation

  • +
+
+

-mkin 0.9.50.1 (unreleased) 2020-05-11 +mkin 0.9.50.1 (2020-05-11) 2020-05-11

  • Support SFORB with formation fractions

  • @@ -631,7 +640,7 @@
    • The formatting of differential equations in the summary was improved by wrapping overly long lines

    • The FOCUS_Z vignette was rebuilt with the above improvement and using a width of 70 to avoid output outside of the grey area

    • -
    • print.summary.mkinfit(): Avoid a warning that occurred when gmkin showed summaries ofinitial fits without iterations

    • +
    • print.summary.mkinfit(): Avoid a warning that occurred when gmkin showed summaries of initial fits without iterations

    • mkinfit(): Avoid a warning that occurred when summarising a fit that was performed with maxitmodFit = 0 as done in gmkin for configuring new fits.

@@ -656,7 +665,7 @@

Bug fixes

@@ -211,7 +211,7 @@ components of the list are datasets compatible with Ranke J and Lehmann R (2015) To t-test or not to t-test, that is the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, Piacenza, Italy -http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf

+https://jrwb.de/posters/piacenza_2015.pdf

Examples

diff --git a/docs/reference/endpoints.html b/docs/reference/endpoints.html index 05d65191..d9c43f84 100644 --- a/docs/reference/endpoints.html +++ b/docs/reference/endpoints.html @@ -45,7 +45,7 @@ with mkinfit — endpoints" /> @@ -78,7 +78,7 @@ advantage that the SFORB model can also be used for metabolites." /> mkin - 0.9.50.1 + 0.9.50.2
@@ -151,7 +151,7 @@ with mkinfit

This function calculates DT50 and DT90 values as well as formation fractions from kinetic models fitted with mkinfit. If the SFORB model was specified for one of the parents or metabolites, the Eigenvalues are returned. These -are equivalent to the rate constantes of the DFOP model, but with the +are equivalent to the rate constants of the DFOP model, but with the advantage that the SFORB model can also be used for metabolites.

diff --git a/docs/reference/index.html b/docs/reference/index.html index ed6debdd..961352e0 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -71,7 +71,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/logistic.solution.html b/docs/reference/logistic.solution.html index 9907297c..4820d25f 100644 --- a/docs/reference/logistic.solution.html +++ b/docs/reference/logistic.solution.html @@ -73,7 +73,7 @@ an increasing rate constant, supposedly caused by microbial growth" /> mkin - 0.9.50.1 + 0.9.50.2 @@ -165,7 +165,7 @@ an increasing rate constant, supposedly caused by microbial growth

k0 -

Minumum rate constant effective at time zero.

+

Minimum rate constant effective at time zero.

r diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html index ce2d40cd..06fcd79e 100644 --- a/docs/reference/mccall81_245T.html +++ b/docs/reference/mccall81_245T.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
@@ -115,7 +118,12 @@
@@ -145,7 +153,7 @@

Format

-

A dataframe containing the following variables.

+

A dataframe containing the following variables.

name

the name of the compound observed. Note that T245 is used as an acronym for 2,4,5-T. T245 is a legitimate object name in R, which is necessary for specifying models using @@ -159,34 +167,31 @@

Source

-

McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labeled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 +

McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labelled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 http://dx.doi.org/10.1021/jf00103a026

Examples

SFO_SFO_SFO <- mkinmod(T245 = list(type = "SFO", to = "phenol"), phenol = list(type = "SFO", to = "anisole"), anisole = list(type = "SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# \dontrun{ - fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(fit.1)$bpar
#> Warning: NaNs wurden erzeugt
#> Estimate se_notrans t value Pr(>t) Lower -#> T245_0 1.038550e+02 2.1508110557 48.286452 3.542232e-18 99.246062215 -#> k_T245_sink 1.636106e-02 NaN NaN NaN 0.012661558 -#> k_T245_phenol 2.700936e-02 NaN NaN NaN 0.024487315 -#> k_phenol_sink 1.788604e-10 NaN NaN NaN 0.000000000 -#> k_phenol_anisole 4.050581e-01 0.1053801116 3.843781 7.970202e-04 0.218013982 -#> k_anisole_sink 6.678742e-03 0.0006205844 10.762020 9.428076e-09 0.005370739 -#> sigma 2.514628e+00 0.3383670685 7.431657 1.054101e-06 1.706607296 -#> Upper -#> T245_0 1.084640e+02 -#> k_T245_sink 2.114150e-02 -#> k_T245_phenol 2.979116e-02 -#> k_phenol_sink Inf -#> k_phenol_anisole 7.525759e-01 -#> k_anisole_sink 8.305299e-03 -#> sigma 3.322649e+00
endpoints(fit.1)
#> $ff -#> T245_sink T245_phenol phenol_sink phenol_anisole anisole_sink -#> 3.772401e-01 6.227599e-01 4.415672e-10 1.000000e+00 1.000000e+00 -#> -#> $SFORB -#> logical(0) + fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(fit.1)$bpar
#> Estimate se_notrans t value Pr(>t) +#> T245_0 1.038550e+02 2.184707514 47.537272 4.472189e-18 +#> k_T245 4.337042e-02 0.001898397 22.845818 2.276912e-13 +#> k_phenol 4.050581e-01 0.298699428 1.356073 9.756994e-02 +#> k_anisole 6.678742e-03 0.000802144 8.326114 2.623179e-07 +#> f_T245_to_phenol 6.227599e-01 0.398534167 1.562626 6.949418e-02 +#> f_phenol_to_anisole 1.000000e+00 0.671844168 1.488440 7.867794e-02 +#> sigma 2.514628e+00 0.490755943 5.123989 6.233164e-05 +#> Lower Upper +#> T245_0 99.246061371 1.084640e+02 +#> k_T245 0.039631621 4.746194e-02 +#> k_phenol 0.218013878 7.525762e-01 +#> k_anisole 0.005370739 8.305299e-03 +#> f_T245_to_phenol 0.547559082 6.924813e-01 +#> f_phenol_to_anisole 0.000000000 1.000000e+00 +#> sigma 1.706607296 3.322649e+00
endpoints(fit.1)
#> $ff +#> T245_phenol T245_sink phenol_anisole phenol_sink +#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 #> #> $distimes #> DT50 DT90 @@ -196,42 +201,22 @@ #>
# k_phenol_sink is really small, therefore fix it to zero fit.2 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), parms.ini = c(k_phenol_sink = 0), - fixed_parms = "k_phenol_sink", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(fit.2)$bpar
#> Estimate se_notrans t value Pr(>t) Lower -#> T245_0 1.038550e+02 2.1623653063 48.028441 4.993105e-19 99.271025146 -#> k_T245_sink 1.636106e-02 0.0019676255 8.315130 1.673674e-07 0.012679148 -#> k_T245_phenol 2.700936e-02 0.0012421966 21.743224 1.314080e-13 0.024500319 -#> k_phenol_anisole 4.050581e-01 0.1177235488 3.440757 1.679237e-03 0.218746679 -#> k_anisole_sink 6.678742e-03 0.0006829745 9.778904 1.872892e-08 0.005377084 -#> sigma 2.514628e+00 0.3790944250 6.633250 2.875782e-06 1.710983655 -#> Upper -#> T245_0 108.43904395 -#> k_T245_sink 0.02111217 -#> k_T245_phenol 0.02977535 -#> k_phenol_anisole 0.75005504 -#> k_anisole_sink 0.00829550 -#> sigma 3.31827222
endpoints(fit.1)
#> $ff -#> T245_sink T245_phenol phenol_sink phenol_anisole anisole_sink -#> 3.772401e-01 6.227599e-01 4.415672e-10 1.000000e+00 1.000000e+00 -#> -#> $SFORB -#> logical(0) + fixed_parms = "k_phenol_sink", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
#> Warning: Initial parameter(s) k_phenol_sink not used in the model
#> Error in data.frame(value = c(state.ini.fixed, parms.fixed)): Zeilennamen enthalten fehlende Werte
summary(fit.2)$bpar
#> Error in summary(fit.2): Objekt 'fit.2' nicht gefunden
endpoints(fit.1)
#> $ff +#> T245_phenol T245_sink phenol_anisole phenol_sink +#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 #> #> $distimes #> DT50 DT90 #> T245 15.982025 53.09114 #> phenol 1.711229 5.68458 #> anisole 103.784092 344.76329 -#>
plot_sep(fit.2)
# } +#>
plot_sep(fit.2)
#> Error in identical(fit$err_mod, "const"): Objekt 'fit.2' nicht gefunden
# }
- @@ -242,7 +227,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index ceac59bf..5d8dd81c 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -42,7 +42,7 @@ mkin - 0.9.50.1 + 0.9.50.2 @@ -149,7 +149,7 @@ likelihood function." />

This function maximises the likelihood of the observed data using the Port algorithm nlminb, and the specified initial or fixed -parameters and starting values. In each step of the optimsation, the +parameters and starting values. In each step of the optimisation, the kinetic model is solved using the function mkinpredict. The parameters of the selected error model are fitted simultaneously with the degradation model parameters, as both of them are arguments of the @@ -420,17 +420,17 @@ Degradation Data. Environments 6(12) 124

# Use shorthand notation for parent only degradation fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) -summary(fit)
#> mkin version used for fitting: 0.9.50.1 +summary(fit)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 08:36:07 2020 -#> Date of summary: Tue May 12 08:36:07 2020 +#> Date of fit: Tue May 12 10:55:39 2020 +#> Date of summary: Tue May 12 10:55:39 2020 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 222 model solutions performed in 0.047 s +#> Fitted using 222 model solutions performed in 0.043 s #> #> Error model: Constant variance #> @@ -507,7 +507,7 @@ Degradation Data. Environments 6(12) 124 m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> User System verstrichen -#> 0.408 0.008 0.416
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.408 0.001 0.410
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma #> 99.598483222 0.098697734 0.005260651 0.514475962 3.125503875
#> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -597,7 +597,7 @@ Degradation Data. Environments 6(12) 124 #> Sum of squared residuals at call 166: 371.2134 #> Sum of squared residuals at call 168: 371.2134 #> Negative log-likelihood at call 178: 97.22429
#> Optimisation successfully terminated.
#> User System verstrichen -#> 0.350 0.001 0.351
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.353 0.000 0.352
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma #> 99.598480759 0.098697739 0.005260651 0.514475958 3.125503874
endpoints(fit.deSolve)
#> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -629,10 +629,10 @@ Degradation Data. Environments 6(12) 124 # \dontrun{ # Weighted fits, including IRLS (error_model = "obs") SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.noweight)
#> mkin version used for fitting: 0.9.50.1 + m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.noweight)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 08:36:12 2020 -#> Date of summary: Tue May 12 08:36:12 2020 +#> Date of fit: Tue May 12 10:55:44 2020 +#> Date of summary: Tue May 12 10:55:44 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -640,7 +640,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 421 model solutions performed in 0.146 s +#> Fitted using 421 model solutions performed in 0.147 s #> #> Error model: Constant variance #> @@ -751,10 +751,10 @@ Degradation Data. Environments 6(12) 124 #> 100 m1 31.04 31.98163 -9.416e-01 #> 100 m1 33.13 31.98163 1.148e+00 #> 120 m1 25.15 28.78984 -3.640e+00 -#> 120 m1 33.31 28.78984 4.520e+00
f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.obs)
#> mkin version used for fitting: 0.9.50.1 +#> 120 m1 33.31 28.78984 4.520e+00
f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.obs)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 08:36:13 2020 -#> Date of summary: Tue May 12 08:36:13 2020 +#> Date of fit: Tue May 12 10:55:44 2020 +#> Date of summary: Tue May 12 10:55:44 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -762,7 +762,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 978 model solutions performed in 0.337 s +#> Fitted using 978 model solutions performed in 0.334 s #> #> Error model: Variance unique to each observed variable #> @@ -888,10 +888,10 @@ Degradation Data. Environments 6(12) 124 #> 100 m1 31.04 31.98773 -9.477e-01 #> 100 m1 33.13 31.98773 1.142e+00 #> 120 m1 25.15 28.80429 -3.654e+00 -#> 120 m1 33.31 28.80429 4.506e+00
f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.tc)
#> mkin version used for fitting: 0.9.50.1 +#> 120 m1 33.31 28.80429 4.506e+00
f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.tc)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 08:36:14 2020 -#> Date of summary: Tue May 12 08:36:14 2020 +#> Date of fit: Tue May 12 10:55:45 2020 +#> Date of summary: Tue May 12 10:55:45 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -899,7 +899,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 1875 model solutions performed in 0.647 s +#> Fitted using 1875 model solutions performed in 0.643 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index e48a0cdb..3035e03e 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -74,7 +74,7 @@ kinetic parameters and initial values for the state variables." /> mkin - 0.9.50 + 0.9.50.2
@@ -209,7 +209,7 @@ differential equations.

odeini -

A numeric vectory containing the initial values of the state +

A numeric vector containing the initial values of the state variables of the model. Note that the state variables can differ from the observed variables, for example in the case of the SFORB model.

@@ -396,11 +396,11 @@ solver is used.

c(k_parent = 0.15, f_parent_to_m1 = 0.5, k_m1 = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "analytical", use_compiled = FALSE)[201,]) -}
#> test relative elapsed -#> 4 analytical 1.00 0.004 -#> 2 deSolve_compiled 1.25 0.005 -#> 1 eigen 5.00 0.020 -#> 3 deSolve 54.25 0.217
+}
#> Lade nötiges Paket: rbenchmark
#> test relative elapsed +#> 4 analytical 1.0 0.005 +#> 2 deSolve_compiled 1.2 0.006 +#> 1 eigen 4.0 0.020 +#> 3 deSolve 43.8 0.219
# \dontrun{ # Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C, quiet = TRUE) diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index fc0ffef2..185a8a64 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -42,7 +42,7 @@ @@ -77,7 +77,7 @@ the ilr transformation is used." /> mkin - 0.9.50.1 + 0.9.50.2
@@ -148,7 +148,7 @@ the ilr transformation is used." />

The transformations are intended to map parameters that should only take on restricted values to the full scale of real numbers. For kinetic rate -constants and other paramters that can only take on positive values, a +constants and other parameters that can only take on positive values, a simple log transformation is used. For compositional parameters, such as the formations fractions that should always sum up to 1 and can not be negative, the ilr transformation is used.

diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 00000000..895550ba --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,219 @@ +AAM +Agric +als +anova +AR +autogenerated +autogeneration +aw +backtransform +Backtransform +backtransformation +backtransformed +BayerCropScience +Berater +BerliOS +bpar +bparms +bremen +calulations +cf +CFuncList +cfunction +ChangeLog +cloneable +CMD +codecov +Colors +confint +const +cran +csf +cutoff +Defauls +DegKin +degparms +deSolve +DFOP +DI +dichlorophenoxyacetic +diethylether +distimes +DM +doi +ds +DT +EFSA +eigen +errmin +errmod +errplot +ethofumesate +Ethofumesate +etics +Eurofins +Filzmoser +FME +FOMC +FOrum +fourstep +frac +Fragoulis +gcc +Geosci +github +glyphosate +Glyphosate +gmkin +Grenzach +hessians +Hron +HS +IKF +ilr +ILR +imazamox +Imazamox +ini +inital +IORE +irls +IRLS +isofetamid +Isofetamid +jrwb +Karel +Karline +KineticEval +kinfit +KinGUI +KinGUII +knitr +KP +Kronacher +Kullback +Leibler +Levenberg +linux +lmtest +LOD +loftest +logLik +logratio +LOQ +Lorenzato +LR +lrtest +lsoda +Marquardt +Math +MatLab +maxitmodFit +md +Meinecke +Mikolasch +mkinds +mkinerrplot +mkinfit +mkinmod +mkinparplot +mkinpredict +mkinresplot +mmkin +Modellierungssoftware +ModelMaker +Moolgavkar +Multimodel +nafta +NAFTA +nlme +nlminb +nls +nobs +nonlinear +Nonlinear +numDeriv +Nvim +obs +ODEs +oftentimes +ORCID +overparameterisation +overparameterised +parms +Pawitan +PEC +PestDF +pfm +piacenza +Piacenza +pkgbuild +Privatdozent +Projektnummer +Prüfung +radiolabel +radiolabels +Rainbird +RAR +RCC +reparameterisation +res +resplot +reweight +reweighting +rl +Rocke +roxygen +Rprofile +rsd +Rtools +RUnit +Sanco +Schäfer +sep +SFO +SFORB +Soetaert +speclist +Str +Syngenta +Sys +tb +tc +Technometrics +Tessella +testthat +tex +textrm +texttt +thifensulfuron +Thifensulfuron +threestep +Topfit +topright +trichloroanisole +trichlorophenol +trichlorophenoxyacetic +Trichlorophenoxyacetic +twa +TWAs +twocomp +twostep +UBA +ulticompartment +Umweltbundesamt +uncompiled +und +unixoid +USe +Validierung +var +Venzon +Vrona +winbuilder +Wissenschaftlicher +workgroup +Workgroup +Wyhlen +ylim +zu diff --git a/man/add_err.Rd b/man/add_err.Rd index 1171e0fd..9527d508 100644 --- a/man/add_err.Rd +++ b/man/add_err.Rd @@ -96,7 +96,7 @@ plot(f_SFO_SFO[1, 3]) Ranke J and Lehmann R (2015) To t-test or not to t-test, that is the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, Piacenza, Italy -http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf +https://jrwb.de/posters/piacenza_2015.pdf } \author{ Johannes Ranke diff --git a/man/endpoints.Rd b/man/endpoints.Rd index 49f44d74..2b189a4f 100644 --- a/man/endpoints.Rd +++ b/man/endpoints.Rd @@ -21,7 +21,7 @@ of these SFORB models, equivalent to DFOP rate constants This function calculates DT50 and DT90 values as well as formation fractions from kinetic models fitted with mkinfit. If the SFORB model was specified for one of the parents or metabolites, the Eigenvalues are returned. These -are equivalent to the rate constantes of the DFOP model, but with the +are equivalent to the rate constants of the DFOP model, but with the advantage that the SFORB model can also be used for metabolites. } \note{ diff --git a/man/logistic.solution.Rd b/man/logistic.solution.Rd index efa12e7a..22944098 100644 --- a/man/logistic.solution.Rd +++ b/man/logistic.solution.Rd @@ -13,7 +13,7 @@ logistic.solution(t, parent_0, kmax, k0, r) \item{kmax}{Maximum rate constant.} -\item{k0}{Minumum rate constant effective at time zero.} +\item{k0}{Minimum rate constant effective at time zero.} \item{r}{Growth rate of the increase in the rate constant.} } diff --git a/man/mccall81_245T.Rd b/man/mccall81_245T.Rd index 00a05781..fe8dfcc6 100644 --- a/man/mccall81_245T.Rd +++ b/man/mccall81_245T.Rd @@ -24,7 +24,7 @@ } } \source{ - McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labeled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 + McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labelled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 \url{http://dx.doi.org/10.1021/jf00103a026} } \examples{ diff --git a/man/mkinfit.Rd b/man/mkinfit.Rd index 97dffef7..5a2b3e53 100644 --- a/man/mkinfit.Rd +++ b/man/mkinfit.Rd @@ -199,7 +199,7 @@ obtained by \code{\link{summary.mkinfit}}. \description{ This function maximises the likelihood of the observed data using the Port algorithm \code{\link{nlminb}}, and the specified initial or fixed -parameters and starting values. In each step of the optimsation, the +parameters and starting values. In each step of the optimisation, the kinetic model is solved using the function \code{\link{mkinpredict}}. The parameters of the selected error model are fitted simultaneously with the degradation model parameters, as both of them are arguments of the diff --git a/man/mkinpredict.Rd b/man/mkinpredict.Rd index 2c9192b7..17916356 100644 --- a/man/mkinpredict.Rd +++ b/man/mkinpredict.Rd @@ -57,7 +57,7 @@ parameters are used for the prediction.} kinetic model, which is generally defined as a set of ordinary differential equations.} -\item{odeini}{A numeric vectory containing the initial values of the state +\item{odeini}{A numeric vector containing the initial values of the state variables of the model. Note that the state variables can differ from the observed variables, for example in the case of the SFORB model.} diff --git a/man/transform_odeparms.Rd b/man/transform_odeparms.Rd index e250483a..a8efb7e6 100644 --- a/man/transform_odeparms.Rd +++ b/man/transform_odeparms.Rd @@ -53,7 +53,7 @@ names as the original parameters. \description{ The transformations are intended to map parameters that should only take on restricted values to the full scale of real numbers. For kinetic rate -constants and other paramters that can only take on positive values, a +constants and other parameters that can only take on positive values, a simple log transformation is used. For compositional parameters, such as the formations fractions that should always sum up to 1 and can not be negative, the \code{\link{ilr}} transformation is used. diff --git a/vignettes/mkin.Rmd b/vignettes/mkin.Rmd index 78fd098f..acca0e44 100644 --- a/vignettes/mkin.Rmd +++ b/vignettes/mkin.Rmd @@ -128,7 +128,7 @@ up to six metabolites in a flexible arrangement, but does not support back-reactions (non-instantaneous equilibria) or biphasic kinetics for metabolites. KinGUI offers an even more flexible widget for specifying complex kinetic -models. Back-reactions (non-instanteneous equilibria) were supported early on, +models. Back-reactions (non-instantaneous equilibria) were supported early on, 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. @@ -192,7 +192,7 @@ confidence intervals. In the first attempt at providing improved parameter confidence intervals 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. +to yield asymmetric confidence intervals for the backtransformed parameters. However, while there is a 1:1 relation between the rate constants in the model and the transformed parameters fitted in the model, the parameters obtained by the diff --git a/vignettes/mkin.html b/vignettes/mkin.html index 2ba360f4..28b3fa16 100644 --- a/vignettes/mkin.html +++ b/vignettes/mkin.html @@ -11,7 +11,7 @@ - + Introduction to mkin @@ -1583,7 +1583,7 @@ div.tocify {

Introduction to mkin

Johannes Ranke

-

2020-05-11

+

2020-05-12

@@ -1635,7 +1635,7 @@ plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright",

Derived software tools

Soon after the publication of mkin, two derived tools were published, namely KinGUII (available from Bayer Crop Science) and CAKE (commissioned to Tessella by Syngenta), which added a graphical user interface (GUI), and added fitting by iteratively reweighted least squares (IRLS) and characterisation of likely parameter distributions by Markov Chain Monte Carlo (MCMC) sampling.

CAKE focuses on a smooth use experience, sacrificing some flexibility in the model definition, originally allowing only two primary metabolites in parallel. The current version 3.3 of CAKE release in March 2016 uses a basic scheme for up to six metabolites in a flexible arrangement, but does not support back-reactions (non-instantaneous equilibria) or biphasic kinetics for metabolites.

-

KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instanteneous equilibria) were supported early on, 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.

+

KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instantaneous equilibria) were supported early on, 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 and manual for further information.

A comparison of scope, usability and numerical results obtained with these tools has been recently been published by Ranke, Wöltjen, and Meinecke (2018).

@@ -1653,7 +1653,7 @@ plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright",

In 2012, an alternative reparameterisation of the formation fractions was proposed together with René Lehmann (Ranke and Lehmann 2012), based on isometric logratio transformation (ILR). The aim was to improve the validity of the linear approximation of the objective function during the parameter estimation procedure as well as in the subsequent calculation of parameter 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 FME on the transformed parameters were simply all backtransformed one by one to yield asymetric confidence intervals for the backtransformed parameters.

+

In the first attempt at providing improved parameter confidence intervals introduced to mkin in 2013, confidence intervals obtained from FME on the transformed parameters were simply all backtransformed one by one to yield asymmetric confidence intervals for the backtransformed parameters.

However, while there is a 1:1 relation between the rate constants in the model and the transformed parameters fitted in the model, the parameters obtained by the isometric logratio transformation are calculated from the set of formation 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 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 author of this vignette to be more accurate than those obtained using a re-estimation of the Hessian matrix after backtransformation, as implemented in the FME package.

-- cgit v1.2.1