From 7094934f1061563725f6caa8723dc3e23c8ca677 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 16 Nov 2022 11:30:06 +0100 Subject: Update online docs --- docs/dev/articles/mkin.html | 81 +++++----- docs/dev/articles/web_only/saem_benchmarks.html | 24 +-- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/mkinmod.html | 195 +++++++++++++++--------- docs/dev/reference/mkinpredict.html | 2 +- docs/dev/reference/saem.html | 6 +- vignettes/web_only/saem_benchmarks.rda | Bin 359 -> 359 bytes 7 files changed, 183 insertions(+), 127 deletions(-) diff --git a/docs/dev/articles/mkin.html b/docs/dev/articles/mkin.html index 6bfb63bc..27e532af 100644 --- a/docs/dev/articles/mkin.html +++ b/docs/dev/articles/mkin.html @@ -34,7 +34,7 @@ mkin - 1.1.0 + 1.2.0 @@ -44,7 +44,7 @@ Functions and data
  • - Example evaluation of FOCUS Example Dataset Z + Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models +
  • +
  • + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -72,7 +78,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -103,7 +112,7 @@

    Introduction to mkin

    Johannes Ranke

    -

    Last change 15 February 2021 (rebuilt 2022-02-28)

    +

    Last change 15 February 2021 (rebuilt 2022-11-16)

    Source: vignettes/mkin.rmd @@ -118,34 +127,34 @@

    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. The R add-on package 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 metabolites.

    -library("mkin", quietly = TRUE)
    -# Define the kinetic model
    -m_SFO_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"),
    -                         M1 = mkinsub("SFO", "M2"),
    -                         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,
    -    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
    -# 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,
    -                             n = 1, seed = 123456789 )
    -
    -# Fit the model to the dataset
    -f_SFO_SFO_SFO <- mkinfit(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[1]], quiet = TRUE)
    -
    -# Plot the results separately for parent and metabolites
    -plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright", "bottomright"))
    +library("mkin", quietly = TRUE) +# Define the kinetic model +m_SFO_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"), + M1 = mkinsub("SFO", "M2"), + 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, + 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 +# 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, + n = 1, seed = 123456789 ) + +# Fit the model to the dataset +f_SFO_SFO_SFO <- mkinfit(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[1]], quiet = TRUE) + +# Plot the results separately for parent and metabolites +plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright", "bottomright"))

    @@ -224,10 +233,10 @@

    Ranke, J. 2021. ‘mkin‘: Kinetic Evaluation of Chemical Degradation Data. https://CRAN.R-project.org/package=mkin.

    -

    Ranke, J., and R. Lehmann. 2012. “Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.” In SETAC World 20-24 May. Berlin.

    +

    Ranke, J., and R. Lehmann. 2012. “Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.” In SETAC World 20-24 May. Berlin. https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf.

    -

    ———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In XV Symposium on Pesticide Chemistry 2-4 September 2015. Piacenza. http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf.

    +

    ———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In XV Symposium on Pesticide Chemistry 2-4 September 2015. Piacenza. https://jrwb.de/posters/piacenza_2015.pdf.

    Ranke, Johannes, and Stefan Meinecke. 2019. “Error Models for the Kinetic Evaluation of Chemical Degradation Data.” Environments 6 (12). https://doi.org/10.3390/environments6120124.

    @@ -262,7 +271,7 @@

    -

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/dev/articles/web_only/saem_benchmarks.html b/docs/dev/articles/web_only/saem_benchmarks.html index e54bc38c..afff038f 100644 --- a/docs/dev/articles/web_only/saem_benchmarks.html +++ b/docs/dev/articles/web_only/saem_benchmarks.html @@ -112,7 +112,7 @@

    Benchmark timings for saem.mmkin

    Johannes Ranke

    -

    Last change 14 November 2022 (rebuilt 2022-11-15)

    +

    Last change 14 November 2022 (rebuilt 2022-11-16)

    Source: vignettes/web_only/saem_benchmarks.rmd @@ -309,10 +309,10 @@ Linux 1.2.0 3.2 -2.11 -4.632 -4.264 -4.93 +2.156 +4.647 +4.296 +4.951

    Two-component error fits for SFO, DFOP, SFORB and HS.

    @@ -332,10 +332,10 @@ Linux 1.2.0 3.2 -5.602 -7.373 -7.815 -7.831 +5.645 +7.415 +7.848 +7.967
    @@ -357,8 +357,8 @@ Linux 1.2.0 3.2 -24.014 -749.699 +24.182 +783.932 @@ -379,7 +379,7 @@ Linux 1.2.0 3.2 -1249.834 +1322.5 diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index e0c11a84..85be66c4 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -13,7 +13,7 @@ articles: dimethenamid_2018: web_only/dimethenamid_2018.html multistart: web_only/multistart.html saem_benchmarks: web_only/saem_benchmarks.html -last_built: 2022-11-14T23:45Z +last_built: 2022-11-16T09:48Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html index 5d362f76..d0e192e7 100644 --- a/docs/dev/reference/mkinmod.html +++ b/docs/dev/reference/mkinmod.html @@ -21,7 +21,7 @@ components."> + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +

    The dimethenamid data from 2018 from seven soils is used as example data in this vignette.

    +
    +library(mkin)
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
    +  ds_i
    +})
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
    +dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
    +

    First, we check the DFOP model with the two-component error model and random effects for all degradation parameters.

    +
    +f_mmkin <- mmkin("DFOP", dmta_ds, error_model = "tc", cores = 7, quiet = TRUE)
    +f_saem_full <- saem(f_mmkin)
    +illparms(f_saem_full)
    +
    ## [1] "sd(log_k2)"
    +

    We see that not all variability parameters are identifiable. The illparms function tells us that the confidence interval for the standard deviation of ‘log_k2’ includes zero. We check this assessment using multiple runs with different starting values.

    +
    +f_saem_full_multi <- multistart(f_saem_full, n = 16, cores = 16)
    +parplot(f_saem_full_multi)
    +

    +

    This confirms that the variance of k2 is the most problematic parameter, so we reduce the parameter distribution model by removing the intersoil variability for k2.

    +
    +f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2")
    +illparms(f_saem_reduced)
    +f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cores = 16)
    +parplot(f_saem_reduced_multi, lpos = "topright")
    +

    +

    The results confirm that all remaining parameters can be determined with sufficient certainty.

    +

    We can also analyse the log-likelihoods obtained in the multiple runs:

    +
    +llhist(f_saem_reduced_multi)
    +

    +

    The parameter histograms can be further improved by excluding the result with the low likelihood.

    +
    +parplot(f_saem_reduced_multi, lpos = "topright", llmin = -326, ylim = c(0.5, 2))
    +

    +

    We can use the anova method to compare the models, including a likelihood ratio test if the models are nested.

    +
    +anova(f_saem_full, best(f_saem_reduced_multi), test = TRUE)
    +
    ## Data: 155 observations of 1 variable(s) grouped in 6 datasets
    +## 
    +##                            npar    AIC    BIC     Lik Chisq Df Pr(>Chisq)
    +## best(f_saem_reduced_multi)    9 663.69 661.82 -322.85                    
    +## f_saem_full                  10 669.77 667.69 -324.89     0  1          1
    +

    While AIC and BIC are lower for the reduced model, the likelihood ratio test does not indicate a significant difference between the fits.

    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.6.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/web_only/multistart_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/web_only/multistart_files/accessible-code-block-0.0.1/empty-anchor.js new file mode 100644 index 00000000..ca349fd6 --- /dev/null +++ b/docs/articles/web_only/multistart_files/accessible-code-block-0.0.1/empty-anchor.js @@ -0,0 +1,15 @@ +// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> +// v0.0.1 +// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. + +document.addEventListener('DOMContentLoaded', function() { + const codeList = document.getElementsByClassName("sourceCode"); + for (var i = 0; i < codeList.length; i++) { + var linkList = codeList[i].getElementsByTagName('a'); + for (var j = 0; j < linkList.length; j++) { + if (linkList[j].innerHTML === "") { + linkList[j].setAttribute('aria-hidden', 'true'); + } + } + } +}); diff --git a/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 00000000..28991ae8 Binary files /dev/null and b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 00000000..56147ae2 Binary files /dev/null and b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 00000000..7ce108a2 Binary files /dev/null and b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 00000000..00ccbaa8 Binary files /dev/null and b/docs/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/web_only/saem_benchmarks.html b/docs/articles/web_only/saem_benchmarks.html new file mode 100644 index 00000000..523d028c --- /dev/null +++ b/docs/articles/web_only/saem_benchmarks.html @@ -0,0 +1,417 @@ + + + + + + + +Benchmark timings for saem.mmkin • mkin + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +

    Each system is characterized by operating system type, CPU type, mkin version, saemix version and R version. A compiler was available, so if no analytical solution was available, compiled ODE models are used.

    +

    Every fit is only performed once, so the accuracy of the benchmarks is limited.

    +

    For the initial mmkin fits, we use all available cores.

    +
    +n_cores <- parallel::detectCores()
    +
    +

    Test data +

    +

    Please refer to the vignette dimethenamid_2018 for an explanation of the following preprocessing.

    +
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
    +  ds_i
    +})
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
    +dmta_ds[["Elliot 1"]] <- NULL
    +dmta_ds[["Elliot 2"]] <- NULL
    +
    +
    +

    Test cases +

    +
    +

    Parent only +

    +
    +parent_mods <- c("SFO", "DFOP", "SFORB", "HS")
    +parent_sep_const <- mmkin(parent_mods, dmta_ds, quiet = TRUE, cores = n_cores)
    +parent_sep_tc <- update(parent_sep_const, error_model = "tc")
    +
    +t1 <- system.time(sfo_const <- saem(parent_sep_const["SFO", ]))[["elapsed"]]
    +t2 <- system.time(dfop_const <- saem(parent_sep_const["DFOP", ]))[["elapsed"]]
    +t3 <- system.time(sforb_const <- saem(parent_sep_const["SFORB", ]))[["elapsed"]]
    +t4 <- system.time(hs_const <- saem(parent_sep_const["HS", ]))[["elapsed"]]
    +t5 <- system.time(sfo_tc <- saem(parent_sep_tc["SFO", ]))[["elapsed"]]
    +t6 <- system.time(dfop_tc <- saem(parent_sep_tc["DFOP", ]))[["elapsed"]]
    +t7 <- system.time(sforb_tc <- saem(parent_sep_tc["SFORB", ]))[["elapsed"]]
    +t8 <- system.time(hs_tc <- saem(parent_sep_tc["HS", ]))[["elapsed"]]
    +
    +anova(
    +  sfo_const, dfop_const, sforb_const, hs_const,
    +  sfo_tc, dfop_tc, sforb_tc, hs_tc) |> kable(, digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    sfo_const5796.3795.3-393.2
    sfo_tc6798.3797.1-393.2
    dfop_const9709.4707.5-345.7
    sforb_const9710.0708.1-346.0
    hs_const9713.7711.8-347.8
    dfop_tc10669.8667.7-324.9
    sforb_tc10662.8660.7-321.4
    hs_tc10667.3665.2-323.6
    +

    The above model comparison suggests to use the SFORB model with two-component error. For comparison, we keep the DFOP model with two-component error, as it competes with SFORB for biphasic curves.

    +
    +illparms(dfop_tc)
    +
    ## [1] "sd(log_k2)"
    +
    +illparms(sforb_tc)
    +
    ## [1] "sd(log_k_DMTA_bound_free)"
    +

    For these two models, random effects for the transformed parameters k2 and k_DMTA_bound_free could not be quantified.

    +
    +
    +

    One metabolite +

    +

    We remove parameters that were found to be ill-defined in the parent only fits.

    +
    +one_met_mods <- list(
    +  DFOP_SFO = mkinmod(
    +    DMTA = mkinsub("DFOP", "M23"),
    +    M23 = mkinsub("SFO")),
    +  SFORB_SFO = mkinmod(
    +    DMTA = mkinsub("SFORB", "M23"),
    +    M23 = mkinsub("SFO")))
    +
    +one_met_sep_const <- mmkin(one_met_mods, dmta_ds, error_model = "const",
    +  cores = n_cores, quiet = TRUE)
    +one_met_sep_tc <- mmkin(one_met_mods, dmta_ds, error_model = "tc",
    +  cores = n_cores, quiet = TRUE)
    +
    +t9 <- system.time(dfop_sfo_tc <- saem(one_met_sep_tc["DFOP_SFO", ],
    +    no_random_effect = "log_k2"))[["elapsed"]]
    +t10 <- system.time(sforb_sfo_tc <- saem(one_met_sep_tc["SFORB_SFO", ],
    +    no_random_effect = "log_k_DMTA_bound_free"))[["elapsed"]]
    +
    +
    +

    Three metabolites +

    +

    For the case of three metabolites, we only keep the SFORB model in order to limit the time for compiling this vignette, and as fitting in parallel may disturb the benchmark. Again, we do not include random effects that were ill-defined in previous fits of subsets of the degradation model.

    +
    +illparms(sforb_sfo_tc)
    +
    +three_met_mods <- list(
    +  SFORB_SFO3_plus = mkinmod(
    +    DMTA = mkinsub("SFORB", c("M23", "M27", "M31")),
    +    M23 = mkinsub("SFO"),
    +    M27 = mkinsub("SFO"),
    +    M31 = mkinsub("SFO", "M27", sink = FALSE)))
    +
    +three_met_sep_tc <- mmkin(three_met_mods, dmta_ds, error_model = "tc",
    +  cores = n_cores, quiet = TRUE)
    +
    +t11 <- system.time(sforb_sfo3_plus_const <- saem(three_met_sep_tc["SFORB_SFO3_plus", ],
    +    no_random_effect = "log_k_DMTA_bound_free"))[["elapsed"]]
    +
    +
    +
    +

    Results +

    +

    Benchmarks for all available error models are shown. They are intended for improving mkin, not for comparing CPUs or operating systems. All trademarks belong to their respective owners.

    +
    +

    Parent only +

    +

    Constant variance for SFO, DFOP, SFORB and HS.

    + + + + + + + + + + + + + + + + + + + + + +
    CPUOSmkinsaemixt1t2t3t4
    Ryzen 7 1700Linux1.2.03.22.144.6264.3284.998
    +

    Two-component error fits for SFO, DFOP, SFORB and HS.

    + + + + + + + + + + + + + + + + + + + + + +
    CPUOSmkinsaemixt5t6t7t8
    Ryzen 7 1700Linux1.2.03.25.6787.44187.98
    +
    +
    +

    One metabolite +

    +

    Two-component error for DFOP-SFO and SFORB-SFO.

    + + + + + + + + + + + + + + + + + +
    CPUOSmkinsaemixt9t10
    Ryzen 7 1700Linux1.2.03.224.465800.266
    +
    +
    +

    Three metabolites +

    +

    Two-component error for SFORB-SFO3-plus

    + + + + + + + + + + + + + + + +
    CPUOSmkinsaemixt11
    Ryzen 7 1700Linux1.2.03.21289.198
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.6.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/web_only/saem_benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/web_only/saem_benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js new file mode 100644 index 00000000..ca349fd6 --- /dev/null +++ b/docs/articles/web_only/saem_benchmarks_files/accessible-code-block-0.0.1/empty-anchor.js @@ -0,0 +1,15 @@ +// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> +// v0.0.1 +// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. + +document.addEventListener('DOMContentLoaded', function() { + const codeList = document.getElementsByClassName("sourceCode"); + for (var i = 0; i < codeList.length; i++) { + var linkList = codeList[i].getElementsByTagName('a'); + for (var j = 0; j < linkList.length; j++) { + if (linkList[j].innerHTML === "") { + linkList[j].setAttribute('aria-hidden', 'true'); + } + } + } +}); diff --git a/docs/authors.html b/docs/authors.html index ab436c86..6560ab17 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ mkin - 1.1.2 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -109,13 +115,13 @@

    Ranke J (2022). mkin: Kinetic Evaluation of Chemical Degradation Data. -R package version 1.1.2, https://pkgdown.jrwb.de/mkin/. +R package version 1.2.0, https://pkgdown.jrwb.de/mkin/.

    @Manual{,
       title = {mkin: Kinetic Evaluation of Chemical Degradation Data},
       author = {Johannes Ranke},
       year = {2022},
    -  note = {R package version 1.1.2},
    +  note = {R package version 1.2.0},
       url = {https://pkgdown.jrwb.de/mkin/},
     }
    diff --git a/docs/index.html b/docs/index.html index 67e1702a..9048bc38 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,7 +44,7 @@ mkin - 1.1.2 + 1.2.0 @@ -73,11 +73,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -85,7 +88,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/news/index.html b/docs/news/index.html index faaab288..90768141 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ mkin - 1.1.2 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -82,13 +88,18 @@
    - -
    • ‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel.

    • -
    • ‘R/saem.R’: Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported.

    • -
    • ‘R/saem.R’: ‘logLik’ and ‘update’ methods for ‘saem.mmkin’ objects.

    • -
    • ‘R/convergence.R’: New generic to show convergence information with methods for ‘mmkin’ and ‘mhmkin’ objects.

    • + +
      • ‘R/saem.R’: ‘logLik’, ‘update’ and ‘anova’ methods for ‘saem.mmkin’ objects.

      • +
      • ‘R/saem.R’: Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions.

      • +
      • ‘R/status.R’: New generic to show status information for fit array objects with methods for ‘mmkin’, ‘mhmkin’ and ‘multistart’ objects.

      • +
      • ‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel.

      • +
      • ‘R/mhmkin.R’: ‘anova.mhmkin’ for conveniently comparing the resulting fits.

      • ‘R/illparms.R’: New generic to show ill-defined parameters with methods for ‘mkinfit’, ‘mmkin’, ‘saem.mmkin’ and ‘mhmkin’ objects.

      • +
      • ‘R/multistart.R’: New method for testing multiple start parameters for hierarchical model fits, with function ‘llhist’ and new generic ‘parplot’ for diagnostics, and new generics ‘which.best’ and ‘best’ for extracting the fit with the highest likelihood

      • ‘R/summary.mmkin.R’: Summary method for mmkin objects.

      • +
      • ‘R/saem.R’: Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported.

      • +
      • ‘R/read_spreadsheet.R’: Conveniently read in data from a spreadsheet file.

      • +
      • ‘R/tex_listings.R’: Conveniently include summaries of fit objects in R markdown documents that are compiled to LaTeX.

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 7db87468..14c22439 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -11,7 +11,9 @@ articles: benchmarks: web_only/benchmarks.html compiled_models: web_only/compiled_models.html dimethenamid_2018: web_only/dimethenamid_2018.html -last_built: 2022-08-10T13:56Z + multistart: web_only/multistart.html + saem_benchmarks: web_only/saem_benchmarks.html +last_built: 2022-11-17T13:56Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index c46824e6..48e3b7e2 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -18,7 +18,7 @@ same dataset."> + + +
    +
    + + + +
    +
    + + +
    +

    Generate an anova object. The method to calculate the BIC is that from the +saemix package. As in other prominent anova methods, models are sorted by +number of parameters, and the tests (if requested) are always relative to +the model on the previous line.

    +
    + +
    +
    # S3 method for saem.mmkin
    +anova(
    +  object,
    +  ...,
    +  method = c("is", "lin", "gq"),
    +  test = FALSE,
    +  model.names = NULL
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    An saem.mmkin object

    + + +
    ...
    +

    further such objects

    + + +
    method
    +

    Method for likelihood calculation: "is" (importance sampling), +"lin" (linear approximation), or "gq" (Gaussian quadrature). Passed +to saemix::logLik.SaemixObject

    + + +
    test
    +

    Should a likelihood ratio test be performed? If TRUE, +the alternative models are tested against the first model. Should +only be done for nested models.

    + + +
    model.names
    +

    Optional character vector of model names

    + +
    +
    +

    Value

    + + +

    an "anova" data frame; the traditional (S3) result of anova()

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/aw.html b/docs/reference/aw.html index 1694d5f7..c1e1b4ed 100644 --- a/docs/reference/aw.html +++ b/docs/reference/aw.html @@ -19,7 +19,7 @@ by Burnham and Anderson (2004)."> + + +
    +
    + + + +
    +
    + + +
    +

    Produces a histogram of log-likelihoods. In addition, the likelihood of the +original fit is shown as a red vertical line.

    +
    + +
    +
    llhist(object, breaks = "Sturges", lpos = "topleft", main = "", ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    The multistart object

    + + +
    breaks
    +

    Passed to hist

    + + +
    lpos
    +

    Positioning of the legend.

    + + +
    main
    +

    Title of the plot

    + + +
    ...
    +

    Passed to hist

    + +
    +
    +

    See also

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/loftest-3.png b/docs/reference/loftest-3.png index a1a65a61..d897c363 100644 Binary files a/docs/reference/loftest-3.png and b/docs/reference/loftest-3.png differ diff --git a/docs/reference/loftest-5.png b/docs/reference/loftest-5.png index c441f2ed..0847bbec 100644 Binary files a/docs/reference/loftest-5.png and b/docs/reference/loftest-5.png differ diff --git a/docs/reference/loftest.html b/docs/reference/loftest.html index ee9b37e4..254b568f 100644 --- a/docs/reference/loftest.html +++ b/docs/reference/loftest.html @@ -20,7 +20,7 @@ lrtest.default from the lmtest package."> + + +
    +
    + + + +
    +
    + + +
    +

    logLik method for saem.mmkin objects

    +
    + +
    +
    # S3 method for saem.mmkin
    +logLik(object, ..., method = c("is", "lin", "gq"))
    +
    + +
    +

    Arguments

    +
    object
    +

    The fitted saem.mmkin object

    + + +
    ...
    +

    Passed to saemix::logLik.SaemixObject

    + + +
    method
    +

    Passed to saemix::logLik.SaemixObject

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/logistic.solution.html b/docs/reference/logistic.solution.html index b09d3a69..a63b1b1b 100644 --- a/docs/reference/logistic.solution.html +++ b/docs/reference/logistic.solution.html @@ -18,7 +18,7 @@ an increasing rate constant, supposedly caused by microbial growth"> mkin - 1.1.0 + 1.2.0
    @@ -48,11 +48,14 @@ and can be expressed by fixing the parameters of the other.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ and can be expressed by fixing the parameters of the other.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -95,11 +101,11 @@ and can be expressed by fixing the parameters of the other.

    -
    # S3 method for mkinfit
    -lrtest(object, object_2 = NULL, ...)
    -
    -# S3 method for mmkin
    -lrtest(object, ...)
    +
    # S3 method for mkinfit
    +lrtest(object, object_2 = NULL, ...)
    +
    +# S3 method for mmkin
    +lrtest(object, ...)
    @@ -107,11 +113,16 @@ and can be expressed by fixing the parameters of the other.

    object

    An mkinfit object, or an mmkin column object containing two fits to the same data.

    + +
    object_2

    Optionally, another mkinfit object fitted to the same data.

    + +
    ...

    Argument to mkinfit, passed to update.mkinfit for creating the alternative fitted object.

    +

    Details

    @@ -125,11 +136,11 @@ lower number of fitted parameters (null hypothesis).

    Examples

    -
    # \dontrun{
    -test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    -sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    -dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    -lrtest(dfop_fit, sfo_fit)
    +    
    # \dontrun{
    +test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    +sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    +dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    +lrtest(dfop_fit, sfo_fit)
     #> Likelihood ratio test
     #> 
     #> Model 1: DFOP with error model const
    @@ -139,7 +150,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 3 -63.954 -2 43.002 4.594e-10 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -lrtest(sfo_fit, dfop_fit) +lrtest(sfo_fit, dfop_fit) #> Likelihood ratio test #> #> Model 1: DFOP with error model const @@ -149,14 +160,14 @@ lower number of fitted parameters (null hypothesis).

    #> 2 3 -63.954 -2 43.002 4.594e-10 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - -# The following two examples are commented out as they fail during -# generation of the static help pages by pkgdown -#lrtest(dfop_fit, error_model = "tc") -#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) - -# However, this equivalent syntax also works for static help pages -lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) + +# The following two examples are commented out as they fail during +# generation of the static help pages by pkgdown +#lrtest(dfop_fit, error_model = "tc") +#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) + +# However, this equivalent syntax also works for static help pages +lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) #> Likelihood ratio test #> #> Model 1: DFOP with error model tc @@ -166,7 +177,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 5 -42.453 -1 15.731 7.302e-05 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) +lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) #> Likelihood ratio test #> #> Model 1: DFOP with error model const @@ -176,7 +187,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 4 -57.340 -1 29.776 4.851e-08 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -# } +# }
    @@ -191,7 +202,7 @@ lower number of fitted parameters (null hypothesis).

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/max_twa_parent.html b/docs/reference/max_twa_parent.html index 69da881b..3c8e1662 100644 --- a/docs/reference/max_twa_parent.html +++ b/docs/reference/max_twa_parent.html @@ -23,7 +23,7 @@ soil section of the FOCUS guidance."> + + +
    +
    + + + +
    +
    + + +
    +

    The purpose of this method is to check if a certain algorithm for fitting +nonlinear hierarchical models (also known as nonlinear mixed-effects models) +will reliably yield results that are sufficiently similar to each other, if +started with a certain range of reasonable starting parameters. It is +inspired by the article on practical identifiabiliy in the frame of nonlinear +mixed-effects models by Duchesne et al (2021).

    +
    + +
    +
    multistart(
    +  object,
    +  n = 50,
    +  cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
    +  cluster = NULL,
    +  ...
    +)
    +
    +# S3 method for saem.mmkin
    +multistart(object, n = 50, cores = 1, cluster = NULL, ...)
    +
    +# S3 method for multistart
    +print(x, ...)
    +
    +best(object, ...)
    +
    +# S3 method for default
    +best(object, ...)
    +
    +which.best(object, ...)
    +
    +# S3 method for default
    +which.best(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    The fit object to work with

    + + +
    n
    +

    How many different combinations of starting parameters should be +used?

    + + +
    cores
    +

    How many fits should be run in parallel (only on posix platforms)?

    + + +
    cluster
    +

    A cluster as returned by parallel::makeCluster to be used +for parallel execution.

    + + +
    ...
    +

    Passed to the update function.

    + + +
    x
    +

    The multistart object to print

    + +
    +
    +

    Value

    + + +

    A list of saem.mmkin objects, with class attributes +'multistart.saem.mmkin' and 'multistart'.

    + + +

    The object with the highest likelihood

    + + +

    The index of the object with the highest likelihood

    +
    +
    +

    References

    +

    Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical +identifiability in the frame of nonlinear mixed effects models: the example +of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478. +doi: 10.1186/s12859-021-04373-4.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    # \dontrun{
    +library(mkin)
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
    +  ds_i
    +})
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
    +dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
    +
    +f_mmkin <- mmkin("DFOP", dmta_ds, error_model = "tc", cores = 7, quiet = TRUE)
    +f_saem_full <- saem(f_mmkin)
    +f_saem_full_multi <- multistart(f_saem_full, n = 16, cores = 16)
    +parplot(f_saem_full_multi, lpos = "topleft")
    +
    +illparms(f_saem_full)
    +#> [1] "sd(log_k2)"
    +
    +f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2")
    +illparms(f_saem_reduced)
    +# On Windows, we need to create a cluster first. When working with
    +# such a cluster, we need to export the mmkin object to the cluster
    +# nodes, as it is referred to when updating the saem object on the nodes.
    +library(parallel)
    +cl <- makePSOCKcluster(12)
    +f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl)
    +parplot(f_saem_reduced_multi, lpos = "topright")
    +
    +stopCluster(cl)
    +# }
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html index 1d22b617..5906db4c 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -21,7 +21,7 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP."> mkin - 1.1.0 + 1.2.0 @@ -48,11 +48,14 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -95,10 +101,10 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.

    -
    nafta(ds, title = NA, quiet = FALSE, ...)
    -
    -# S3 method for nafta
    -print(x, quiet = TRUE, digits = 3, ...)
    +
    nafta(ds, title = NA, quiet = FALSE, ...)
    +
    +# S3 method for nafta
    +print(x, quiet = TRUE, digits = 3, ...)
    @@ -120,22 +126,35 @@ Degradation time values specified by the time argument, one column called "name" with the grouping of the observed values, and finally one column of observed values called "value".

    + +
    title

    Optional title of the dataset

    + +
    quiet

    Should the evaluation text be shown?

    + +
    ...

    Further arguments passed to mmkin (not for the printing method).

    + +
    x

    An nafta object.

    + +
    digits

    Number of digits to be used for printing parameters and dissipation times.

    +

    Value

    -

    An list of class nafta. The list element named "mmkin" is the + + +

    An list of class nafta. The list element named "mmkin" is the mmkin object containing the fits of the three models. The list element named "title" contains the title of the dataset used. The list element "data" contains the dataset used in the fits.

    @@ -147,13 +166,13 @@ list element "data" contains the dataset used in the fits.

    Examples

    -
    
    -  nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    +    
    
    +  nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
     #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
     #> The representative half-life of the IORE model is longer than the one corresponding
     #> to the terminal degradation rate found with the DFOP model.
     #> The representative half-life obtained from the DFOP model may be used
    -  print(nafta_evaluation)
    +  print(nafta_evaluation)
     #> Sums of squares:
     #>       SFO      IORE      DFOP 
     #> 1378.6832  615.7730  517.8836 
    @@ -192,9 +211,9 @@ list element "data" contains the dataset used in the fits.

    #> #> Representative half-life: #> [1] 841.41 - plot(nafta_evaluation) + plot(nafta_evaluation) - +
    @@ -209,7 +228,7 @@ list element "data" contains the dataset used in the fits.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png index 0b6cb78d..f4d04e1d 100644 Binary files a/docs/reference/nlme-1.png and b/docs/reference/nlme-1.png differ diff --git a/docs/reference/nlme-2.png b/docs/reference/nlme-2.png index ef152270..d9512f41 100644 Binary files a/docs/reference/nlme-2.png and b/docs/reference/nlme-2.png differ diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index ff8de9f3..83576e56 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -20,7 +20,7 @@ datasets. They are used internally by the nlme.mmkin() method."> mkin - 1.1.0 + 1.2.0 @@ -47,11 +47,14 @@ datasets. They are used internally by the nlme.mmkin() method."> Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -59,7 +62,10 @@ datasets. They are used internally by the nlme.mmkin() method."> Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -93,20 +99,25 @@ datasets. They are used internally by the nlme.m
    -
    nlme_function(object)
    -
    -nlme_data(object)
    +
    nlme_function(object)
    +
    +nlme_data(object)

    Arguments

    object

    An mmkin row object containing several fits of the same model to different datasets

    +

    Value

    -

    A function that can be used with nlme -A groupedData object

    + + +

    A function that can be used with nlme

    + + +

    A groupedData object

    See also

    @@ -115,78 +126,78 @@ A

    Examples

    -
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    -m_SFO <- mkinmod(parent = mkinsub("SFO"))
    -d_SFO_1 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.1),
    -  c(parent = 98), sampling_times)
    -d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    -d_SFO_2 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.05),
    -  c(parent = 102), sampling_times)
    -d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    -d_SFO_3 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.02),
    -  c(parent = 103), sampling_times)
    -d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    -
    -d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    -d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    -d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    -ds <- c(d1 = d1, d2 = d2, d3 = d3)
    -
    -f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    -mean_dp <- mean_degparms(f)
    -grouped_data <- nlme_data(f)
    -nlme_f <- nlme_function(f)
    -# These assignments are necessary for these objects to be
    -# visible to nlme and augPred when evaluation is done by
    -# pkgdown to generate the html docs.
    -assign("nlme_f", nlme_f, globalenv())
    -assign("grouped_data", grouped_data, globalenv())
    -
    -library(nlme)
    -m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    -  data = grouped_data,
    -  fixed = parent_0 + log_k_parent_sink ~ 1,
    -  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    -  start = mean_dp)
    -summary(m_nlme)
    +    
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +m_SFO <- mkinmod(parent = mkinsub("SFO"))
    +d_SFO_1 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.1),
    +  c(parent = 98), sampling_times)
    +d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    +d_SFO_2 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.05),
    +  c(parent = 102), sampling_times)
    +d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    +d_SFO_3 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.02),
    +  c(parent = 103), sampling_times)
    +d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    +
    +d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    +d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    +d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    +ds <- c(d1 = d1, d2 = d2, d3 = d3)
    +
    +f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    +mean_dp <- mean_degparms(f)
    +grouped_data <- nlme_data(f)
    +nlme_f <- nlme_function(f)
    +# These assignments are necessary for these objects to be
    +# visible to nlme and augPred when evaluation is done by
    +# pkgdown to generate the html docs.
    +assign("nlme_f", nlme_f, globalenv())
    +assign("grouped_data", grouped_data, globalenv())
    +
    +library(nlme)
    +m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    +  data = grouped_data,
    +  fixed = parent_0 + log_k_parent_sink ~ 1,
    +  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    +  start = mean_dp)
    +summary(m_nlme)
     #> Nonlinear mixed-effects model fit by maximum likelihood
     #>   Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) 
     #>   Data: grouped_data 
     #>        AIC      BIC    logLik
    -#>   300.6824 310.2426 -145.3412
    +#>   266.6428 275.8935 -128.3214
     #> 
     #> Random effects:
     #>  Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1)
     #>  Level: ds
     #>  Structure: Diagonal
    -#>         parent_0 log_k_parent_sink Residual
    -#> StdDev: 1.697361         0.6801209 3.666073
    +#>            parent_0 log_k_parent_sink Residual
    +#> StdDev: 0.000368491         0.7058039 3.065183
     #> 
     #> Fixed effects:  parent_0 + log_k_parent_sink ~ 1 
    -#>                       Value Std.Error DF  t-value p-value
    -#> parent_0          100.99378 1.3890416 46 72.70753       0
    -#> log_k_parent_sink  -3.07521 0.4018589 46 -7.65246       0
    +#>                       Value Std.Error DF   t-value p-value
    +#> parent_0          101.18323 0.7900461 43 128.07257       0
    +#> log_k_parent_sink  -3.08708 0.4171755 43  -7.39995       0
     #>  Correlation: 
     #>                   prnt_0
    -#> log_k_parent_sink 0.027 
    +#> log_k_parent_sink 0.031 
     #> 
     #> Standardized Within-Group Residuals:
    -#>        Min         Q1        Med         Q3        Max 
    -#> -1.9942823 -0.5622565  0.1791579  0.7165038  2.0704781 
    +#>         Min          Q1         Med          Q3         Max 
    +#> -2.38427070 -0.52059848  0.03593021  0.39987268  2.73188969 
     #> 
    -#> Number of Observations: 50
    +#> Number of Observations: 47
     #> Number of Groups: 3 
    -plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
    +plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
     
    -# augPred does not work on fits with more than one state
    -# variable
    -#
    -# The procedure is greatly simplified by the nlme.mmkin function
    -f_nlme <- nlme(f)
    -plot(f_nlme)
    +# augPred does not work on fits with more than one state
    +# variable
    +#
    +# The procedure is greatly simplified by the nlme.mmkin function
    +f_nlme <- nlme(f)
    +plot(f_nlme)
     
     
    @@ -202,7 +213,7 @@ A -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/nlme.mmkin.html b/docs/reference/nlme.mmkin.html index c8bd28e9..1e294eaf 100644 --- a/docs/reference/nlme.mmkin.html +++ b/docs/reference/nlme.mmkin.html @@ -19,7 +19,7 @@ have been obtained by fitting the same model to a list of datasets.">Extract model parameters from mkinfit models — parms • mkinExtract model parameters — parms • mkin @@ -19,7 +19,7 @@ considering the error structure that was assumed for the fit.">< mkin - 1.1.0 + 1.2.0 @@ -46,11 +46,14 @@ considering the error structure that was assumed for the fit.">< Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ considering the error structure that was assumed for the fit.">< Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -79,69 +85,91 @@ considering the error structure that was assumed for the fit."><
    -

    This function always returns degradation model parameters as well as error -model parameters, in order to avoid working with a fitted model without -considering the error structure that was assumed for the fit.

    +

    This function returns degradation model parameters as well as error +model parameters per default, in order to avoid working with a fitted model +without considering the error structure that was assumed for the fit.

    -
    parms(object, ...)
    -
    -# S3 method for mkinfit
    -parms(object, transformed = FALSE, ...)
    -
    -# S3 method for mmkin
    -parms(object, transformed = FALSE, ...)
    +
    parms(object, ...)
    +
    +# S3 method for mkinfit
    +parms(object, transformed = FALSE, errparms = TRUE, ...)
    +
    +# S3 method for mmkin
    +parms(object, transformed = FALSE, errparms = TRUE, ...)
    +
    +# S3 method for multistart
    +parms(object, exclude_failed = TRUE, ...)

    Arguments

    object
    -

    A fitted model object. Methods are implemented for -mkinfit() objects and for mmkin() objects.

    +

    A fitted model object.

    + +
    ...

    Not used

    + +
    transformed
    -

    Should the parameters be returned -as used internally during the optimisation?

    +

    Should the parameters be returned as used internally +during the optimisation?

    + + +
    errparms
    +

    Should the error model parameters be returned +in addition to the degradation parameters?

    + + +
    exclude_failed
    +

    For multistart objects, should rows for failed fits +be removed from the returned parameter matrix?

    +

    Value

    -

    For mkinfit objects, a numeric vector of fitted model parameters. -For mmkin row objects, a matrix with the parameters with a -row for each dataset. If the mmkin object has more than one row, a list of -such matrices is returned.

    + + +

    Depending on the object, a numeric vector of fitted model parameters, +a matrix (e.g. for mmkin row objects), or a list of matrices (e.g. for +mmkin objects with more than one row).

    +
    +
    +

    See also

    +

    Examples

    -
    # mkinfit objects
    -fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
    -parms(fit)
    +    
    # mkinfit objects
    +fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
    +parms(fit)
     #>   parent_0   k_parent      sigma 
     #> 82.4921598  0.3060633  4.6730124 
    -parms(fit, transformed = TRUE)
    +parms(fit, transformed = TRUE)
     #>     parent_0 log_k_parent        sigma 
     #>    82.492160    -1.183963     4.673012 
    -
    -# mmkin objects
    -ds <- lapply(experimental_data_for_UBA_2019[6:10],
    - function(x) subset(x$data[c("name", "time", "value")]))
    -names(ds) <- paste("Dataset", 6:10)
    -# \dontrun{
    -fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1)
    -parms(fits["SFO", ])
    +
    +# mmkin objects
    +ds <- lapply(experimental_data_for_UBA_2019[6:10],
    + function(x) subset(x$data[c("name", "time", "value")]))
    +names(ds) <- paste("Dataset", 6:10)
    +# \dontrun{
    +fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1)
    +parms(fits["SFO", ])
     #>            Dataset 6    Dataset 7  Dataset 8  Dataset 9  Dataset 10
     #> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450
     #> k_parent  0.05794659  0.009647805  0.2102974  0.1232258  0.00720421
     #> sigma     5.15274487  7.040168584  3.6769645  6.4669234  6.50457673
    -parms(fits[, 2])
    +parms(fits[, 2])
     #> $SFO
     #>             Dataset 7
     #> parent_0 82.666781678
    @@ -157,13 +185,13 @@ such matrices is returned.

    #> #> $DFOP #> Dataset 7 -#> parent_0 91.058971599 +#> parent_0 91.058971589 #> k1 0.044946770 #> k2 0.002868336 -#> g 0.526942414 +#> g 0.526942415 #> sigma 2.221302196 #> -parms(fits) +parms(fits) #> $SFO #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 #> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450 @@ -179,13 +207,13 @@ such matrices is returned.

    #> #> $DFOP #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.55213663 91.058971599 90.34509493 98.14858821 94.311323732 +#> parent_0 96.55213663 91.058971589 90.34509493 98.14858820 94.311323734 #> k1 0.21954588 0.044946770 0.41232288 0.31697588 0.080663857 #> k2 0.02957934 0.002868336 0.07581766 0.03260384 0.003425417 -#> g 0.44845068 0.526942414 0.66091967 0.65322767 0.342652880 +#> g 0.44845068 0.526942415 0.66091967 0.65322767 0.342652880 #> sigma 1.35690468 2.221302196 1.34169076 2.87159846 1.942067831 #> -parms(fits, transformed = TRUE) +parms(fits, transformed = TRUE) #> $SFO #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 #> parent_0 88.522754 82.666782 86.854731 91.777931 82.148094 @@ -207,7 +235,7 @@ such matrices is returned.

    #> g_qlogis -0.2069326 0.1078741 0.6673953 0.6332573 -0.6514943 #> sigma 1.3569047 2.2213022 1.3416908 2.8715985 1.9420678 #> -# } +# }
    @@ -222,7 +250,7 @@ such matrices is returned.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/parplot.html b/docs/reference/parplot.html new file mode 100644 index 00000000..f4f3c811 --- /dev/null +++ b/docs/reference/parplot.html @@ -0,0 +1,175 @@ + +Plot parameter variability of multistart objects — parplot • mkin + + +
    +
    + + + +
    +
    + + +
    +

    Produces a boxplot with all parameters from the multiple runs, scaled +either by the parameters of the run with the highest likelihood, +or by their medians as proposed in the paper by Duchesne et al. (2021).

    +
    + +
    +
    parplot(object, ...)
    +
    +# S3 method for multistart.saem.mmkin
    +parplot(
    +  object,
    +  llmin = -Inf,
    +  scale = c("best", "median"),
    +  lpos = "bottomleft",
    +  main = "",
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    The multistart object

    + + +
    ...
    +

    Passed to boxplot

    + + +
    llmin
    +

    The minimum likelihood of objects to be shown

    + + +
    scale
    +

    By default, scale parameters using the best available fit. +If 'median', parameters are scaled using the median parameters from all fits.

    + + +
    lpos
    +

    Positioning of the legend.

    + + +
    main
    +

    Title of the plot

    + +
    +
    +

    References

    +

    Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical +identifiability in the frame of nonlinear mixed effects models: the example +of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478. +doi: 10.1186/s12859-021-04373-4.

    +
    +
    +

    See also

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/plot.mixed.mmkin-2.png b/docs/reference/plot.mixed.mmkin-2.png index b35f28d6..8678c166 100644 Binary files a/docs/reference/plot.mixed.mmkin-2.png and b/docs/reference/plot.mixed.mmkin-2.png differ diff --git a/docs/reference/plot.mixed.mmkin-3.png b/docs/reference/plot.mixed.mmkin-3.png index c981538f..9bd01852 100644 Binary files a/docs/reference/plot.mixed.mmkin-3.png and b/docs/reference/plot.mixed.mmkin-3.png differ diff --git a/docs/reference/plot.mixed.mmkin-4.png b/docs/reference/plot.mixed.mmkin-4.png index ccbe5861..a849aaee 100644 Binary files a/docs/reference/plot.mixed.mmkin-4.png and b/docs/reference/plot.mixed.mmkin-4.png differ diff --git a/docs/reference/plot.mixed.mmkin.html b/docs/reference/plot.mixed.mmkin.html index 2af2328d..b1083204 100644 --- a/docs/reference/plot.mixed.mmkin.html +++ b/docs/reference/plot.mixed.mmkin.html @@ -17,7 +17,7 @@ mkin - 1.1.0 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -87,94 +93,146 @@
    -
    # S3 method for mixed.mmkin
    -plot(
    -  x,
    -  i = 1:ncol(x$mmkin),
    -  obs_vars = names(x$mkinmod$map),
    -  standardized = TRUE,
    -  xlab = "Time",
    -  xlim = range(x$data$time),
    -  resplot = c("predicted", "time"),
    -  pred_over = NULL,
    -  test_log_parms = FALSE,
    -  conf.level = 0.6,
    -  default_log_parms = NA,
    -  ymax = "auto",
    -  maxabs = "auto",
    -  ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
    -  nrow.legend = ceiling((length(i) + 1)/ncol.legend),
    -  rel.height.legend = 0.02 + 0.07 * nrow.legend,
    -  rel.height.bottom = 1.1,
    -  pch_ds = 1:length(i),
    -  col_ds = pch_ds + 1,
    -  lty_ds = col_ds,
    -  frame = TRUE,
    -  ...
    -)
    +
    # S3 method for mixed.mmkin
    +plot(
    +  x,
    +  i = 1:ncol(x$mmkin),
    +  obs_vars = names(x$mkinmod$map),
    +  standardized = TRUE,
    +  xlab = "Time",
    +  xlim = range(x$data$time),
    +  resplot = c("predicted", "time"),
    +  pop_curve = "auto",
    +  pred_over = NULL,
    +  test_log_parms = FALSE,
    +  conf.level = 0.6,
    +  default_log_parms = NA,
    +  ymax = "auto",
    +  maxabs = "auto",
    +  ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
    +  nrow.legend = ceiling((length(i) + 1)/ncol.legend),
    +  rel.height.legend = 0.02 + 0.07 * nrow.legend,
    +  rel.height.bottom = 1.1,
    +  pch_ds = 1:length(i),
    +  col_ds = pch_ds + 1,
    +  lty_ds = col_ds,
    +  frame = TRUE,
    +  ...
    +)

    Arguments

    x

    An object of class mixed.mmkin, saem.mmkin or nlme.mmkin

    + +
    i

    A numeric index to select datasets for which to plot the individual predictions, in case plots get too large

    + +
    obs_vars

    A character vector of names of the observed variables for which the data and the model should be plotted. Defauls to all observed variables in the model.

    + +
    standardized

    Should the residuals be standardized? Only takes effect if resplot = "time".

    + +
    xlab

    Label for the x axis.

    + +
    xlim

    Plot range in x direction.

    + +
    resplot

    Should the residuals plotted against time or against predicted values?

    + + +
    pop_curve
    +

    Per default, a population curve is drawn in case +population parameters are fitted by the model, e.g. for saem objects. +In case there is a covariate model, no population curve is currently shown.

    + +
    pred_over

    Named list of alternative predictions as obtained from mkinpredict with a compatible mkinmod.

    + +
    test_log_parms

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    conf.level

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    default_log_parms

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    ymax

    Vector of maximum y axis values

    + +
    maxabs

    Maximum absolute value of the residuals. This is used for the scaling of the y axis and defaults to "auto".

    + +
    ncol.legend

    Number of columns to use in the legend

    + +
    nrow.legend

    Number of rows to use in the legend

    + +
    rel.height.legend

    The relative height of the legend shown on top

    + +
    rel.height.bottom

    The relative height of the bottom plot row

    + +
    pch_ds

    Symbols to be used for plotting the data.

    + +
    col_ds

    Colors used for plotting the observed data and the corresponding model prediction lines for the different datasets.

    + +
    lty_ds

    Line types to be used for the model predictions.

    + +
    frame

    Should a frame be drawn around the plots?

    + +
    ...

    Further arguments passed to plot.

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Author

    @@ -183,41 +241,41 @@ corresponding model prediction lines for the different datasets.

    Examples

    -
    ds <- lapply(experimental_data_for_UBA_2019[6:10],
    - function(x) x$data[c("name", "time", "value")])
    -names(ds) <- paste0("ds ", 6:10)
    -dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
    -  A1 = mkinsub("SFO"), quiet = TRUE)
    -# \dontrun{
    -f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE)
    -plot(f[, 3:4], standardized = TRUE)
    +    
    ds <- lapply(experimental_data_for_UBA_2019[6:10],
    + function(x) x$data[c("name", "time", "value")])
    +names(ds) <- paste0("ds ", 6:10)
    +dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
    +  A1 = mkinsub("SFO"), quiet = TRUE)
    +# \dontrun{
    +f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE)
    +plot(f[, 3:4], standardized = TRUE)
     
    -
    -# For this fit we need to increase pnlsMaxiter, and we increase the
    -# tolerance in order to speed up the fit for this example evaluation
    -# It still takes 20 seconds to run
    -f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3))
    -plot(f_nlme)
    +
    +# For this fit we need to increase pnlsMaxiter, and we increase the
    +# tolerance in order to speed up the fit for this example evaluation
    +# It still takes 20 seconds to run
    +f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3))
    +plot(f_nlme)
     
    -
    -f_saem <- saem(f, transformations = "saemix")
    -plot(f_saem)
    +
    +f_saem <- saem(f, transformations = "saemix")
    +plot(f_saem)
     
    -
    -f_obs <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE, error_model = "obs")
    -f_nlmix <- nlmix(f_obs)
    +
    +f_obs <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE, error_model = "obs")
    +f_nlmix <- nlmix(f_obs)
     #> Error in nlmix(f_obs): could not find function "nlmix"
    -plot(f_nlmix)
    +plot(f_nlmix)
     #> Error in plot(f_nlmix): object 'f_nlmix' not found
    -
    -# We can overlay the two variants if we generate predictions
    -pred_nlme <- mkinpredict(dfop_sfo,
    -  f_nlme$bparms.optim[-1],
    -  c(parent = f_nlme$bparms.optim[[1]], A1 = 0),
    -  seq(0, 180, by = 0.2))
    -plot(f_saem, pred_over = list(nlme = pred_nlme))
    +
    +# We can overlay the two variants if we generate predictions
    +pred_nlme <- mkinpredict(dfop_sfo,
    +  f_nlme$bparms.optim[-1],
    +  c(parent = f_nlme$bparms.optim[[1]], A1 = 0),
    +  seq(0, 180, by = 0.2))
    +plot(f_saem, pred_over = list(nlme = pred_nlme))
     
    -# }
    +# }
     
    @@ -232,7 +290,7 @@ corresponding model prediction lines for the different datasets.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.mkinfit-2.png b/docs/reference/plot.mkinfit-2.png index 39098648..cef94cb8 100644 Binary files a/docs/reference/plot.mkinfit-2.png and b/docs/reference/plot.mkinfit-2.png differ diff --git a/docs/reference/plot.mkinfit-5.png b/docs/reference/plot.mkinfit-5.png index 3545b8d8..f90b3f54 100644 Binary files a/docs/reference/plot.mkinfit-5.png and b/docs/reference/plot.mkinfit-5.png differ diff --git a/docs/reference/plot.mkinfit-7.png b/docs/reference/plot.mkinfit-7.png index daf43033..3e5d828e 100644 Binary files a/docs/reference/plot.mkinfit-7.png and b/docs/reference/plot.mkinfit-7.png differ diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index 23cf27b5..cf96990e 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -19,7 +19,7 @@ observed data together with the solution of the fitted model.">< mkin - 1.1.0 + 1.2.0 @@ -46,11 +46,14 @@ observed data together with the solution of the fitted model.">< Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ observed data together with the solution of the fitted model.">< Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -91,50 +97,50 @@ observed data together with the solution of the fitted model.

    -
    # S3 method for mkinfit
    -plot(
    -  x,
    -  fit = x,
    -  obs_vars = names(fit$mkinmod$map),
    -  xlab = "Time",
    -  ylab = "Residue",
    -  xlim = range(fit$data$time),
    -  ylim = "default",
    -  col_obs = 1:length(obs_vars),
    -  pch_obs = col_obs,
    -  lty_obs = rep(1, length(obs_vars)),
    -  add = FALSE,
    -  legend = !add,
    -  show_residuals = FALSE,
    -  show_errplot = FALSE,
    -  maxabs = "auto",
    -  sep_obs = FALSE,
    -  rel.height.middle = 0.9,
    -  row_layout = FALSE,
    -  lpos = "topright",
    -  inset = c(0.05, 0.05),
    -  show_errmin = FALSE,
    -  errmin_digits = 3,
    -  frame = TRUE,
    -  ...
    -)
    -
    -plot_sep(
    -  fit,
    -  show_errmin = TRUE,
    -  show_residuals = ifelse(identical(fit$err_mod, "const"), TRUE, "standardized"),
    -  ...
    -)
    -
    -plot_res(
    -  fit,
    -  sep_obs = FALSE,
    -  show_errmin = sep_obs,
    -  standardized = ifelse(identical(fit$err_mod, "const"), FALSE, TRUE),
    -  ...
    -)
    -
    -plot_err(fit, sep_obs = FALSE, show_errmin = sep_obs, ...)
    +
    # S3 method for mkinfit
    +plot(
    +  x,
    +  fit = x,
    +  obs_vars = names(fit$mkinmod$map),
    +  xlab = "Time",
    +  ylab = "Residue",
    +  xlim = range(fit$data$time),
    +  ylim = "default",
    +  col_obs = 1:length(obs_vars),
    +  pch_obs = col_obs,
    +  lty_obs = rep(1, length(obs_vars)),
    +  add = FALSE,
    +  legend = !add,
    +  show_residuals = FALSE,
    +  show_errplot = FALSE,
    +  maxabs = "auto",
    +  sep_obs = FALSE,
    +  rel.height.middle = 0.9,
    +  row_layout = FALSE,
    +  lpos = "topright",
    +  inset = c(0.05, 0.05),
    +  show_errmin = FALSE,
    +  errmin_digits = 3,
    +  frame = TRUE,
    +  ...
    +)
    +
    +plot_sep(
    +  fit,
    +  show_errmin = TRUE,
    +  show_residuals = ifelse(identical(fit$err_mod, "const"), TRUE, "standardized"),
    +  ...
    +)
    +
    +plot_res(
    +  fit,
    +  sep_obs = FALSE,
    +  show_errmin = sep_obs,
    +  standardized = ifelse(identical(fit$err_mod, "const"), FALSE, TRUE),
    +  ...
    +)
    +
    +plot_err(fit, sep_obs = FALSE, show_errmin = sep_obs, ...)
    @@ -142,32 +148,56 @@ observed data together with the solution of the fitted model.

    x

    Alias for fit introduced for compatibility with the generic S3 method.

    + +
    fit

    An object of class mkinfit.

    + +
    obs_vars

    A character vector of names of the observed variables for which the data and the model should be plotted. Defauls to all observed variables in the model.

    + +
    xlab

    Label for the x axis.

    + +
    ylab

    Label for the y axis.

    + +
    xlim

    Plot range in x direction.

    + +
    ylim

    Plot range in y direction. If given as a list, plot ranges for the different plot rows can be given for row layout.

    + +
    col_obs

    Colors used for plotting the observed data and the corresponding model prediction lines.

    + +
    pch_obs

    Symbols to be used for plotting the data.

    + +
    lty_obs

    Line types to be used for the model predictions.

    + +
    add

    Should the plot be added to an existing plot?

    + +
    legend

    Should a legend be added to the plot?

    + +
    show_residuals

    Should residuals be shown? If only one plot of the fits is shown, the residual plot is in the lower third of the plot. @@ -175,47 +205,74 @@ Otherwise, i.e. if "sep_obs" is given, the residual plots will be located to the right of the plots of the fitted curves. If this is set to 'standardized', a plot of the residuals divided by the standard deviation given by the fitted error model will be shown.

    + +
    show_errplot

    Should squared residuals and the error model be shown? If only one plot of the fits is shown, this plot is in the lower third of the plot. Otherwise, i.e. if "sep_obs" is given, the residual plots will be located to the right of the plots of the fitted curves.

    + +
    maxabs

    Maximum absolute value of the residuals. This is used for the scaling of the y axis and defaults to "auto".

    + +
    sep_obs

    Should the observed variables be shown in separate subplots? If yes, residual plots requested by "show_residuals" will be shown next to, not below the plot of the fits.

    + +
    rel.height.middle

    The relative height of the middle plot, if more than two rows of plots are shown.

    + +
    row_layout

    Should we use a row layout where the residual plot or the error model plot is shown to the right?

    + +
    lpos

    Position(s) of the legend(s). Passed to legend as the first argument. If not length one, this should be of the same length as the obs_var argument.

    + +
    inset

    Passed to legend if applicable.

    + +
    show_errmin

    Should the FOCUS chi2 error value be shown in the upper margin of the plot?

    + +
    errmin_digits

    The number of significant digits for rounding the FOCUS chi2 error percentage.

    + +
    frame

    Should a frame be drawn around the plots?

    + +
    ...

    Further arguments passed to plot.

    + +
    standardized

    When calling 'plot_res', should the residuals be standardized in the residual plot?

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Details

    @@ -230,41 +287,41 @@ latex is being used for the formatting of the chi2 error level, if

    Examples

    -
    
    -# One parent compound, one metabolite, both single first order, path from
    -# parent to sink included
    -# \dontrun{
    -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"),
    -                   m1 = mkinsub("SFO", full = "Metabolite M1" ))
    +    
    
    +# One parent compound, one metabolite, both single first order, path from
    +# parent to sink included
    +# \dontrun{
    +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"),
    +                   m1 = mkinsub("SFO", full = "Metabolite M1" ))
     #> Temporary DLL for differentials generated and loaded
    -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
    +fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
     #> Warning: Observations with value of zero were removed from the data
    -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, error_model = "tc")
    +fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, error_model = "tc")
     #> Warning: Observations with value of zero were removed from the data
    -plot(fit)
    +plot(fit)
     
    -plot_res(fit)
    +plot_res(fit)
     
    -plot_res(fit, standardized = FALSE)
    +plot_res(fit, standardized = FALSE)
     
    -plot_err(fit)
    +plot_err(fit)
     
    -
    -# Show the observed variables separately, with residuals
    -plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"),
    -     show_errmin = TRUE)
    +
    +# Show the observed variables separately, with residuals
    +plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"),
    +     show_errmin = TRUE)
     
    -
    -# The same can be obtained with less typing, using the convenience function plot_sep
    -plot_sep(fit, lpos = c("topright", "bottomright"))
    +
    +# The same can be obtained with less typing, using the convenience function plot_sep
    +plot_sep(fit, lpos = c("topright", "bottomright"))
     
    -
    -# Show the observed variables separately, with the error model
    -plot(fit, sep_obs = TRUE, show_errplot = TRUE, lpos = c("topright", "bottomright"),
    -     show_errmin = TRUE)
    +
    +# Show the observed variables separately, with the error model
    +plot(fit, sep_obs = TRUE, show_errplot = TRUE, lpos = c("topright", "bottomright"),
    +     show_errmin = TRUE)
     
    -# }
    -
    +# }
    +
     
    @@ -279,7 +336,7 @@ latex is being used for the formatting of the chi2 error level, if
    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.mmkin-2.png b/docs/reference/plot.mmkin-2.png index f5768c40..7af84edf 100644 Binary files a/docs/reference/plot.mmkin-2.png and b/docs/reference/plot.mmkin-2.png differ diff --git a/docs/reference/plot.mmkin-3.png b/docs/reference/plot.mmkin-3.png index c3f77d3d..56bfac50 100644 Binary files a/docs/reference/plot.mmkin-3.png and b/docs/reference/plot.mmkin-3.png differ diff --git a/docs/reference/plot.mmkin-4.png b/docs/reference/plot.mmkin-4.png index 29439156..5da05f40 100644 Binary files a/docs/reference/plot.mmkin-4.png and b/docs/reference/plot.mmkin-4.png differ diff --git a/docs/reference/plot.mmkin-5.png b/docs/reference/plot.mmkin-5.png index 89a111b0..3ec224f4 100644 Binary files a/docs/reference/plot.mmkin-5.png and b/docs/reference/plot.mmkin-5.png differ diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index 3dd0203b..30d0406e 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -21,7 +21,7 @@ the fit of at least one model to the same dataset is shown."> mkin - 1.1.0 + 1.2.0 @@ -48,11 +48,14 @@ the fit of at least one model to the same dataset is shown.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ the fit of at least one model to the same dataset is shown.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -94,22 +100,22 @@ the fit of at least one model to the same dataset is shown.

    -
    # S3 method for mmkin
    -plot(
    -  x,
    -  main = "auto",
    -  legends = 1,
    -  resplot = c("time", "errmod"),
    -  ylab = "Residue",
    -  standardized = FALSE,
    -  show_errmin = TRUE,
    -  errmin_var = "All data",
    -  errmin_digits = 3,
    -  cex = 0.7,
    -  rel.height.middle = 0.9,
    -  ymax = "auto",
    -  ...
    -)
    +
    # S3 method for mmkin
    +plot(
    +  x,
    +  main = "auto",
    +  legends = 1,
    +  resplot = c("time", "errmod"),
    +  ylab = "Residue",
    +  standardized = FALSE,
    +  show_errmin = TRUE,
    +  errmin_var = "All data",
    +  errmin_digits = 3,
    +  cex = 0.7,
    +  rel.height.middle = 0.9,
    +  ymax = "auto",
    +  ...
    +)
    @@ -117,43 +123,70 @@ the fit of at least one model to the same dataset is shown.

    x

    An object of class mmkin, with either one row or one column.

    + +
    main

    The main title placed on the outer margin of the plot.

    + +
    legends

    An index for the fits for which legends should be shown.

    + +
    resplot

    Should the residuals plotted against time, using mkinresplot, or as squared residuals against predicted values, with the error model, using mkinerrplot.

    + +
    ylab

    Label for the y axis.

    + +
    standardized

    Should the residuals be standardized? This option is passed to mkinresplot, it only takes effect if resplot = "time".

    + +
    show_errmin

    Should the chi2 error level be shown on top of the plots to the left?

    + +
    errmin_var

    The variable for which the FOCUS chi2 error value should be shown.

    + +
    errmin_digits

    The number of significant digits for rounding the FOCUS chi2 error percentage.

    + +
    cex

    Passed to the plot functions and mtext.

    + +
    rel.height.middle

    The relative height of the middle plot, if more than two rows of plots are shown.

    + +
    ymax

    Maximum y axis value for plot.mkinfit.

    + +
    ...

    Further arguments passed to plot.mkinfit and mkinresplot.

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Details

    @@ -167,32 +200,32 @@ latex is being used for the formatting of the chi2 error level.

    Examples

    -
    
    -  # \dontrun{
    -  # Only use one core not to offend CRAN checks
    -  fits <- mmkin(c("FOMC", "HS"),
    -                list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles
    -                cores = 1, quiet = TRUE, error_model = "tc")
    +    
    
    +  # \dontrun{
    +  # Only use one core not to offend CRAN checks
    +  fits <- mmkin(c("FOMC", "HS"),
    +                list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles
    +                cores = 1, quiet = TRUE, error_model = "tc")
     #> Warning: Optimisation did not converge:
     #> iteration limit reached without convergence (10)
    -  plot(fits[, "FOCUS C"])
    +  plot(fits[, "FOCUS C"])
     
    -  plot(fits["FOMC", ])
    +  plot(fits["FOMC", ])
     
    -  plot(fits["FOMC", ], show_errmin = FALSE)
    +  plot(fits["FOMC", ], show_errmin = FALSE)
     
    -
    -  # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot
    -  # height should be smaller than the plot width (this is not possible for the html pages
    -  # generated by pkgdown, as far as I know).
    -  plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
    +
    +  # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot
    +  # height should be smaller than the plot width (this is not possible for the html pages
    +  # generated by pkgdown, as far as I know).
    +  plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
     
    -
    -  # Show the error models
    -  plot(fits["FOMC", ], resplot = "errmod")
    +
    +  # Show the error models
    +  plot(fits["FOMC", ], resplot = "errmod")
     
    -  # }
    -
    +  # }
    +
     
    @@ -207,7 +240,7 @@ latex is being used for the formatting of the chi2 error level.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index af65d8eb..a7939f90 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -18,7 +18,7 @@ function (SFO, then IORE, then DFOP)."> + + +
    +
    + + + +
    +
    + + +
    +

    This function imports one dataset from each sheet of a spreadsheet file. +These sheets are selected based on the contents of a sheet 'Datasets', with +a column called 'Dataset Number', containing numbers identifying the dataset +sheets to be read in. In the second column there must be a grouping +variable, which will often be named 'Soil'. Optionally, time normalization +factors can be given in columns named 'Temperature' and 'Moisture'.

    +
    + +
    +
    read_spreadsheet(
    +  path,
    +  valid_datasets = "all",
    +  parent_only = FALSE,
    +  normalize = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    path
    +

    Absolute or relative path to the spreadsheet file

    + + +
    valid_datasets
    +

    Optional numeric index of the valid datasets, default is +to use all datasets

    + + +
    parent_only
    +

    Should only the parent data be used?

    + + +
    normalize
    +

    Should the time scale be normalized using temperature +and moisture normalisation factors in the sheet 'Datasets'?

    + +
    +
    +

    Details

    +

    There must be a sheet 'Compounds', with columns 'Name' and 'Acronym'. +The first row read after the header read in from this sheet is assumed +to contain name and acronym of the parent compound.

    +

    The dataset sheets should be named using the dataset numbers read in from +the 'Datasets' sheet, i.e. '1', '2', ... . In each dataset sheet, name +of the observed variable (e.g. the acronym of the parent compound or +one of its transformation products) should be in the first column, +the time values should be in the second colum, and the observed value +in the third column.

    +

    In case relevant covariate data are available, they should be given +in a sheet 'Covariates', containing one line for each value of the grouping +variable specified in 'Datasets'. These values should be in the first +column and the column must have the same name as the second column in +'Datasets'. Covariates will be read in from columns four and higher. +Their names should preferably not contain special characters like spaces, +so they can be easily used for specifying covariate models.

    +

    An similar data structure is defined as the R6 class mkindsg, but +is probably more complicated to use.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 4da7092a..24b9771e 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -28,7 +28,7 @@ intervals, nlme mkin - 1.1.0 + 1.2.0 @@ -55,11 +55,14 @@ intervals, nlme Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -67,7 +70,10 @@ intervals, nlme Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -120,7 +126,7 @@ below to see their documentation.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/residuals.mkinfit.html b/docs/reference/residuals.mkinfit.html index 7d9e50de..07395436 100644 --- a/docs/reference/residuals.mkinfit.html +++ b/docs/reference/residuals.mkinfit.html @@ -17,7 +17,7 @@ mkin - 1.1.0 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -87,28 +93,33 @@
    -
    # S3 method for mkinfit
    -residuals(object, standardized = FALSE, ...)
    +
    # S3 method for mkinfit
    +residuals(object, standardized = FALSE, ...)

    Arguments

    object

    A mkinfit object

    + +
    standardized

    Should the residuals be standardized by dividing by the standard deviation obtained from the fitted error model?

    + +
    ...

    Not used

    +

    Examples

    -
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
    -residuals(f)
    +    
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
    +residuals(f)
     #> [1]  0.09726374 -0.13912142 -0.15351210  0.73388322 -0.08657004 -0.93204702
     #> [7] -0.03269080  1.45347823 -0.88423697
    -residuals(f, standardized = TRUE)
    +residuals(f, standardized = TRUE)
     #> [1]  0.13969917 -0.19981904 -0.22048826  1.05407091 -0.12433989 -1.33869208
     #> [7] -0.04695355  2.08761977 -1.27002287
     
    @@ -125,7 +136,7 @@ standard deviation obtained from the fitted error model?

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/saem-1.png b/docs/reference/saem-1.png index 08939d4f..9e310252 100644 Binary files a/docs/reference/saem-1.png and b/docs/reference/saem-1.png differ diff --git a/docs/reference/saem-2.png b/docs/reference/saem-2.png index b737db03..de1bcf57 100644 Binary files a/docs/reference/saem-2.png and b/docs/reference/saem-2.png differ diff --git a/docs/reference/saem-3.png b/docs/reference/saem-3.png index 08e0f544..de569ce0 100644 Binary files a/docs/reference/saem-3.png and b/docs/reference/saem-3.png differ diff --git a/docs/reference/saem-4.png b/docs/reference/saem-4.png index bb775c25..0f2ee3e7 100644 Binary files a/docs/reference/saem-4.png and b/docs/reference/saem-4.png differ diff --git a/docs/reference/saem.html b/docs/reference/saem.html index 1bc6308e..5e7e0861 100644 --- a/docs/reference/saem.html +++ b/docs/reference/saem.html @@ -19,7 +19,7 @@ Expectation Maximisation algorithm (SAEM)."> + + +
    +
    + + + +
    +
    + + +
    +

    This function automates replacing unquantified values in residue time and +depth series. For time series, the function performs part of the residue +processing proposed in the FOCUS kinetics guidance for parent compounds +and metabolites. For two-dimensional residue series over time and depth, +it automates the proposal of Boesten et al (2015).

    +
    + +
    +
    set_nd_nq(res_raw, lod, loq = NA, time_zero_presence = FALSE)
    +
    +set_nd_nq_focus(
    +  res_raw,
    +  lod,
    +  loq = NA,
    +  set_first_sample_nd = TRUE,
    +  first_sample_nd_value = 0,
    +  ignore_below_loq_after_first_nd = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    res_raw
    +

    Character vector of a residue time series, or matrix of +residue values with rows representing depth profiles for a specific sampling +time, and columns representing time series of residues at the same depth. +Values below the limit of detection (lod) have to be coded as "nd", values +between the limit of detection and the limit of quantification, if any, have +to be coded as "nq". Samples not analysed have to be coded as "na". All +values that are not "na", "nd" or "nq" have to be coercible to numeric

    + + +
    lod
    +

    Limit of detection (numeric)

    + + +
    loq
    +

    Limit of quantification(numeric). Must be specified if the FOCUS rule to +stop after the first non-detection is to be applied

    + + +
    time_zero_presence
    +

    Do we assume that residues occur at time zero? +This only affects samples from the first sampling time that have been +reported as "nd" (not detected).

    + + +
    set_first_sample_nd
    +

    Should the first sample be set to "first_sample_nd_value" +in case it is a non-detection?

    + + +
    first_sample_nd_value
    +

    Value to be used for the first sample if it is a non-detection

    + + +
    ignore_below_loq_after_first_nd
    +

    Should we ignore values below the LOQ after the first +non-detection that occurs after the quantified values?

    + +
    +
    +

    Value

    + + +

    A numeric vector, if a vector was supplied, or a numeric matrix otherwise

    +
    +
    +

    Functions

    + +
    • set_nd_nq_focus(): Set non-detects in residue time series according to FOCUS rules

    • +
    +
    +

    References

    +

    Boesten, J. J. T. I., van der Linden, A. M. A., Beltman, W. H. +J. and Pol, J. W. (2015). Leaching of plant protection products and their +transformation products; Proposals for improving the assessment of leaching +to groundwater in the Netherlands — Version 2. Alterra report 2630, Alterra +Wageningen UR (University & Research centre)

    +

    FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation +Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, +18 December 2014, p. 251

    +
    + +
    +

    Examples

    +
    # FOCUS (2014) p. 75/76 and 131/132
    +parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd")
    +set_nd_nq(parent_1, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_2 <- c(.12, .09, .05, .03, "nd", "nd", .03, "nd", "nd", "nd")
    +set_nd_nq(parent_2, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.03 0.01   NA   NA
    +set_nd_nq_focus(parent_2, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_3 <- c(.12, .09, .05, .03, "nd", "nd", .06, "nd", "nd", "nd")
    +set_nd_nq(parent_3, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +set_nd_nq_focus(parent_3, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +metabolite <- c("nd", "nd", "nd", 0.03, 0.06, 0.10, 0.11, 0.10, 0.09, 0.05, 0.03, "nd", "nd")
    +set_nd_nq(metabolite, 0.02)
    +#>  [1]   NA   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +set_nd_nq_focus(metabolite, 0.02, 0.05)
    +#>  [1] 0.00   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +#
    +# Boesten et al. (2015), p. 57/58
    +table_8 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nq", 2), rep("nd", 2),
    +    10, 10, 10, "nq", "nd", "nd",
    +    "nq", 10, "nq", rep("nd", 3),
    +    "nd", "nq", "nq", rep("nd", 3),
    +    rep("nd", 6), rep("nd", 6)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_8, 0.5, 1.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25 0.25   NA   NA
    +#> [2,] 10.00 10.00  1.00 1.00 0.25   NA
    +#> [3,] 10.00 10.00 10.00 1.00 0.25   NA
    +#> [4,]  1.00 10.00  1.00 0.25   NA   NA
    +#> [5,]  0.25  1.00  1.00 0.25   NA   NA
    +#> [6,]    NA  0.25  0.25   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +table_10 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nd", 4),
    +    10, 10, 10, rep("nd", 3),
    +    "nd", 10, rep("nd", 4),
    +    rep("nd", 18)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_10, 0.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25   NA   NA   NA
    +#> [2,] 10.00 10.00  0.25   NA   NA   NA
    +#> [3,] 10.00 10.00 10.00 0.25   NA   NA
    +#> [4,]  0.25 10.00  0.25   NA   NA   NA
    +#> [5,]    NA  0.25    NA   NA   NA   NA
    +#> [6,]    NA    NA    NA   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/sigma_twocomp.html b/docs/reference/sigma_twocomp.html index 23102f17..c1db0d30 100644 --- a/docs/reference/sigma_twocomp.html +++ b/docs/reference/sigma_twocomp.html @@ -18,7 +18,7 @@ dependence of the measured value \(y\):"> + + +
    +
    + + + +
    +
    + + +
    +

    Method to get status information for fit array objects

    +
    + +
    +
    status(object, ...)
    +
    +# S3 method for mmkin
    +status(object, ...)
    +
    +# S3 method for status.mmkin
    +print(x, ...)
    +
    +# S3 method for mhmkin
    +status(object, ...)
    +
    +# S3 method for status.mhmkin
    +print(x, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    The object to investigate

    + + +
    ...
    +

    For potential future extensions

    + + +
    x
    +

    The object to be printed

    + +
    +
    +

    Value

    + + +

    An object with the same dimensions as the fit array +suitable printing method.

    +
    + +
    +

    Examples

    +
    # \dontrun{
    +fits <- mmkin(
    +  c("SFO", "FOMC"),
    +  list("FOCUS A" = FOCUS_2006_A,
    +       "FOCUS B" = FOCUS_2006_C),
    +  quiet = TRUE)
    +status(fits)
    +#>       dataset
    +#> model  FOCUS A FOCUS B
    +#>   SFO  OK      OK     
    +#>   FOMC OK      OK     
    +#> 
    +#> OK: No warnings
    +# }
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 17ecdfe4..0bb7f424 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -21,7 +21,7 @@ values.">Summary method for class "mmkin" — summary.mmkin • mkinWrap the output of a summary function in tex listing environment — tex_listing • mkin + + +
    +
    + + + +
    +
    + + +
    +

    This function can be used in a R markdown code chunk with the chunk +option results = "asis".

    +
    + +
    +
    tex_listing(object, caption = NULL, label = NULL, clearpage = TRUE)
    +
    + +
    +

    Arguments

    +
    object
    +

    The object for which the summary is to be listed

    + + +
    caption
    +

    An optional caption

    + + +
    label
    +

    An optional label

    + + +
    clearpage
    +

    Should a new page be started after the listing?

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 2da09efe..66e94941 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -22,7 +22,7 @@ the ilr transformation is used."> + + +
    +
    + + + +
    +
    + + +
    +

    The R code used to create this data object is installed with this package in +the 'dataset_generation' directory.

    +
    + + + +
    +

    Examples

    +
    # \dontrun{
    +  sfo_mmkin <- mmkin("SFO", ds_sfo, quiet = TRUE, error_model = "tc", cores = 15)
    +  sfo_saem <- saem(sfo_mmkin, no_random_effect = "parent_0")
    +  plot(sfo_saem)
    +
    +# }
    +
    +# This is the code used to generate the datasets
    +cat(readLines(system.file("dataset_generation/ds_mixed.R", package = "mkin")), sep = "\n")
    +#> # Synthetic data for hierarchical kinetic models
    +#> # Refactored version of the code previously in tests/testthat/setup_script.R
    +#> # The number of datasets was 3 for FOMC, and 10 for HS in that script, now it
    +#> # is always 15 for consistency
    +#> 
    +#> library(mkin)  # We use mkinmod and mkinpredict
    +#> sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +#> n <- 15
    +#> log_sd <- 0.3
    +#> err_1 = list(const = 1, prop = 0.05)
    +#> tc <- function(value) sigma_twocomp(value, err_1$const, err_1$prop)
    +#> const <- function(value) 2
    +#> 
    +#> set.seed(123456)
    +#> SFO <- mkinmod(parent = mkinsub("SFO"))
    +#> sfo_pop <- list(parent_0 = 100, k_parent = 0.03)
    +#> sfo_parms <- as.matrix(data.frame(
    +#>     k_parent = rlnorm(n, log(sfo_pop$k_parent), log_sd)))
    +#> set.seed(123456)
    +#> ds_sfo <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(SFO, sfo_parms[i, ],
    +#>     c(parent = sfo_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_sfo, "pop") <- sfo_pop
    +#> attr(ds_sfo, "parms") <- sfo_parms
    +#> 
    +#> set.seed(123456)
    +#> FOMC <- mkinmod(parent = mkinsub("FOMC"))
    +#> fomc_pop <- list(parent_0 = 100, alpha = 2, beta = 8)
    +#> fomc_parms <- as.matrix(data.frame(
    +#>     alpha = rlnorm(n, log(fomc_pop$alpha), 0.4),
    +#>     beta = rlnorm(n, log(fomc_pop$beta), 0.2)))
    +#> set.seed(123456)
    +#> ds_fomc <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(FOMC, fomc_parms[i, ],
    +#>     c(parent = fomc_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_fomc, "pop") <- fomc_pop
    +#> attr(ds_fomc, "parms") <- fomc_parms
    +#> 
    +#> set.seed(123456)
    +#> DFOP <- mkinmod(parent = mkinsub("DFOP"))
    +#> dfop_pop <- list(parent_0 = 100, k1 = 0.06, k2 = 0.015, g = 0.4)
    +#> dfop_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(dfop_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(dfop_pop$k2), log_sd),
    +#>   g = plogis(rnorm(n, qlogis(dfop_pop$g), log_sd))))
    +#> set.seed(123456)
    +#> ds_dfop <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(DFOP, dfop_parms[i, ],
    +#>     c(parent = dfop_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_dfop, "pop") <- dfop_pop
    +#> attr(ds_dfop, "parms") <- dfop_parms
    +#> 
    +#> set.seed(123456)
    +#> HS <- mkinmod(parent = mkinsub("HS"))
    +#> hs_pop <- list(parent_0 = 100, k1 = 0.08, k2 = 0.01, tb = 15)
    +#> hs_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(hs_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(hs_pop$k2), log_sd),
    +#>   tb = rlnorm(n, log(hs_pop$tb), 0.1)))
    +#> set.seed(123456)
    +#> ds_hs <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(HS, hs_parms[i, ],
    +#>     c(parent = hs_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, const, n = 1)[[1]]
    +#> })
    +#> attr(ds_hs, "pop") <- hs_pop
    +#> attr(ds_hs, "parms") <- hs_parms
    +#> 
    +#> set.seed(123456)
    +#> DFOP_SFO <- mkinmod(
    +#>   parent = mkinsub("DFOP", "m1"),
    +#>   m1 = mkinsub("SFO"),
    +#>   quiet = TRUE)
    +#> dfop_sfo_pop <- list(parent_0 = 100,
    +#>   k_m1 = 0.007, f_parent_to_m1 = 0.5,
    +#>   k1 = 0.1, k2 = 0.02, g = 0.5)
    +#> dfop_sfo_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(dfop_sfo_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(dfop_sfo_pop$k2), log_sd),
    +#>   g = plogis(rnorm(n, qlogis(dfop_sfo_pop$g), log_sd)),
    +#>   f_parent_to_m1 = plogis(rnorm(n,
    +#>       qlogis(dfop_sfo_pop$f_parent_to_m1), log_sd)),
    +#>   k_m1 = rlnorm(n, log(dfop_sfo_pop$k_m1), log_sd)))
    +#> ds_dfop_sfo_mean <- lapply(1:n,
    +#>   function(i) {
    +#>     mkinpredict(DFOP_SFO, dfop_sfo_parms[i, ],
    +#>       c(parent = dfop_sfo_pop$parent_0, m1 = 0), sampling_times)
    +#>   }
    +#> )
    +#> set.seed(123456)
    +#> ds_dfop_sfo <- lapply(ds_dfop_sfo_mean, function(ds) {
    +#>   add_err(ds,
    +#>     sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2),
    +#>     n = 1, secondary = "m1")[[1]]
    +#> })
    +#> attr(ds_dfop_sfo, "pop") <- dfop_sfo_pop
    +#> attr(ds_dfop_sfo, "parms") <- dfop_sfo_parms
    +#> 
    +#> #save(ds_sfo, ds_fomc, ds_dfop, ds_hs, ds_dfop_sfo, file = "data/ds_mixed.rda", version = 2)
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 665912f7..9fddf541 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.1 @@ -268,9 +268,9 @@ degradation models and one or more error models

    -

    focus_soil_moisture

    +

    ds_mixed ds_sfo ds_fomc ds_dfop ds_hs ds_dfop_sfo

    -

    FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar

    +

    Synthetic data for hierarchical kinetic degradation models

    D24_2014

    @@ -327,6 +327,10 @@ degradation models and one or more error models

    test_data_from_UBA_2014

    Three experimental datasets from two water sediment systems and one soil

    + +

    focus_soil_moisture

    + +

    FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar

    print(<mkinds>)

    diff --git a/docs/reference/parplot.html b/docs/reference/parplot.html index f4f3c811..ab02cbb3 100644 --- a/docs/reference/parplot.html +++ b/docs/reference/parplot.html @@ -19,7 +19,7 @@ or by their medians as proposed in the paper by Duchesne et al. (2021).">
    +
    @@ -112,207 +123,207 @@

    This is just a very simple vignette showing how to fit a degradation model for a parent compound with one transformation product using mkin. After loading the library we look at the data. We have observed concentrations in the column named value at the times specified in column time for the two observed variables named parent and m1.

    -library(mkin, quietly = TRUE)
    -print(FOCUS_2006_D)
    -
    ##      name time  value
    -## 1  parent    0  99.46
    -## 2  parent    0 102.04
    -## 3  parent    1  93.50
    -## 4  parent    1  92.50
    -## 5  parent    3  63.23
    -## 6  parent    3  68.99
    -## 7  parent    7  52.32
    -## 8  parent    7  55.13
    -## 9  parent   14  27.27
    -## 10 parent   14  26.64
    -## 11 parent   21  11.50
    -## 12 parent   21  11.64
    -## 13 parent   35   2.85
    -## 14 parent   35   2.91
    -## 15 parent   50   0.69
    -## 16 parent   50   0.63
    -## 17 parent   75   0.05
    -## 18 parent   75   0.06
    -## 19 parent  100     NA
    -## 20 parent  100     NA
    -## 21 parent  120     NA
    -## 22 parent  120     NA
    -## 23     m1    0   0.00
    -## 24     m1    0   0.00
    -## 25     m1    1   4.84
    -## 26     m1    1   5.64
    -## 27     m1    3  12.91
    -## 28     m1    3  12.96
    -## 29     m1    7  22.97
    -## 30     m1    7  24.47
    -## 31     m1   14  41.69
    -## 32     m1   14  33.21
    -## 33     m1   21  44.37
    -## 34     m1   21  46.44
    -## 35     m1   35  41.22
    -## 36     m1   35  37.95
    -## 37     m1   50  41.19
    -## 38     m1   50  40.01
    -## 39     m1   75  40.09
    -## 40     m1   75  33.85
    -## 41     m1  100  31.04
    -## 42     m1  100  33.13
    -## 43     m1  120  25.15
    -## 44     m1  120  33.31
    +library(mkin, quietly = TRUE) +print(FOCUS_2006_D)
    +
    ##      name time  value
    +## 1  parent    0  99.46
    +## 2  parent    0 102.04
    +## 3  parent    1  93.50
    +## 4  parent    1  92.50
    +## 5  parent    3  63.23
    +## 6  parent    3  68.99
    +## 7  parent    7  52.32
    +## 8  parent    7  55.13
    +## 9  parent   14  27.27
    +## 10 parent   14  26.64
    +## 11 parent   21  11.50
    +## 12 parent   21  11.64
    +## 13 parent   35   2.85
    +## 14 parent   35   2.91
    +## 15 parent   50   0.69
    +## 16 parent   50   0.63
    +## 17 parent   75   0.05
    +## 18 parent   75   0.06
    +## 19 parent  100     NA
    +## 20 parent  100     NA
    +## 21 parent  120     NA
    +## 22 parent  120     NA
    +## 23     m1    0   0.00
    +## 24     m1    0   0.00
    +## 25     m1    1   4.84
    +## 26     m1    1   5.64
    +## 27     m1    3  12.91
    +## 28     m1    3  12.96
    +## 29     m1    7  22.97
    +## 30     m1    7  24.47
    +## 31     m1   14  41.69
    +## 32     m1   14  33.21
    +## 33     m1   21  44.37
    +## 34     m1   21  46.44
    +## 35     m1   35  41.22
    +## 36     m1   35  37.95
    +## 37     m1   50  41.19
    +## 38     m1   50  40.01
    +## 39     m1   75  40.09
    +## 40     m1   75  33.85
    +## 41     m1  100  31.04
    +## 42     m1  100  33.13
    +## 43     m1  120  25.15
    +## 44     m1  120  33.31

    Next we specify the degradation model: The parent compound degrades with simple first-order kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.

    The call to mkinmod returns a degradation model. The differential equations represented in R code can be found in the character vector $diffs of the mkinmod object. If a C compiler (gcc) is installed and functional, the differential equation model will be compiled from auto-generated C code.

    -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
    -
    ## Temporary DLL for differentials generated and loaded
    +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
    +
    ## Temporary DLL for differentials generated and loaded
    -print(SFO_SFO$diffs)
    -
    ##                                                    parent 
    -##                          "d_parent = - k_parent * parent" 
    -##                                                        m1 
    -## "d_m1 = + f_parent_to_m1 * k_parent * parent - k_m1 * m1"
    +print(SFO_SFO$diffs)
    +
    ##                                                    parent 
    +##                          "d_parent = - k_parent * parent" 
    +##                                                        m1 
    +## "d_m1 = + f_parent_to_m1 * k_parent * parent - k_m1 * m1"

    We do the fitting without progress report (quiet = TRUE).

    -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
    -
    ## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Observations with value
    -## of zero were removed from the data
    +fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) +
    ## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Observations with value
    +## of zero were removed from the data

    A plot of the fit including a residual plot for both observed variables is obtained using the plot_sep method for mkinfit objects, which shows separate graphs for all compounds and their residuals.

    -plot_sep(fit, lpos = c("topright", "bottomright"))
    +plot_sep(fit, lpos = c("topright", "bottomright"))

    Confidence intervals for the parameter estimates are obtained using the mkinparplot function.

    +mkinparplot(fit)

    A comprehensive report of the results is obtained using the summary method for mkinfit objects.

    -summary(fit)
    -
    ## mkin version used for fitting:    1.0.3.9000 
    -## R version used for fitting:       4.0.3 
    -## Date of fit:     Mon Feb 15 17:13:36 2021 
    -## Date of summary: Mon Feb 15 17:13:37 2021 
    -## 
    -## Equations:
    -## d_parent/dt = - k_parent * parent
    -## d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1
    -## 
    -## Model predictions using solution type analytical 
    -## 
    -## Fitted using 401 model solutions performed in 0.161 s
    -## 
    -## Error model: Constant variance 
    -## 
    -## Error model algorithm: OLS 
    -## 
    -## Starting values for parameters to be optimised:
    -##                   value   type
    -## parent_0       100.7500  state
    -## k_parent         0.1000 deparm
    -## k_m1             0.1001 deparm
    -## f_parent_to_m1   0.5000 deparm
    -## 
    -## Starting values for the transformed parameters actually optimised:
    -##                      value lower upper
    -## parent_0        100.750000  -Inf   Inf
    -## log_k_parent     -2.302585  -Inf   Inf
    -## log_k_m1         -2.301586  -Inf   Inf
    -## f_parent_qlogis   0.000000  -Inf   Inf
    -## 
    -## Fixed parameter values:
    -##      value  type
    -## m1_0     0 state
    -## 
    -## 
    -## Warning(s): 
    -## Observations with value of zero were removed from the data
    -## 
    -## Results:
    -## 
    -##        AIC      BIC    logLik
    -##   204.4486 212.6365 -97.22429
    -## 
    -## Optimised, transformed parameters with symmetric confidence intervals:
    -##                 Estimate Std. Error   Lower    Upper
    -## parent_0        99.60000    1.57000 96.4000 102.8000
    -## log_k_parent    -2.31600    0.04087 -2.3990  -2.2330
    -## log_k_m1        -5.24700    0.13320 -5.5180  -4.9770
    -## f_parent_qlogis  0.05792    0.08926 -0.1237   0.2395
    -## sigma            3.12600    0.35850  2.3960   3.8550
    -## 
    -## Parameter correlation:
    -##                   parent_0 log_k_parent   log_k_m1 f_parent_qlogis      sigma
    -## parent_0         1.000e+00    5.174e-01 -1.688e-01      -5.471e-01 -1.172e-06
    -## log_k_parent     5.174e-01    1.000e+00 -3.263e-01      -5.426e-01 -8.483e-07
    -## log_k_m1        -1.688e-01   -3.263e-01  1.000e+00       7.478e-01  8.205e-07
    -## f_parent_qlogis -5.471e-01   -5.426e-01  7.478e-01       1.000e+00  1.305e-06
    -## sigma           -1.172e-06   -8.483e-07  8.205e-07       1.305e-06  1.000e+00
    -## 
    -## Backtransformed parameters:
    -## Confidence intervals for internally transformed parameters are asymmetric.
    -## t-test (unrealistically) based on the assumption of normal distribution
    -## for estimators of untransformed parameters.
    -##                 Estimate t value    Pr(>t)     Lower     Upper
    -## parent_0       99.600000  63.430 2.298e-36 96.400000 1.028e+02
    -## k_parent        0.098700  24.470 4.955e-23  0.090820 1.073e-01
    -## k_m1            0.005261   7.510 6.165e-09  0.004012 6.898e-03
    -## f_parent_to_m1  0.514500  23.070 3.104e-22  0.469100 5.596e-01
    -## sigma           3.126000   8.718 2.235e-10  2.396000 3.855e+00
    -## 
    -## FOCUS Chi2 error levels in percent:
    -##          err.min n.optim df
    -## All data   6.398       4 15
    -## parent     6.459       2  7
    -## m1         4.690       2  8
    -## 
    -## Resulting formation fractions:
    -##                 ff
    -## parent_m1   0.5145
    -## parent_sink 0.4855
    -## 
    -## Estimated disappearance times:
    -##           DT50   DT90
    -## parent   7.023  23.33
    -## m1     131.761 437.70
    -## 
    -## Data:
    -##  time variable observed predicted   residual
    -##     0   parent    99.46  99.59848 -1.385e-01
    -##     0   parent   102.04  99.59848  2.442e+00
    -##     1   parent    93.50  90.23787  3.262e+00
    -##     1   parent    92.50  90.23787  2.262e+00
    -##     3   parent    63.23  74.07319 -1.084e+01
    -##     3   parent    68.99  74.07319 -5.083e+00
    -##     7   parent    52.32  49.91207  2.408e+00
    -##     7   parent    55.13  49.91207  5.218e+00
    -##    14   parent    27.27  25.01258  2.257e+00
    -##    14   parent    26.64  25.01258  1.627e+00
    -##    21   parent    11.50  12.53462 -1.035e+00
    -##    21   parent    11.64  12.53462 -8.946e-01
    -##    35   parent     2.85   3.14787 -2.979e-01
    -##    35   parent     2.91   3.14787 -2.379e-01
    -##    50   parent     0.69   0.71624 -2.624e-02
    -##    50   parent     0.63   0.71624 -8.624e-02
    -##    75   parent     0.05   0.06074 -1.074e-02
    -##    75   parent     0.06   0.06074 -7.382e-04
    -##     1       m1     4.84   4.80296  3.704e-02
    -##     1       m1     5.64   4.80296  8.370e-01
    -##     3       m1    12.91  13.02400 -1.140e-01
    -##     3       m1    12.96  13.02400 -6.400e-02
    -##     7       m1    22.97  25.04476 -2.075e+00
    -##     7       m1    24.47  25.04476 -5.748e-01
    -##    14       m1    41.69  36.69003  5.000e+00
    -##    14       m1    33.21  36.69003 -3.480e+00
    -##    21       m1    44.37  41.65310  2.717e+00
    -##    21       m1    46.44  41.65310  4.787e+00
    -##    35       m1    41.22  43.31313 -2.093e+00
    -##    35       m1    37.95  43.31313 -5.363e+00
    -##    50       m1    41.19  41.21832 -2.832e-02
    -##    50       m1    40.01  41.21832 -1.208e+00
    -##    75       m1    40.09  36.44704  3.643e+00
    -##    75       m1    33.85  36.44704 -2.597e+00
    -##   100       m1    31.04  31.98162 -9.416e-01
    -##   100       m1    33.13  31.98162  1.148e+00
    -##   120       m1    25.15  28.78984 -3.640e+00
    -##   120       m1    33.31  28.78984  4.520e+00
    +summary(fit) +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:04 2022 
    +## Date of summary: Thu Nov 24 08:12:05 2022 
    +## 
    +## Equations:
    +## d_parent/dt = - k_parent * parent
    +## d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1
    +## 
    +## Model predictions using solution type analytical 
    +## 
    +## Fitted using 401 model solutions performed in 0.152 s
    +## 
    +## Error model: Constant variance 
    +## 
    +## Error model algorithm: OLS 
    +## 
    +## Starting values for parameters to be optimised:
    +##                   value   type
    +## parent_0       100.7500  state
    +## k_parent         0.1000 deparm
    +## k_m1             0.1001 deparm
    +## f_parent_to_m1   0.5000 deparm
    +## 
    +## Starting values for the transformed parameters actually optimised:
    +##                      value lower upper
    +## parent_0        100.750000  -Inf   Inf
    +## log_k_parent     -2.302585  -Inf   Inf
    +## log_k_m1         -2.301586  -Inf   Inf
    +## f_parent_qlogis   0.000000  -Inf   Inf
    +## 
    +## Fixed parameter values:
    +##      value  type
    +## m1_0     0 state
    +## 
    +## 
    +## Warning(s): 
    +## Observations with value of zero were removed from the data
    +## 
    +## Results:
    +## 
    +##        AIC      BIC    logLik
    +##   204.4486 212.6365 -97.22429
    +## 
    +## Optimised, transformed parameters with symmetric confidence intervals:
    +##                 Estimate Std. Error   Lower    Upper
    +## parent_0        99.60000    1.57000 96.4000 102.8000
    +## log_k_parent    -2.31600    0.04087 -2.3990  -2.2330
    +## log_k_m1        -5.24700    0.13320 -5.5180  -4.9770
    +## f_parent_qlogis  0.05792    0.08926 -0.1237   0.2395
    +## sigma            3.12600    0.35850  2.3960   3.8550
    +## 
    +## Parameter correlation:
    +##                   parent_0 log_k_parent   log_k_m1 f_parent_qlogis      sigma
    +## parent_0         1.000e+00    5.174e-01 -1.688e-01      -5.471e-01 -1.172e-06
    +## log_k_parent     5.174e-01    1.000e+00 -3.263e-01      -5.426e-01 -8.483e-07
    +## log_k_m1        -1.688e-01   -3.263e-01  1.000e+00       7.478e-01  8.205e-07
    +## f_parent_qlogis -5.471e-01   -5.426e-01  7.478e-01       1.000e+00  1.305e-06
    +## sigma           -1.172e-06   -8.483e-07  8.205e-07       1.305e-06  1.000e+00
    +## 
    +## Backtransformed parameters:
    +## Confidence intervals for internally transformed parameters are asymmetric.
    +## t-test (unrealistically) based on the assumption of normal distribution
    +## for estimators of untransformed parameters.
    +##                 Estimate t value    Pr(>t)     Lower     Upper
    +## parent_0       99.600000  63.430 2.298e-36 96.400000 1.028e+02
    +## k_parent        0.098700  24.470 4.955e-23  0.090820 1.073e-01
    +## k_m1            0.005261   7.510 6.165e-09  0.004012 6.898e-03
    +## f_parent_to_m1  0.514500  23.070 3.104e-22  0.469100 5.596e-01
    +## sigma           3.126000   8.718 2.235e-10  2.396000 3.855e+00
    +## 
    +## FOCUS Chi2 error levels in percent:
    +##          err.min n.optim df
    +## All data   6.398       4 15
    +## parent     6.459       2  7
    +## m1         4.690       2  8
    +## 
    +## Resulting formation fractions:
    +##                 ff
    +## parent_m1   0.5145
    +## parent_sink 0.4855
    +## 
    +## Estimated disappearance times:
    +##           DT50   DT90
    +## parent   7.023  23.33
    +## m1     131.761 437.70
    +## 
    +## Data:
    +##  time variable observed predicted   residual
    +##     0   parent    99.46  99.59848 -1.385e-01
    +##     0   parent   102.04  99.59848  2.442e+00
    +##     1   parent    93.50  90.23787  3.262e+00
    +##     1   parent    92.50  90.23787  2.262e+00
    +##     3   parent    63.23  74.07319 -1.084e+01
    +##     3   parent    68.99  74.07319 -5.083e+00
    +##     7   parent    52.32  49.91207  2.408e+00
    +##     7   parent    55.13  49.91207  5.218e+00
    +##    14   parent    27.27  25.01258  2.257e+00
    +##    14   parent    26.64  25.01258  1.627e+00
    +##    21   parent    11.50  12.53462 -1.035e+00
    +##    21   parent    11.64  12.53462 -8.946e-01
    +##    35   parent     2.85   3.14787 -2.979e-01
    +##    35   parent     2.91   3.14787 -2.379e-01
    +##    50   parent     0.69   0.71624 -2.624e-02
    +##    50   parent     0.63   0.71624 -8.624e-02
    +##    75   parent     0.05   0.06074 -1.074e-02
    +##    75   parent     0.06   0.06074 -7.382e-04
    +##     1       m1     4.84   4.80296  3.704e-02
    +##     1       m1     5.64   4.80296  8.370e-01
    +##     3       m1    12.91  13.02400 -1.140e-01
    +##     3       m1    12.96  13.02400 -6.400e-02
    +##     7       m1    22.97  25.04476 -2.075e+00
    +##     7       m1    24.47  25.04476 -5.748e-01
    +##    14       m1    41.69  36.69003  5.000e+00
    +##    14       m1    33.21  36.69003 -3.480e+00
    +##    21       m1    44.37  41.65310  2.717e+00
    +##    21       m1    46.44  41.65310  4.787e+00
    +##    35       m1    41.22  43.31313 -2.093e+00
    +##    35       m1    37.95  43.31313 -5.363e+00
    +##    50       m1    41.19  41.21832 -2.832e-02
    +##    50       m1    40.01  41.21832 -1.208e+00
    +##    75       m1    40.09  36.44704  3.643e+00
    +##    75       m1    33.85  36.44704 -2.597e+00
    +##   100       m1    31.04  31.98162 -9.416e-01
    +##   100       m1    33.13  31.98162  1.148e+00
    +##   120       m1    25.15  28.78984 -3.640e+00
    +##   120       m1    33.31  28.78984  4.520e+00
    @@ -63,11 +63,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -75,7 +78,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -106,7 +112,7 @@

    Example evaluation of FOCUS Laboratory Data L1 to L3

    Johannes Ranke

    -

    Last change 18 May 2022 (rebuilt 2022-09-16)

    +

    Last change 18 May 2022 (rebuilt 2022-11-24)

    Source: vignettes/FOCUS_L.rmd @@ -132,17 +138,17 @@
     m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
     summary(m.L1.SFO)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:35 2022 
    -## Date of summary: Fri Sep 16 10:31:35 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:09 2022 
    +## Date of summary: Thu Nov 24 08:12:09 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - k_parent * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 133 model solutions performed in 0.032 s
    +## Fitted using 133 model solutions performed in 0.033 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -238,17 +244,17 @@
     
    ## Warning in sqrt(1/diag(V)): NaNs produced
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
     ## doubtful
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:36 2022 
    -## Date of summary: Fri Sep 16 10:31:36 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:09 2022 
    +## Date of summary: Thu Nov 24 08:12:09 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 369 model solutions performed in 0.081 s
    +## Fitted using 369 model solutions performed in 0.091 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -350,17 +356,17 @@
     

     summary(m.L2.FOMC, data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:36 2022 
    -## Date of summary: Fri Sep 16 10:31:36 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:10 2022 
    +## Date of summary: Thu Nov 24 08:12:10 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 239 model solutions performed in 0.049 s
    +## Fitted using 239 model solutions performed in 0.048 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -431,10 +437,10 @@
     

     summary(m.L2.DFOP, data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:37 2022 
    -## Date of summary: Fri Sep 16 10:31:37 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:10 2022 
    +## Date of summary: Thu Nov 24 08:12:10 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    @@ -443,7 +449,7 @@
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 581 model solutions performed in 0.132 s
    +## Fitted using 581 model solutions performed in 0.13 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -537,10 +543,10 @@
     

    We can extract the summary and plot for e.g. the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.

     summary(mm.L3[["DFOP", 1]])
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:37 2022 
    -## Date of summary: Fri Sep 16 10:31:38 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:11 2022 
    +## Date of summary: Thu Nov 24 08:12:11 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    @@ -549,7 +555,7 @@
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 376 model solutions performed in 0.079 s
    +## Fitted using 376 model solutions performed in 0.078 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -650,17 +656,17 @@
     

    The \(\chi^2\) error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the \(\chi^2\) test passes is slightly lower for the FOMC model. However, the difference appears negligible.

     summary(mm.L4[["SFO", 1]], data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:38 2022 
    -## Date of summary: Fri Sep 16 10:31:38 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:12 2022 
    +## Date of summary: Thu Nov 24 08:12:12 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - k_parent * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 142 model solutions performed in 0.03 s
    +## Fitted using 142 model solutions performed in 0.029 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -715,17 +721,17 @@
     ## parent  106  352
     summary(mm.L4[["FOMC", 1]], data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Fri Sep 16 10:31:38 2022 
    -## Date of summary: Fri Sep 16 10:31:38 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Thu Nov 24 08:12:12 2022 
    +## Date of summary: Thu Nov 24 08:12:12 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 224 model solutions performed in 0.045 s
    +## Fitted using 224 model solutions performed in 0.044 s
     ## 
     ## Error model: Constant variance 
     ## 
    diff --git a/docs/dev/articles/index.html b/docs/dev/articles/index.html
    index 395b5f7c..e04302ef 100644
    --- a/docs/dev/articles/index.html
    +++ b/docs/dev/articles/index.html
    @@ -17,7 +17,7 @@
           
           
             mkin
    -        1.2.0
    +        1.2.2
           
         
     
    diff --git a/docs/dev/articles/mkin.html b/docs/dev/articles/mkin.html
    index 27e532af..df4df718 100644
    --- a/docs/dev/articles/mkin.html
    +++ b/docs/dev/articles/mkin.html
    @@ -34,7 +34,7 @@
           
           
             mkin
    -        1.2.0
    +        1.2.2
           
         
     
    @@ -112,7 +112,7 @@
           

    Introduction to mkin

    Johannes Ranke

    -

    Last change 15 February 2021 (rebuilt 2022-11-16)

    +

    Last change 15 February 2021 (rebuilt 2022-11-24)

    Source: vignettes/mkin.rmd diff --git a/docs/dev/articles/twa.html b/docs/dev/articles/twa.html index 30eeb5a6..673d753a 100644 --- a/docs/dev/articles/twa.html +++ b/docs/dev/articles/twa.html @@ -20,6 +20,8 @@ + +
    +
    @@ -141,10 +152,10 @@

    \[f_\textrm{twa} = \frac{1}{t} \left( \frac{1}{k_1} \left( 1 - e^{- k_1 t_b} \right) + \frac{e^{- k_1 t_b}}{k_2} \left( 1 - e^{- k_2 (t - t_b)} \right) \right) \]

    -

    Note that a method for calculating maximum moving window time weighted average concentrations for a model fitted by ‘mkinfit’ or from parent decline model parameters is included in the max_twa_parent() function. If the same is needed for metabolites, the function pfm::max_twa() from the ‘pfm’ package can be used.

    +

    Note that a method for calculating maximum moving window time weighted average concentrations for a model fitted by ‘mkinfit’ or from parent decline model parameters is included in the max_twa_parent() function. If the same is needed for metabolites, the function pfm::max_twa() from the ‘pfm’ package can be used.

    -

    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://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    +

    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://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    @@ -158,11 +169,13 @@
    -

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

    @@ -171,5 +184,7 @@ + + diff --git a/docs/dev/articles/web_only/FOCUS_Z.html b/docs/dev/articles/web_only/FOCUS_Z.html index 694b33ca..eec1ba66 100644 --- a/docs/dev/articles/web_only/FOCUS_Z.html +++ b/docs/dev/articles/web_only/FOCUS_Z.html @@ -20,6 +20,8 @@ + +
    +
    -

    Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany
    Privatdozent at the University of Bremen

    -
    -

    -The data

    +

    Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany
    Privatdozent at the University of Bremen

    +
    +

    The data +

    The following code defines the example dataset from Appendix 7 to the FOCUS kinetics report (FOCUS Work Group on Degradation Kinetics 2014, 354).

    -library(mkin, quietly = TRUE)
    -LOD = 0.5
    -FOCUS_2006_Z = data.frame(
    -  t = c(0, 0.04, 0.125, 0.29, 0.54, 1, 2, 3, 4, 7, 10, 14, 21,
    -        42, 61, 96, 124),
    -  Z0 = c(100, 81.7, 70.4, 51.1, 41.2, 6.6, 4.6, 3.9, 4.6, 4.3, 6.8,
    -         2.9, 3.5, 5.3, 4.4, 1.2, 0.7),
    -  Z1 = c(0, 18.3, 29.6, 46.3, 55.1, 65.7, 39.1, 36, 15.3, 5.6, 1.1,
    -         1.6, 0.6, 0.5 * LOD, NA, NA, NA),
    -  Z2 = c(0, NA, 0.5 * LOD, 2.6, 3.8, 15.3, 37.2, 31.7, 35.6, 14.5,
    -         0.8, 2.1, 1.9, 0.5 * LOD, NA, NA, NA),
    -  Z3 = c(0, NA, NA, NA, NA, 0.5 * LOD, 9.2, 13.1, 22.3, 28.4, 32.5,
    -         25.2, 17.2, 4.8, 4.5, 2.8, 4.4))
    -
    -FOCUS_2006_Z_mkin <- mkin_wide_to_long(FOCUS_2006_Z)
    +library(mkin, quietly = TRUE) +LOD = 0.5 +FOCUS_2006_Z = data.frame( + t = c(0, 0.04, 0.125, 0.29, 0.54, 1, 2, 3, 4, 7, 10, 14, 21, + 42, 61, 96, 124), + Z0 = c(100, 81.7, 70.4, 51.1, 41.2, 6.6, 4.6, 3.9, 4.6, 4.3, 6.8, + 2.9, 3.5, 5.3, 4.4, 1.2, 0.7), + Z1 = c(0, 18.3, 29.6, 46.3, 55.1, 65.7, 39.1, 36, 15.3, 5.6, 1.1, + 1.6, 0.6, 0.5 * LOD, NA, NA, NA), + Z2 = c(0, NA, 0.5 * LOD, 2.6, 3.8, 15.3, 37.2, 31.7, 35.6, 14.5, + 0.8, 2.1, 1.9, 0.5 * LOD, NA, NA, NA), + Z3 = c(0, NA, NA, NA, NA, 0.5 * LOD, 9.2, 13.1, 22.3, 28.4, 32.5, + 25.2, 17.2, 4.8, 4.5, 2.8, 4.4)) + +FOCUS_2006_Z_mkin <- mkin_wide_to_long(FOCUS_2006_Z)
    -
    -

    -Parent and one metabolite

    +
    +

    Parent and one metabolite +

    The next step is to set up the models used for the kinetic analysis. As the simultaneous fit of parent and the first metabolite is usually straightforward, Step 1 (SFO for parent only) is skipped here. We start with the model 2a, with formation and decline of metabolite Z1 and the pathway from parent directly to sink included (default in mkin).

    -Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
    -                Z1 = mkinsub("SFO"))
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"), + Z1 = mkinsub("SFO"))
    +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.2a <- mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.2a <- mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE)
    +
    ## Warning in mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.2a)
    +plot_sep(m.Z.2a)

    -summary(m.Z.2a, data = FALSE)$bpar
    -
    ##            Estimate se_notrans t value     Pr(>t)    Lower    Upper
    -## Z0_0       97.01488   3.301084 29.3888 3.2971e-21 91.66556 102.3642
    -## k_Z0        2.23601   0.207078 10.7979 3.3309e-11  1.95303   2.5600
    -## k_Z1        0.48212   0.063265  7.6207 2.8154e-08  0.40341   0.5762
    -## f_Z0_to_Z1  1.00000   0.094764 10.5525 5.3560e-11  0.00000   1.0000
    -## sigma       4.80411   0.635638  7.5579 3.2592e-08  3.52677   6.0815
    +summary(m.Z.2a, data = FALSE)$bpar
    +
    ##            Estimate se_notrans t value     Pr(>t)    Lower    Upper
    +## Z0_0       97.01488   3.301084 29.3888 3.2971e-21 91.66556 102.3642
    +## k_Z0        2.23601   0.207078 10.7979 3.3309e-11  1.95303   2.5600
    +## k_Z1        0.48212   0.063265  7.6207 2.8154e-08  0.40341   0.5762
    +## f_Z0_to_Z1  1.00000   0.094764 10.5525 5.3560e-11  0.00000   1.0000
    +## sigma       4.80411   0.635638  7.5579 3.2592e-08  3.52677   6.0815

    As obvious from the parameter summary (the component of the summary), the kinetic rate constant from parent compound Z to sink is very small and the t-test for this parameter suggests that it is not significantly different from zero. This suggests, in agreement with the analysis in the FOCUS kinetics report, to simplify the model by removing the pathway to sink.

    A similar result can be obtained when formation fractions are used in the model formulation:

    -Z.2a.ff <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
    -                   Z1 = mkinsub("SFO"),
    -                   use_of_ff = "max")
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.2a.ff <- mkinmod(Z0 = mkinsub("SFO", "Z1"), + Z1 = mkinsub("SFO"), + use_of_ff = "max")
    +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.2a.ff <- mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.2a.ff <- mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE)
    +
    ## Warning in mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.2a.ff)
    +plot_sep(m.Z.2a.ff)

    -summary(m.Z.2a.ff, data = FALSE)$bpar
    -
    ##            Estimate se_notrans t value     Pr(>t)    Lower    Upper
    -## Z0_0       97.01488   3.301084 29.3888 3.2971e-21 91.66556 102.3642
    -## k_Z0        2.23601   0.207078 10.7979 3.3309e-11  1.95303   2.5600
    -## k_Z1        0.48212   0.063265  7.6207 2.8154e-08  0.40341   0.5762
    -## f_Z0_to_Z1  1.00000   0.094764 10.5525 5.3560e-11  0.00000   1.0000
    -## sigma       4.80411   0.635638  7.5579 3.2592e-08  3.52677   6.0815
    +summary(m.Z.2a.ff, data = FALSE)$bpar
    +
    ##            Estimate se_notrans t value     Pr(>t)    Lower    Upper
    +## Z0_0       97.01488   3.301084 29.3888 3.2971e-21 91.66556 102.3642
    +## k_Z0        2.23601   0.207078 10.7979 3.3309e-11  1.95303   2.5600
    +## k_Z1        0.48212   0.063265  7.6207 2.8154e-08  0.40341   0.5762
    +## f_Z0_to_Z1  1.00000   0.094764 10.5525 5.3560e-11  0.00000   1.0000
    +## sigma       4.80411   0.635638  7.5579 3.2592e-08  3.52677   6.0815

    Here, the ilr transformed formation fraction fitted in the model takes a very large value, and the backtransformed formation fraction from parent Z to Z1 is practically unity. Here, the covariance matrix used for the calculation of confidence intervals is not returned as the model is overparameterised.

    A simplified model is obtained by removing the pathway to the sink.

    In the following, we use the parameterisation with formation fractions in order to be able to compare with the results in the FOCUS guidance, and as it makes it easier to use parameters obtained in a previous fit when adding a further metabolite.

    -Z.3 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
    -               Z1 = mkinsub("SFO"), use_of_ff = "max")
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.3 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE), + Z1 = mkinsub("SFO"), use_of_ff = "max")
    +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.3 <- mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.3 <- mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE)
    +
    ## Warning in mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.3)
    +plot_sep(m.Z.3)

    -summary(m.Z.3, data = FALSE)$bpar
    -
    ##       Estimate se_notrans t value     Pr(>t)    Lower    Upper
    -## Z0_0  97.01488   2.597342  37.352 2.0106e-24 91.67597 102.3538
    -## k_Z0   2.23601   0.146904  15.221 9.1477e-15  1.95354   2.5593
    -## k_Z1   0.48212   0.041727  11.554 4.8268e-12  0.40355   0.5760
    -## sigma  4.80411   0.620208   7.746 1.6110e-08  3.52925   6.0790
    +summary(m.Z.3, data = FALSE)$bpar
    +
    ##       Estimate se_notrans t value     Pr(>t)    Lower    Upper
    +## Z0_0  97.01488   2.597342  37.352 2.0106e-24 91.67597 102.3538
    +## k_Z0   2.23601   0.146904  15.221 9.1477e-15  1.95354   2.5593
    +## k_Z1   0.48212   0.041727  11.554 4.8268e-12  0.40355   0.5760
    +## sigma  4.80411   0.620208   7.746 1.6110e-08  3.52925   6.0790

    As there is only one transformation product for Z0 and no pathway to sink, the formation fraction is internally fixed to unity.

    -
    -

    -Metabolites Z2 and Z3

    +
    +

    Metabolites Z2 and Z3 +

    As suggested in the FOCUS report, the pathway to sink was removed for metabolite Z1 as well in the next step. While this step appears questionable on the basis of the above results, it is followed here for the purpose of comparison. Also, in the FOCUS report, it is assumed that there is additional empirical evidence that Z1 quickly and exclusively hydrolyses to Z2.

    -Z.5 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
    -               Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -               Z2 = mkinsub("SFO"), use_of_ff = "max")
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.5 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO"), use_of_ff = "max")
    +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.5 <- mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.5 <- mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE)
    +
    ## Warning in mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.5)
    +plot_sep(m.Z.5)

    Finally, metabolite Z3 is added to the model. We use the optimised differential equation parameter values from the previous fit in order to accelerate the optimization.

    -Z.FOCUS <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
    -                   Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -                   Z2 = mkinsub("SFO", "Z3"),
    -                   Z3 = mkinsub("SFO"),
    -                   use_of_ff = "max")
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.FOCUS <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO", "Z3"), + Z3 = mkinsub("SFO"), + use_of_ff = "max") +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.FOCUS <- mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin,
    -                     parms.ini = m.Z.5$bparms.ode,
    -                     quiet = TRUE)
    -
    ## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, :
    -## Observations with value of zero were removed from the data
    -
    ## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : Optimisation did not converge:
    -## false convergence (8)
    +m.Z.FOCUS <- mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, + parms.ini = m.Z.5$bparms.ode, + quiet = TRUE) +
    ## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, :
    +## Observations with value of zero were removed from the data
    +
    ## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : Optimisation did not converge:
    +## false convergence (8)
    -plot_sep(m.Z.FOCUS)
    +plot_sep(m.Z.FOCUS)

    -summary(m.Z.FOCUS, data = FALSE)$bpar
    -
    ##             Estimate se_notrans t value     Pr(>t)     Lower      Upper
    -## Z0_0       96.838822   1.994274 48.5584 4.0280e-42 92.826981 100.850664
    -## k_Z0        2.215393   0.118458 18.7019 1.0413e-23  1.989456   2.466989
    -## k_Z1        0.478305   0.028258 16.9266 6.2418e-22  0.424708   0.538666
    -## k_Z2        0.451627   0.042139 10.7176 1.6314e-14  0.374339   0.544872
    -## k_Z3        0.058692   0.015245  3.8499 1.7803e-04  0.034808   0.098965
    -## f_Z2_to_Z3  0.471502   0.058351  8.0805 9.6608e-11  0.357769   0.588274
    -## sigma       3.984431   0.383402 10.3923 4.5575e-14  3.213126   4.755736
    +summary(m.Z.FOCUS, data = FALSE)$bpar +
    ##             Estimate se_notrans t value     Pr(>t)     Lower      Upper
    +## Z0_0       96.838822   1.994274 48.5584 4.0280e-42 92.826981 100.850664
    +## k_Z0        2.215393   0.118458 18.7019 1.0413e-23  1.989456   2.466989
    +## k_Z1        0.478305   0.028258 16.9266 6.2418e-22  0.424708   0.538666
    +## k_Z2        0.451627   0.042139 10.7176 1.6314e-14  0.374339   0.544872
    +## k_Z3        0.058692   0.015245  3.8499 1.7803e-04  0.034808   0.098965
    +## f_Z2_to_Z3  0.471502   0.058351  8.0805 9.6608e-11  0.357769   0.588274
    +## sigma       3.984431   0.383402 10.3923 4.5575e-14  3.213126   4.755736
    -endpoints(m.Z.FOCUS)
    -
    ## $ff
    -##   Z2_Z3 Z2_sink 
    -##  0.4715  0.5285 
    -## 
    -## $distimes
    -##        DT50    DT90
    -## Z0  0.31288  1.0394
    -## Z1  1.44917  4.8141
    -## Z2  1.53478  5.0984
    -## Z3 11.80986 39.2315
    +endpoints(m.Z.FOCUS) +
    ## $ff
    +##   Z2_Z3 Z2_sink 
    +##  0.4715  0.5285 
    +## 
    +## $distimes
    +##        DT50    DT90
    +## Z0  0.31288  1.0394
    +## Z1  1.44917  4.8141
    +## Z2  1.53478  5.0984
    +## Z3 11.80986 39.2315

    This fit corresponds to the final result chosen in Appendix 7 of the FOCUS report. Confidence intervals returned by mkin are based on internally transformed parameters, however.

    -
    -

    -Using the SFORB model

    +
    +

    Using the SFORB model +

    As the FOCUS report states, there is a certain tailing of the time course of metabolite Z3. Also, the time course of the parent compound is not fitted very well using the SFO model, as residues at a certain low level remain.

    Therefore, an additional model is offered here, using the single first-order reversible binding (SFORB) model for metabolite Z3. As expected, the \(\chi^2\) error level is lower for metabolite Z3 using this model and the graphical fit for Z3 is improved. However, the covariance matrix is not returned.

    -Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
    -                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -                    Z2 = mkinsub("SFO", "Z3"),
    -                    Z3 = mkinsub("SFORB"))
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO", "Z3"), + Z3 = mkinsub("SFORB"))
    +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
    +
    ## Warning in mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.mkin.1)
    +plot_sep(m.Z.mkin.1)

    -summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
    -
    ## NULL
    +summary(m.Z.mkin.1, data = FALSE)$cov.unscaled +
    ## NULL

    Therefore, a further stepwise model building is performed starting from the stage of parent and two metabolites, starting from the assumption that the model fit for the parent compound can be improved by using the SFORB model.

    -Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
    -                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -                    Z2 = mkinsub("SFO"))
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO")) +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE)
    -
    ## Warning in mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    -## value of zero were removed from the data
    +m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE) +
    ## Warning in mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with
    +## value of zero were removed from the data
    -plot_sep(m.Z.mkin.3)
    +plot_sep(m.Z.mkin.3)

    This results in a much better representation of the behaviour of the parent compound Z0.

    Finally, Z3 is added as well. These models appear overparameterised (no covariance matrix returned) if the sink for Z1 is left in the models.

    -Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
    -                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -                    Z2 = mkinsub("SFO", "Z3"),
    -                    Z3 = mkinsub("SFO"))
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO", "Z3"), + Z3 = mkinsub("SFO")) +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.mkin.4 <- mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin,
    -                      parms.ini = m.Z.mkin.3$bparms.ode,
    -                      quiet = TRUE)
    -
    ## Warning in mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin.
    -## 3$bparms.ode, : Observations with value of zero were removed from the data
    +m.Z.mkin.4 <- mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, + parms.ini = m.Z.mkin.3$bparms.ode, + quiet = TRUE) +
    ## Warning in mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, parms.ini =
    +## m.Z.mkin.3$bparms.ode, : Observations with value of zero were removed from the
    +## data
    -plot_sep(m.Z.mkin.4)
    +plot_sep(m.Z.mkin.4)

    The error level of the fit, but especially of metabolite Z3, can be improved if the SFORB model is chosen for this metabolite, as this model is capable of representing the tailing of the metabolite decline phase.

    -Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
    -                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
    -                    Z2 = mkinsub("SFO", "Z3"),
    -                    Z3 = mkinsub("SFORB"))
    -
    ## Temporary DLL for differentials generated and loaded
    +Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE), + Z1 = mkinsub("SFO", "Z2", sink = FALSE), + Z2 = mkinsub("SFO", "Z3"), + Z3 = mkinsub("SFORB")) +
    ## Temporary DLL for differentials generated and loaded
    -m.Z.mkin.5 <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
    -                      parms.ini = m.Z.mkin.4$bparms.ode[1:4],
    -                      quiet = TRUE)
    -
    ## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin.
    -## 4$bparms.ode[1:4], : Observations with value of zero were removed from the data
    +m.Z.mkin.5 <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, + parms.ini = m.Z.mkin.4$bparms.ode[1:4], + quiet = TRUE) +
    ## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini =
    +## m.Z.mkin.4$bparms.ode[1:4], : Observations with value of zero were removed from
    +## the data
    -plot_sep(m.Z.mkin.5)
    +plot_sep(m.Z.mkin.5)

    The summary view of the backtransformed parameters shows that we get no confidence intervals due to overparameterisation. As the optimized is excessively small, it seems reasonable to fix it to zero.

    -m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
    -                       parms.ini = c(m.Z.mkin.5$bparms.ode[1:7],
    -                                     k_Z3_bound_free = 0),
    -                       fixed_parms = "k_Z3_bound_free",
    -                       quiet = TRUE)
    -
    ## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = c(m.Z.mkin.
    -## 5$bparms.ode[1:7], : Observations with value of zero were removed from the data
    +m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, + parms.ini = c(m.Z.mkin.5$bparms.ode[1:7], + k_Z3_bound_free = 0), + fixed_parms = "k_Z3_bound_free", + quiet = TRUE) +
    ## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini =
    +## c(m.Z.mkin.5$bparms.ode[1:7], : Observations with value of zero were removed
    +## from the data
    -plot_sep(m.Z.mkin.5a)
    +plot_sep(m.Z.mkin.5a)

    As expected, the residual plots for Z0 and Z3 are more random than in the case of the all SFO model for which they were shown above. In conclusion, the model is proposed as the best-fit model for the dataset from Appendix 7 of the FOCUS report.

    A graphical representation of the confidence intervals can finally be obtained.

    -mkinparplot(m.Z.mkin.5a)
    +mkinparplot(m.Z.mkin.5a)

    The endpoints obtained with this model are

    -endpoints(m.Z.mkin.5a)
    -
    ## $ff
    -## Z0_free   Z2_Z3 Z2_sink Z3_free 
    -## 1.00000 0.53656 0.46344 1.00000 
    -## 
    -## $SFORB
    -##     Z0_b1     Z0_b2     Z3_b1     Z3_b2 
    -## 2.4471322 0.0075125 0.0800069 0.0000000 
    -## 
    -## $distimes
    -##      DT50   DT90 DT50back DT50_Z0_b1 DT50_Z0_b2 DT50_Z3_b1 DT50_Z3_b2
    -## Z0 0.3043 1.1848  0.35666    0.28325     92.266         NA         NA
    -## Z1 1.5148 5.0320       NA         NA         NA         NA         NA
    -## Z2 1.6414 5.4526       NA         NA         NA         NA         NA
    -## Z3     NA     NA       NA         NA         NA     8.6636        Inf
    +endpoints(m.Z.mkin.5a) +
    ## $ff
    +## Z0_free   Z2_Z3 Z2_sink Z3_free 
    +## 1.00000 0.53656 0.46344 1.00000 
    +## 
    +## $SFORB
    +##     Z0_b1     Z0_b2      Z0_g     Z3_b1     Z3_b2      Z3_g 
    +## 2.4471322 0.0075125 0.9519862 0.0800069 0.0000000 0.9347820 
    +## 
    +## $distimes
    +##      DT50   DT90 DT50back DT50_Z0_b1 DT50_Z0_b2 DT50_Z3_b1 DT50_Z3_b2
    +## Z0 0.3043 1.1848  0.35666    0.28325     92.266         NA         NA
    +## Z1 1.5148 5.0320       NA         NA         NA         NA         NA
    +## Z2 1.6414 5.4526       NA         NA         NA         NA         NA
    +## Z3     NA     NA       NA         NA         NA     8.6636        Inf

    It is clear the degradation rate of Z3 towards the end of the experiment is very low as DT50_Z3_b2 (the second Eigenvalue of the system of two differential equations representing the SFORB system for Z3, corresponding to the slower rate constant of the DFOP model) is reported to be infinity. However, this appears to be a feature of the data.

    -
    -

    -References

    +
    +

    References +

    -

    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://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    +

    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://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    @@ -385,11 +399,13 @@
    -

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

    @@ -398,5 +414,7 @@ + + diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png index 2213c446..be652d31 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png index 61b04d3a..bc6efaf7 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png index 409f1203..55c1b645 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png index 4d6820cd..8e63cd04 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png index 2e504961..3902e059 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png index 2213c446..be652d31 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png index 7ab743af..59524035 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png index 2e0dce77..d95cac25 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png index 458299c1..cb333a1c 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png index eb833066..d87105fb 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png differ diff --git a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png index e7501cbb..db807f14 100644 Binary files a/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png and b/docs/dev/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples.html b/docs/dev/articles/web_only/NAFTA_examples.html index b9784415..a054d4a1 100644 --- a/docs/dev/articles/web_only/NAFTA_examples.html +++ b/docs/dev/articles/web_only/NAFTA_examples.html @@ -20,6 +20,8 @@ + +
    +
    -
    -

    -Introduction

    +
    +

    Introduction +

    In this document, the example evaluations provided in Attachment 1 to the SOP of US EPA for using the NAFTA guidance (US EPA 2015) are repeated using mkin. The original evaluations reported in the attachment were performed using PestDF in version 0.8.4. Note that PestDF 0.8.13 is the version distributed at the US EPA website today (2019-02-26).

    The datasets are now distributed with the mkin package.

    -
    -

    -Examples where DFOP did not converge with PestDF 0.8.4

    +
    +

    Examples where DFOP did not converge with PestDF 0.8.4 +

    In attachment 1, it is reported that the DFOP model does not converge for these datasets when PestDF 0.8.4 was used. For all four datasets, the DFOP model can be fitted with mkin (see below). The negative half-life given by PestDF 0.8.4 for these fits appears to be the result of a bug. The results for the other two models (SFO and IORE) are the same.

    -
    -

    -Example on page 5, upper panel

    +
    +

    Example on page 5, upper panel +

    -p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p5a)
    +plot(p5a)

    -print(p5a)
    -
    ## Sums of squares:
    -##       SFO      IORE      DFOP 
    -## 465.21753  56.27506  32.06401 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 64.4304
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)  Lower   Upper
    -## parent_0  95.8401 4.67e-21 92.245 99.4357
    -## k_parent   0.0102 3.92e-12  0.009  0.0117
    -## sigma      4.8230 3.81e-06  3.214  6.4318
    -## 
    -## $IORE
    -##                Estimate Pr(>t)    Lower    Upper
    -## parent_0       1.01e+02     NA 9.91e+01 1.02e+02
    -## k__iore_parent 1.54e-05     NA 4.08e-06 5.84e-05
    -## N_parent       2.57e+00     NA 2.25e+00 2.89e+00
    -## sigma          1.68e+00     NA 1.12e+00 2.24e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower    Upper
    -## parent_0 9.99e+01 1.41e-26 98.8116 101.0810
    -## k1       2.67e-02 5.05e-06  0.0243   0.0295
    -## k2       2.26e-12 5.00e-01  0.0000      Inf
    -## g        6.47e-01 3.67e-06  0.6248   0.6677
    -## sigma    1.27e+00 8.91e-06  0.8395   1.6929
    -## 
    -## 
    -## DTx values:
    -##      DT50     DT90 DT50_rep
    -## SFO  67.7 2.25e+02 6.77e+01
    -## IORE 58.2 1.07e+03 3.22e+02
    -## DFOP 55.5 5.59e+11 3.07e+11
    -## 
    -## Representative half-life:
    -## [1] 321.51
    +print(p5a)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 465.21753  56.27506  32.06401 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 64.4304
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)  Lower   Upper
    +## parent_0  95.8401 4.67e-21 92.245 99.4357
    +## k_parent   0.0102 3.92e-12  0.009  0.0117
    +## sigma      4.8230 3.81e-06  3.214  6.4318
    +## 
    +## $IORE
    +##                Estimate Pr(>t)    Lower    Upper
    +## parent_0       1.01e+02     NA 9.91e+01 1.02e+02
    +## k__iore_parent 1.54e-05     NA 4.08e-06 5.84e-05
    +## N_parent       2.57e+00     NA 2.25e+00 2.89e+00
    +## sigma          1.68e+00     NA 1.12e+00 2.24e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower    Upper
    +## parent_0 9.99e+01 1.41e-26 98.8116 101.0810
    +## k1       2.67e-02 5.05e-06  0.0243   0.0295
    +## k2       2.26e-12 5.00e-01  0.0000      Inf
    +## g        6.47e-01 3.67e-06  0.6248   0.6677
    +## sigma    1.27e+00 8.91e-06  0.8395   1.6929
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  67.7 2.25e+02 6.77e+01
    +## IORE 58.2 1.07e+03 3.22e+02
    +## DFOP 55.5 5.59e+11 3.07e+11
    +## 
    +## Representative half-life:
    +## [1] 321.51
    -
    -

    -Example on page 5, lower panel

    +
    +

    Example on page 5, lower panel +

    -p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p5b)
    +plot(p5b)

    -print(p5b)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 94.81123 10.10936  7.55871 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 11.77879
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0   96.497 2.32e-24 94.85271 98.14155
    -## k_parent    0.008 3.42e-14  0.00737  0.00869
    -## sigma       2.295 1.22e-05  1.47976  3.11036
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower    Upper
    -## parent_0       9.85e+01 1.17e-28 9.79e+01 9.92e+01
    -## k__iore_parent 1.53e-04 6.50e-03 7.21e-05 3.26e-04
    -## N_parent       1.94e+00 5.88e-13 1.76e+00 2.12e+00
    -## sigma          7.49e-01 1.63e-05 4.82e-01 1.02e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0 9.84e+01 1.24e-27 97.8078 98.9187
    -## k1       1.55e-02 4.10e-04  0.0143  0.0167
    -## k2       8.63e-12 5.00e-01  0.0000     Inf
    -## g        6.89e-01 2.92e-03  0.6626  0.7142
    -## sigma    6.48e-01 2.38e-05  0.4147  0.8813
    -## 
    -## 
    -## DTx values:
    -##      DT50     DT90 DT50_rep
    -## SFO  86.6 2.88e+02 8.66e+01
    -## IORE 85.5 7.17e+02 2.16e+02
    -## DFOP 83.6 1.32e+11 8.04e+10
    -## 
    -## Representative half-life:
    -## [1] 215.87
    +print(p5b)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 94.81123 10.10936  7.55871 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 11.77879
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0   96.497 2.32e-24 94.85271 98.14155
    +## k_parent    0.008 3.42e-14  0.00737  0.00869
    +## sigma       2.295 1.22e-05  1.47976  3.11036
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower    Upper
    +## parent_0       9.85e+01 1.17e-28 9.79e+01 9.92e+01
    +## k__iore_parent 1.53e-04 6.50e-03 7.21e-05 3.26e-04
    +## N_parent       1.94e+00 5.88e-13 1.76e+00 2.12e+00
    +## sigma          7.49e-01 1.63e-05 4.82e-01 1.02e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0 9.84e+01 1.24e-27 97.8078 98.9187
    +## k1       1.55e-02 4.10e-04  0.0143  0.0167
    +## k2       8.63e-12 5.00e-01  0.0000     Inf
    +## g        6.89e-01 2.92e-03  0.6626  0.7142
    +## sigma    6.48e-01 2.38e-05  0.4147  0.8813
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  86.6 2.88e+02 8.66e+01
    +## IORE 85.5 7.17e+02 2.16e+02
    +## DFOP 83.6 1.32e+11 8.04e+10
    +## 
    +## Representative half-life:
    +## [1] 215.87
    -
    -

    -Example on page 6

    +
    +

    Example on page 6 +

    -p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p6)
    +plot(p6)

    -print(p6)
    -
    ## Sums of squares:
    -##       SFO      IORE      DFOP 
    -## 188.45361  51.00699  42.46931 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 58.39888
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0  94.7759 7.29e-24 92.3478 97.2039
    -## k_parent   0.0179 8.02e-16  0.0166  0.0194
    -## sigma      3.0696 3.81e-06  2.0456  4.0936
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower    Upper
    -## parent_0       97.12446 2.63e-26 95.62461 98.62431
    -## k__iore_parent  0.00252 1.95e-03  0.00134  0.00472
    -## N_parent        1.49587 4.07e-13  1.33896  1.65279
    -## sigma           1.59698 5.05e-06  1.06169  2.13227
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0 9.66e+01 1.57e-25 95.3476 97.8979
    -## k1       2.55e-02 7.33e-06  0.0233  0.0278
    -## k2       3.22e-11 5.00e-01  0.0000     Inf
    -## g        8.61e-01 7.55e-06  0.8314  0.8867
    -## sigma    1.46e+00 6.93e-06  0.9661  1.9483
    -## 
    -## 
    -## DTx values:
    -##      DT50     DT90 DT50_rep
    -## SFO  38.6 1.28e+02 3.86e+01
    -## IORE 34.0 1.77e+02 5.32e+01
    -## DFOP 34.1 1.01e+10 2.15e+10
    -## 
    -## Representative half-life:
    -## [1] 53.17
    +print(p6)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 188.45361  51.00699  42.46931 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 58.39888
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0  94.7759 7.29e-24 92.3478 97.2039
    +## k_parent   0.0179 8.02e-16  0.0166  0.0194
    +## sigma      3.0696 3.81e-06  2.0456  4.0936
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower    Upper
    +## parent_0       97.12446 2.63e-26 95.62461 98.62431
    +## k__iore_parent  0.00252 1.95e-03  0.00134  0.00472
    +## N_parent        1.49587 4.07e-13  1.33896  1.65279
    +## sigma           1.59698 5.05e-06  1.06169  2.13227
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0 9.66e+01 1.57e-25 95.3476 97.8979
    +## k1       2.55e-02 7.33e-06  0.0233  0.0278
    +## k2       3.22e-11 5.00e-01  0.0000     Inf
    +## g        8.61e-01 7.55e-06  0.8314  0.8867
    +## sigma    1.46e+00 6.93e-06  0.9661  1.9483
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  38.6 1.28e+02 3.86e+01
    +## IORE 34.0 1.77e+02 5.32e+01
    +## DFOP 34.1 1.01e+10 2.15e+10
    +## 
    +## Representative half-life:
    +## [1] 53.17
    -
    -

    -Example on page 7

    +
    +

    Example on page 7 +

    -p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p7)
    +plot(p7)

    -print(p7)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 3661.661 3195.030 3174.145 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 3334.194
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 96.41796 4.80e-53 93.32245 99.51347
    -## k_parent  0.00735 7.64e-21  0.00641  0.00843
    -## sigma     7.94557 1.83e-15  6.46713  9.42401
    -## 
    -## $IORE
    -##                Estimate Pr(>t)    Lower    Upper
    -## parent_0       9.92e+01     NA 9.55e+01 1.03e+02
    -## k__iore_parent 1.60e-05     NA 1.45e-07 1.77e-03
    -## N_parent       2.45e+00     NA 1.35e+00 3.54e+00
    -## sigma          7.42e+00     NA 6.04e+00 8.80e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower    Upper
    -## parent_0 9.89e+01 9.44e-49 95.4640 102.2573
    -## k1       1.81e-02 1.75e-01  0.0116   0.0281
    -## k2       3.63e-10 5.00e-01  0.0000      Inf
    -## g        6.06e-01 2.19e-01  0.4826   0.7178
    -## sigma    7.40e+00 2.97e-15  6.0201   8.7754
    -## 
    -## 
    -## DTx values:
    -##      DT50     DT90 DT50_rep
    -## SFO  94.3 3.13e+02 9.43e+01
    -## IORE 96.7 1.51e+03 4.55e+02
    -## DFOP 96.4 3.77e+09 1.91e+09
    -## 
    -## Representative half-life:
    -## [1] 454.55
    +print(p7)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 3661.661 3195.030 3174.145 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 3334.194
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 96.41796 4.80e-53 93.32245 99.51347
    +## k_parent  0.00735 7.64e-21  0.00641  0.00843
    +## sigma     7.94557 1.83e-15  6.46713  9.42401
    +## 
    +## $IORE
    +##                Estimate Pr(>t)    Lower    Upper
    +## parent_0       9.92e+01     NA 9.55e+01 1.03e+02
    +## k__iore_parent 1.60e-05     NA 1.45e-07 1.77e-03
    +## N_parent       2.45e+00     NA 1.35e+00 3.54e+00
    +## sigma          7.42e+00     NA 6.04e+00 8.80e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower    Upper
    +## parent_0 9.89e+01 9.44e-49 95.4640 102.2573
    +## k1       1.81e-02 1.75e-01  0.0116   0.0281
    +## k2       3.63e-10 5.00e-01  0.0000      Inf
    +## g        6.06e-01 2.19e-01  0.4826   0.7178
    +## sigma    7.40e+00 2.97e-15  6.0201   8.7754
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  94.3 3.13e+02 9.43e+01
    +## IORE 96.7 1.51e+03 4.55e+02
    +## DFOP 96.4 3.77e+09 1.91e+09
    +## 
    +## Representative half-life:
    +## [1] 454.55
    -
    -

    -Examples where the representative half-life deviates from the observed DT50

    -
    -

    -Example on page 8

    +
    +

    Examples where the representative half-life deviates from the observed DT50 +

    +
    +

    Example on page 8 +

    For this dataset, the IORE fit does not converge when the default starting values used by mkin for the IORE model are used. Therefore, a lower value for the rate constant is used here.

    -p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent = 1e-3))
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent = 1e-3))
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p8)
    +plot(p8)

    -print(p8)
    -
    ## Sums of squares:
    -##       SFO      IORE      DFOP 
    -## 1996.9408  444.9237  547.5616 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 477.4924
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 88.16549 6.53e-29 83.37344 92.95754
    -## k_parent  0.00803 1.67e-13  0.00674  0.00957
    -## sigma     7.44786 4.17e-10  5.66209  9.23363
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower    Upper
    -## parent_0       9.77e+01 7.03e-35 9.44e+01 1.01e+02
    -## k__iore_parent 6.14e-05 3.20e-02 2.12e-05 1.78e-04
    -## N_parent       2.27e+00 4.23e-18 2.00e+00 2.54e+00
    -## sigma          3.52e+00 5.36e-10 2.67e+00 4.36e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 95.70619 8.99e-32 91.87941 99.53298
    -## k1        0.02500 5.25e-04  0.01422  0.04394
    -## k2        0.00273 6.84e-03  0.00125  0.00597
    -## g         0.58835 2.84e-06  0.36595  0.77970
    -## sigma     3.90001 6.94e-10  2.96260  4.83741
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  86.3  287     86.3
    -## IORE 53.4  668    201.0
    -## DFOP 55.6  517    253.0
    -## 
    -## Representative half-life:
    -## [1] 201.03
    +print(p8)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 1996.9408  444.9237  547.5616 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 477.4924
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 88.16549 6.53e-29 83.37344 92.95754
    +## k_parent  0.00803 1.67e-13  0.00674  0.00957
    +## sigma     7.44786 4.17e-10  5.66209  9.23363
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower    Upper
    +## parent_0       9.77e+01 7.03e-35 9.44e+01 1.01e+02
    +## k__iore_parent 6.14e-05 3.20e-02 2.12e-05 1.78e-04
    +## N_parent       2.27e+00 4.23e-18 2.00e+00 2.54e+00
    +## sigma          3.52e+00 5.36e-10 2.67e+00 4.36e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 95.70619 8.99e-32 91.87941 99.53298
    +## k1        0.02500 5.25e-04  0.01422  0.04394
    +## k2        0.00273 6.84e-03  0.00125  0.00597
    +## g         0.58835 2.84e-06  0.36595  0.77970
    +## sigma     3.90001 6.94e-10  2.96260  4.83741
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  86.3  287     86.3
    +## IORE 53.4  668    201.0
    +## DFOP 55.6  517    253.0
    +## 
    +## Representative half-life:
    +## [1] 201.03
    -
    -

    -Examples where SFO was not selected for an abiotic study

    -
    -

    -Example on page 9, upper panel

    +
    +

    Examples where SFO was not selected for an abiotic study +

    +
    +

    Example on page 9, upper panel +

    -p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p9a)
    +plot(p9a)

    -print(p9a)
    -
    ## Sums of squares:
    -##       SFO      IORE      DFOP 
    -## 839.35238  88.57064   9.93363 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 105.5678
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0  88.1933 3.06e-12 79.9447 96.4419
    -## k_parent   0.0409 2.07e-07  0.0324  0.0516
    -## sigma      7.2429 3.92e-05  4.4768 10.0090
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower    Upper
    -## parent_0       9.89e+01 1.12e-16 9.54e+01 1.02e+02
    -## k__iore_parent 1.93e-05 1.13e-01 3.49e-06 1.06e-04
    -## N_parent       2.91e+00 1.45e-09 2.50e+00 3.32e+00
    -## sigma          2.35e+00 5.31e-05 1.45e+00 3.26e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)  Lower  Upper
    -## parent_0 9.85e+01 2.54e-20 97.390 99.672
    -## k1       1.38e-01 3.52e-05  0.131  0.146
    -## k2       9.02e-13 5.00e-01  0.000    Inf
    -## g        6.52e-01 8.13e-06  0.642  0.661
    -## sigma    7.88e-01 6.13e-02  0.481  1.095
    -## 
    -## 
    -## DTx values:
    -##      DT50     DT90 DT50_rep
    -## SFO  16.9 5.63e+01 1.69e+01
    -## IORE 11.6 3.37e+02 1.01e+02
    -## DFOP 10.5 1.38e+12 7.69e+11
    -## 
    -## Representative half-life:
    -## [1] 101.43
    +print(p9a)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 839.35238  88.57064   9.93363 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 105.5678
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0  88.1933 3.06e-12 79.9447 96.4419
    +## k_parent   0.0409 2.07e-07  0.0324  0.0516
    +## sigma      7.2429 3.92e-05  4.4768 10.0090
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower    Upper
    +## parent_0       9.89e+01 1.12e-16 9.54e+01 1.02e+02
    +## k__iore_parent 1.93e-05 1.13e-01 3.49e-06 1.06e-04
    +## N_parent       2.91e+00 1.45e-09 2.50e+00 3.32e+00
    +## sigma          2.35e+00 5.31e-05 1.45e+00 3.26e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)  Lower  Upper
    +## parent_0 9.85e+01 2.54e-20 97.390 99.672
    +## k1       1.38e-01 3.52e-05  0.131  0.146
    +## k2       9.02e-13 5.00e-01  0.000    Inf
    +## g        6.52e-01 8.13e-06  0.642  0.661
    +## sigma    7.88e-01 6.13e-02  0.481  1.095
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  16.9 5.63e+01 1.69e+01
    +## IORE 11.6 3.37e+02 1.01e+02
    +## DFOP 10.5 1.38e+12 7.69e+11
    +## 
    +## Representative half-life:
    +## [1] 101.43

    In this example, the residuals of the SFO indicate a lack of fit of this model, so even if it was an abiotic experiment, the data do not suggest a simple exponential decline.

    -
    -

    -Example on page 9, lower panel

    +
    +

    Example on page 9, lower panel +

    -p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
    -
    ## Warning in sqrt(diag(covar)): NaNs produced
    -
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    -
    ## Warning in sqrt(1/diag(V)): NaNs produced
    -
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    -## doubtful
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
    +
    ## Warning in sqrt(diag(covar)): NaNs produced
    +
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    +
    ## Warning in sqrt(1/diag(V)): NaNs produced
    +
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    +## doubtful
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p9b)
    +plot(p9b)

    -print(p9b)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 35.64867 23.22334 35.64867 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 28.54188
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)  Lower   Upper
    -## parent_0  94.7123 2.15e-19 93.178 96.2464
    -## k_parent   0.0389 4.47e-14  0.037  0.0408
    -## sigma      1.5957 1.28e-04  0.932  2.2595
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)   Lower  Upper
    -## parent_0         93.863 2.32e-18 92.4565 95.269
    -## k__iore_parent    0.127 1.85e-02  0.0504  0.321
    -## N_parent          0.711 1.88e-05  0.4843  0.937
    -## sigma             1.288 1.76e-04  0.7456  1.830
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0  94.7123 1.61e-16 93.1355 96.2891
    -## k1         0.0389 1.08e-04  0.0266  0.0569
    -## k2         0.0389 2.23e-04  0.0255  0.0592
    -## g          0.5256      NaN      NA      NA
    -## sigma      1.5957 2.50e-04  0.9135  2.2779
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  17.8 59.2     17.8
    -## IORE 18.4 49.2     14.8
    -## DFOP 17.8 59.2     17.8
    -## 
    -## Representative half-life:
    -## [1] 14.8
    +print(p9b) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 35.64867 23.22334 35.64867 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 28.54188
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)  Lower   Upper
    +## parent_0  94.7123 2.15e-19 93.178 96.2464
    +## k_parent   0.0389 4.47e-14  0.037  0.0408
    +## sigma      1.5957 1.28e-04  0.932  2.2595
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)   Lower  Upper
    +## parent_0         93.863 2.32e-18 92.4565 95.269
    +## k__iore_parent    0.127 1.85e-02  0.0504  0.321
    +## N_parent          0.711 1.88e-05  0.4843  0.937
    +## sigma             1.288 1.76e-04  0.7456  1.830
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0  94.7123 1.61e-16 93.1355 96.2891
    +## k1         0.0389 1.08e-04  0.0266  0.0569
    +## k2         0.0389 2.23e-04  0.0255  0.0592
    +## g          0.5256      NaN      NA      NA
    +## sigma      1.5957 2.50e-04  0.9135  2.2779
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  17.8 59.2     17.8
    +## IORE 18.4 49.2     14.8
    +## DFOP 17.8 59.2     17.8
    +## 
    +## Representative half-life:
    +## [1] 14.8

    Here, mkin gives a longer slow DT50 for the DFOP model (17.8 days) than PestDF (13.5 days). Presumably, this is related to the fact that PestDF gives a negative value for the proportion of the fast degradation which should be between 0 and 1, inclusive. This parameter is called f in PestDF and g in mkin. In mkin, it is restricted to the interval from 0 to 1.

    -
    -

    -Example on page 10

    +
    +

    Example on page 10 +

    -p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
    -
    ## Warning in sqrt(diag(covar)): NaNs produced
    -
    ## Warning in sqrt(1/diag(V)): NaNs produced
    -
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    -## doubtful
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
    +
    ## Warning in sqrt(diag(covar)): NaNs produced
    +
    ## Warning in sqrt(1/diag(V)): NaNs produced
    +
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    +## doubtful
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p10)
    +plot(p10)

    -print(p10)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 899.4089 336.4348 899.4089 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 413.4841
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)   Lower    Upper
    -## parent_0 101.7315 6.42e-11 91.9259 111.5371
    -## k_parent   0.0495 1.70e-07  0.0404   0.0607
    -## sigma      8.0152 1.28e-04  4.6813  11.3491
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)  Lower   Upper
    -## parent_0          96.86 3.32e-12 90.848 102.863
    -## k__iore_parent     2.96 7.91e-02  0.687  12.761
    -## N_parent           0.00 5.00e-01 -0.372   0.372
    -## sigma              4.90 1.77e-04  2.837   6.968
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower    Upper
    -## parent_0 101.7315 1.41e-09 91.6534 111.8097
    -## k1         0.0495 6.58e-03  0.0303   0.0809
    -## k2         0.0495 2.60e-03  0.0410   0.0598
    -## g          0.4487 5.00e-01      NA       NA
    -## sigma      8.0152 2.50e-04  4.5886  11.4418
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  14.0 46.5    14.00
    -## IORE 16.4 29.4     8.86
    -## DFOP 14.0 46.5    14.00
    -## 
    -## Representative half-life:
    -## [1] 8.86
    +print(p10) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 899.4089 336.4348 899.4089 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 413.4841
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)   Lower    Upper
    +## parent_0 101.7315 6.42e-11 91.9259 111.5371
    +## k_parent   0.0495 1.70e-07  0.0404   0.0607
    +## sigma      8.0152 1.28e-04  4.6813  11.3491
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)  Lower   Upper
    +## parent_0          96.86 3.32e-12 90.848 102.863
    +## k__iore_parent     2.96 7.91e-02  0.687  12.761
    +## N_parent           0.00 5.00e-01 -0.372   0.372
    +## sigma              4.90 1.77e-04  2.837   6.968
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower    Upper
    +## parent_0 101.7315 1.41e-09 91.6534 111.8097
    +## k1         0.0495 6.58e-03  0.0303   0.0809
    +## k2         0.0495 2.60e-03  0.0410   0.0598
    +## g          0.4487 5.00e-01      NA       NA
    +## sigma      8.0152 2.50e-04  4.5886  11.4418
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  14.0 46.5    14.00
    +## IORE 16.4 29.4     8.86
    +## DFOP 14.0 46.5    14.00
    +## 
    +## Representative half-life:
    +## [1] 8.86

    Here, a value below N is given for the IORE model, because the data suggests a faster decline towards the end of the experiment, which appears physically rather unlikely in the case of a photolysis study. It seems PestDF does not constrain N to values above zero, thus the slight difference in IORE model parameters between PestDF and mkin.

    -
    -

    -The DT50 was not observed during the study

    -
    -

    -Example on page 11

    +
    +

    The DT50 was not observed during the study +

    +
    +

    Example on page 11 +

    -p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p11)
    +plot(p11)

    -print(p11)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 579.6805 204.7932 144.7783 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 251.6944
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 96.15820 4.83e-13 90.24934 1.02e+02
    -## k_parent  0.00321 4.71e-05  0.00222 4.64e-03
    -## sigma     6.43473 1.28e-04  3.75822 9.11e+00
    -## 
    -## $IORE
    -##                Estimate Pr(>t)    Lower    Upper
    -## parent_0       1.05e+02     NA 9.90e+01 1.10e+02
    -## k__iore_parent 3.11e-17     NA 1.35e-20 7.18e-14
    -## N_parent       8.36e+00     NA 6.62e+00 1.01e+01
    -## sigma          3.82e+00     NA 2.21e+00 5.44e+00
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 1.05e+02 9.47e-13  99.9990 109.1224
    -## k1       4.41e-02 5.95e-03   0.0296   0.0658
    -## k2       9.94e-13 5.00e-01   0.0000      Inf
    -## g        3.22e-01 1.45e-03   0.2814   0.3650
    -## sigma    3.22e+00 3.52e-04   1.8410   4.5906
    -## 
    -## 
    -## DTx values:
    -##          DT50     DT90 DT50_rep
    -## SFO  2.16e+02 7.18e+02 2.16e+02
    -## IORE 9.73e+02 1.37e+08 4.11e+07
    -## DFOP 3.07e+11 1.93e+12 6.98e+11
    -## 
    -## Representative half-life:
    -## [1] 41148170
    +print(p11)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 579.6805 204.7932 144.7783 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 251.6944
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 96.15820 4.83e-13 90.24934 1.02e+02
    +## k_parent  0.00321 4.71e-05  0.00222 4.64e-03
    +## sigma     6.43473 1.28e-04  3.75822 9.11e+00
    +## 
    +## $IORE
    +##                Estimate Pr(>t)    Lower    Upper
    +## parent_0       1.05e+02     NA 9.90e+01 1.10e+02
    +## k__iore_parent 3.11e-17     NA 1.35e-20 7.18e-14
    +## N_parent       8.36e+00     NA 6.62e+00 1.01e+01
    +## sigma          3.82e+00     NA 2.21e+00 5.44e+00
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 1.05e+02 9.47e-13  99.9990 109.1224
    +## k1       4.41e-02 5.95e-03   0.0296   0.0658
    +## k2       9.94e-13 5.00e-01   0.0000      Inf
    +## g        3.22e-01 1.45e-03   0.2814   0.3650
    +## sigma    3.22e+00 3.52e-04   1.8410   4.5906
    +## 
    +## 
    +## DTx values:
    +##          DT50     DT90 DT50_rep
    +## SFO  2.16e+02 7.18e+02 2.16e+02
    +## IORE 9.73e+02 1.37e+08 4.11e+07
    +## DFOP 3.07e+11 1.93e+12 6.98e+11
    +## 
    +## Representative half-life:
    +## [1] 41148170

    In this case, the DFOP fit reported for PestDF resulted in a negative value for the slower rate constant, which is not possible in mkin. The other results are in agreement.

    -
    -

    -N is less than 1 and the DFOP rate constants are like the SFO rate constant

    +
    +

    N is less than 1 and the DFOP rate constants are like the SFO rate constant +

    In the following three examples, the same results are obtained with mkin as reported for PestDF. As in the case on page 10, the N values below 1 are deemed unrealistic and appear to be the result of an overparameterisation.

    -
    -

    -Example on page 12, upper panel

    +
    +

    Example on page 12, upper panel +

    -p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
    -
    ## Warning in summary.mkinfit(x): Could not calculate correlation; no covariance
    -## matrix
    -
    ## Warning in sqrt(diag(covar)): NaNs produced
    -
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    -
    ## Warning in sqrt(1/diag(V)): NaNs produced
    -
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    -## doubtful
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
    +
    ## Warning in summary.mkinfit(x): Could not calculate correlation; no covariance
    +## matrix
    +
    ## Warning in sqrt(diag(covar)): NaNs produced
    +
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    +
    ## Warning in sqrt(1/diag(V)): NaNs produced
    +
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    +## doubtful
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p12a)
    +plot(p12a)

    -print(p12a)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 695.4440 220.0685 695.4440 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 270.4679
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)  Lower   Upper
    -## parent_0  100.521 8.75e-12 92.461 108.581
    -## k_parent    0.124 3.61e-08  0.104   0.148
    -## sigma       7.048 1.28e-04  4.116   9.980
    -## 
    -## $IORE
    -##                Estimate Pr(>t) Lower Upper
    -## parent_0         96.823     NA    NA    NA
    -## k__iore_parent    2.436     NA    NA    NA
    -## N_parent          0.263     NA    NA    NA
    -## sigma             3.965     NA    NA    NA
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower   Upper
    -## parent_0  100.521 2.74e-10 92.2366 108.805
    -## k1          0.124 2.53e-05  0.0908   0.170
    -## k2          0.124 2.52e-02  0.0456   0.339
    -## g           0.793      NaN      NA      NA
    -## sigma       7.048 2.50e-04  4.0349  10.061
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  5.58 18.5     5.58
    -## IORE 6.49 13.2     3.99
    -## DFOP 5.58 18.5     5.58
    -## 
    -## Representative half-life:
    -## [1] 3.99
    +print(p12a)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 695.4440 220.0685 695.4440 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 270.4679
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)  Lower   Upper
    +## parent_0  100.521 8.75e-12 92.461 108.581
    +## k_parent    0.124 3.61e-08  0.104   0.148
    +## sigma       7.048 1.28e-04  4.116   9.980
    +## 
    +## $IORE
    +##                Estimate Pr(>t) Lower Upper
    +## parent_0         96.823     NA    NA    NA
    +## k__iore_parent    2.436     NA    NA    NA
    +## N_parent          0.263     NA    NA    NA
    +## sigma             3.965     NA    NA    NA
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower   Upper
    +## parent_0  100.521 2.74e-10 92.2366 108.805
    +## k1          0.124 2.53e-05  0.0908   0.170
    +## k2          0.124 2.52e-02  0.0456   0.339
    +## g           0.793      NaN      NA      NA
    +## sigma       7.048 2.50e-04  4.0349  10.061
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  5.58 18.5     5.58
    +## IORE 6.49 13.2     3.99
    +## DFOP 5.58 18.5     5.58
    +## 
    +## Representative half-life:
    +## [1] 3.99
    -
    -

    -Example on page 12, lower panel

    +
    +

    Example on page 12, lower panel +

    -p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
    -
    ## Warning in qt(alpha/2, rdf): NaNs produced
    -
    ## Warning in qt(1 - alpha/2, rdf): NaNs produced
    -
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    -
    ## Warning in pt(abs(tval), rdf, lower.tail = FALSE): NaNs produced
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
    +
    ## Warning in qt(alpha/2, rdf): NaNs produced
    +
    ## Warning in qt(1 - alpha/2, rdf): NaNs produced
    +
    ## Warning in sqrt(diag(covar_notrans)): NaNs produced
    +
    ## Warning in pt(abs(tval), rdf, lower.tail = FALSE): NaNs produced
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p12b)
    +plot(p12b)

    -print(p12b)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 58.90242 19.06353 58.90242 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 51.51756
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate  Pr(>t)   Lower    Upper
    -## parent_0  97.6840 0.00039 85.9388 109.4292
    -## k_parent   0.0589 0.00261  0.0431   0.0805
    -## sigma      3.4323 0.04356 -1.2377   8.1023
    -## 
    -## $IORE
    -##                Estimate Pr(>t)     Lower  Upper
    -## parent_0         95.523 0.0055 74.539157 116.51
    -## k__iore_parent    0.333 0.1433  0.000717 154.57
    -## N_parent          0.568 0.0677 -0.989464   2.13
    -## sigma             1.953 0.0975 -5.893100   9.80
    -## 
    -## $DFOP
    -##          Estimate Pr(>t) Lower Upper
    -## parent_0  97.6840    NaN   NaN   NaN
    -## k1         0.0589    NaN    NA    NA
    -## k2         0.0589    NaN    NA    NA
    -## g          0.6473    NaN    NA    NA
    -## sigma      3.4323    NaN   NaN   NaN
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  11.8 39.1    11.80
    -## IORE 12.9 31.4     9.46
    -## DFOP 11.8 39.1    11.80
    -## 
    -## Representative half-life:
    -## [1] 9.46
    +print(p12b) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 58.90242 19.06353 58.90242 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 51.51756
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate  Pr(>t)   Lower    Upper
    +## parent_0  97.6840 0.00039 85.9388 109.4292
    +## k_parent   0.0589 0.00261  0.0431   0.0805
    +## sigma      3.4323 0.04356 -1.2377   8.1023
    +## 
    +## $IORE
    +##                Estimate Pr(>t)     Lower  Upper
    +## parent_0         95.523 0.0055 74.539157 116.51
    +## k__iore_parent    0.333 0.1433  0.000717 154.57
    +## N_parent          0.568 0.0677 -0.989464   2.13
    +## sigma             1.953 0.0975 -5.893100   9.80
    +## 
    +## $DFOP
    +##          Estimate Pr(>t) Lower Upper
    +## parent_0  97.6840    NaN   NaN   NaN
    +## k1         0.0589    NaN    NA    NA
    +## k2         0.0589    NaN    NA    NA
    +## g          0.6473    NaN    NA    NA
    +## sigma      3.4323    NaN   NaN   NaN
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  11.8 39.1    11.80
    +## IORE 12.9 31.4     9.46
    +## DFOP 11.8 39.1    11.80
    +## 
    +## Representative half-life:
    +## [1] 9.46
    -
    -

    -Example on page 13

    +
    +

    Example on page 13 +

    -p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p13)
    +plot(p13)

    -print(p13)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 174.5971 142.3951 174.5971 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 172.131
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 92.73500 5.99e-17 89.61936 95.85065
    -## k_parent  0.00258 2.42e-09  0.00223  0.00299
    -## sigma     3.41172 7.07e-05  2.05455  4.76888
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower  Upper
    -## parent_0        91.6016 6.34e-16 88.53086 94.672
    -## k__iore_parent   0.0396 2.36e-01  0.00207  0.759
    -## N_parent         0.3541 1.46e-01 -0.35153  1.060
    -## sigma            3.0811 9.64e-05  1.84296  4.319
    -## 
    -## $DFOP
    -##          Estimate Pr(>t)    Lower    Upper
    -## parent_0 92.73500     NA 8.95e+01 95.92118
    -## k1        0.00258     NA 4.14e-04  0.01611
    -## k2        0.00258     NA 1.74e-03  0.00383
    -## g         0.16452     NA 0.00e+00  1.00000
    -## sigma     3.41172     NA 2.02e+00  4.79960
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO   269  892      269
    -## IORE  261  560      169
    -## DFOP  269  892      269
    -## 
    -## Representative half-life:
    -## [1] 168.51
    +print(p13) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 174.5971 142.3951 174.5971 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 172.131
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 92.73500 5.99e-17 89.61936 95.85065
    +## k_parent  0.00258 2.42e-09  0.00223  0.00299
    +## sigma     3.41172 7.07e-05  2.05455  4.76888
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower  Upper
    +## parent_0        91.6016 6.34e-16 88.53086 94.672
    +## k__iore_parent   0.0396 2.36e-01  0.00207  0.759
    +## N_parent         0.3541 1.46e-01 -0.35153  1.060
    +## sigma            3.0811 9.64e-05  1.84296  4.319
    +## 
    +## $DFOP
    +##          Estimate Pr(>t)    Lower    Upper
    +## parent_0 92.73500     NA 8.95e+01 95.92118
    +## k1        0.00258     NA 4.14e-04  0.01611
    +## k2        0.00258     NA 1.74e-03  0.00383
    +## g         0.16452     NA 0.00e+00  1.00000
    +## sigma     3.41172     NA 2.02e+00  4.79960
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO   269  892      269
    +## IORE  261  560      169
    +## DFOP  269  892      269
    +## 
    +## Representative half-life:
    +## [1] 168.51
    -
    -

    -DT50 not observed in the study and DFOP problems in PestDF

    +
    +

    DT50 not observed in the study and DFOP problems in PestDF +

    -p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
    -
    ## Warning in sqrt(diag(covar)): NaNs produced
    -
    ## Warning in sqrt(1/diag(V)): NaNs produced
    -
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    -## doubtful
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
    +
    ## Warning in sqrt(diag(covar)): NaNs produced
    +
    ## Warning in sqrt(1/diag(V)): NaNs produced
    +
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    +## doubtful
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p14)
    +plot(p14)

    -print(p14)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 48.43249 28.67746 27.26248 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 32.83337
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 99.47124 2.06e-30 98.42254 1.01e+02
    -## k_parent  0.00279 3.75e-15  0.00256 3.04e-03
    -## sigma     1.55616 3.81e-06  1.03704 2.08e+00
    -## 
    -## $IORE
    -##                Estimate Pr(>t) Lower Upper
    -## parent_0       1.00e+02     NA   NaN   NaN
    -## k__iore_parent 9.44e-08     NA   NaN   NaN
    -## N_parent       3.31e+00     NA   NaN   NaN
    -## sigma          1.20e+00     NA 0.796   1.6
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 1.00e+02 2.96e-28 99.40280 101.2768
    -## k1       9.53e-03 1.20e-01  0.00638   0.0143
    -## k2       6.08e-12 5.00e-01  0.00000      Inf
    -## g        3.98e-01 2.19e-01  0.30481   0.4998
    -## sigma    1.17e+00 7.68e-06  0.77406   1.5610
    -## 
    -## 
    -## DTx values:
    -##          DT50     DT90 DT50_rep
    -## SFO  2.48e+02 8.25e+02 2.48e+02
    -## IORE 4.34e+02 2.22e+04 6.70e+03
    -## DFOP 3.05e+10 2.95e+11 1.14e+11
    -## 
    -## Representative half-life:
    -## [1] 6697.44
    +print(p14) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 48.43249 28.67746 27.26248 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 32.83337
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 99.47124 2.06e-30 98.42254 1.01e+02
    +## k_parent  0.00279 3.75e-15  0.00256 3.04e-03
    +## sigma     1.55616 3.81e-06  1.03704 2.08e+00
    +## 
    +## $IORE
    +##                Estimate Pr(>t) Lower Upper
    +## parent_0       1.00e+02     NA   NaN   NaN
    +## k__iore_parent 9.44e-08     NA   NaN   NaN
    +## N_parent       3.31e+00     NA   NaN   NaN
    +## sigma          1.20e+00     NA 0.796   1.6
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 1.00e+02 2.96e-28 99.40280 101.2768
    +## k1       9.53e-03 1.20e-01  0.00638   0.0143
    +## k2       6.08e-12 5.00e-01  0.00000      Inf
    +## g        3.98e-01 2.19e-01  0.30481   0.4998
    +## sigma    1.17e+00 7.68e-06  0.77406   1.5610
    +## 
    +## 
    +## DTx values:
    +##          DT50     DT90 DT50_rep
    +## SFO  2.48e+02 8.25e+02 2.48e+02
    +## IORE 4.34e+02 2.22e+04 6.70e+03
    +## DFOP 3.05e+10 2.95e+11 1.14e+11
    +## 
    +## Representative half-life:
    +## [1] 6697.44

    The slower rate constant reported by PestDF is negative, which is not physically realistic, and not possible in mkin. The other fits give the same results in mkin and PestDF.

    -
    -

    -N is less than 1 and DFOP fraction parameter is below zero

    +
    +

    N is less than 1 and DFOP fraction parameter is below zero +

    -p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p15a)
    +plot(p15a)

    -print(p15a)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 245.5248 135.0132 245.5248 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 165.9335
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower   Upper
    -## parent_0 97.96751 2.00e-15 94.32049 101.615
    -## k_parent  0.00952 4.93e-09  0.00824   0.011
    -## sigma     4.18778 1.28e-04  2.44588   5.930
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)  Lower  Upper
    -## parent_0         95.874 2.94e-15 92.937 98.811
    -## k__iore_parent    0.629 2.11e-01  0.044  8.982
    -## N_parent          0.000 5.00e-01 -0.642  0.642
    -## sigma             3.105 1.78e-04  1.795  4.416
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 97.96751 2.85e-13 94.21913 101.7159
    -## k1        0.00952 6.28e-02  0.00250   0.0363
    -## k2        0.00952 1.27e-04  0.00646   0.0140
    -## g         0.21241 5.00e-01  0.00000   1.0000
    -## sigma     4.18778 2.50e-04  2.39747   5.9781
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  72.8  242     72.8
    -## IORE 76.3  137     41.3
    -## DFOP 72.8  242     72.8
    -## 
    -## Representative half-life:
    -## [1] 41.33
    +print(p15a) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 245.5248 135.0132 245.5248 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 165.9335
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower   Upper
    +## parent_0 97.96751 2.00e-15 94.32049 101.615
    +## k_parent  0.00952 4.93e-09  0.00824   0.011
    +## sigma     4.18778 1.28e-04  2.44588   5.930
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)  Lower  Upper
    +## parent_0         95.874 2.94e-15 92.937 98.811
    +## k__iore_parent    0.629 2.11e-01  0.044  8.982
    +## N_parent          0.000 5.00e-01 -0.642  0.642
    +## sigma             3.105 1.78e-04  1.795  4.416
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 97.96751 2.85e-13 94.21913 101.7159
    +## k1        0.00952 6.28e-02  0.00250   0.0363
    +## k2        0.00952 1.27e-04  0.00646   0.0140
    +## g         0.21241 5.00e-01  0.00000   1.0000
    +## sigma     4.18778 2.50e-04  2.39747   5.9781
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  72.8  242     72.8
    +## IORE 76.3  137     41.3
    +## DFOP 72.8  242     72.8
    +## 
    +## Representative half-life:
    +## [1] 41.33
    -p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
    -
    ## Warning in sqrt(diag(covar)): NaNs produced
    -
    ## Warning in sqrt(1/diag(V)): NaNs produced
    -
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    -## doubtful
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The half-life obtained from the IORE model may be used
    +p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]]) +
    ## Warning in sqrt(diag(covar)): NaNs produced
    +
    ## Warning in sqrt(1/diag(V)): NaNs produced
    +
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
    +## doubtful
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    -plot(p15b)
    +plot(p15b)

    -print(p15b)
    -
    ## Sums of squares:
    -##       SFO      IORE      DFOP 
    -## 106.91629  68.55574 106.91629 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 84.25618
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)    Lower    Upper
    -## parent_0 1.01e+02 3.06e-17 98.31594 1.03e+02
    -## k_parent 4.86e-03 2.48e-10  0.00435 5.42e-03
    -## sigma    2.76e+00 1.28e-04  1.61402 3.91e+00
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower  Upper
    -## parent_0          99.83 1.81e-16 97.51349 102.14
    -## k__iore_parent     0.38 3.22e-01  0.00352  41.05
    -## N_parent           0.00 5.00e-01 -1.07696   1.08
    -## sigma              2.21 2.57e-04  1.23245   3.19
    -## 
    -## $DFOP
    -##          Estimate Pr(>t)    Lower    Upper
    -## parent_0 1.01e+02     NA 9.82e+01 1.04e+02
    -## k1       4.86e-03     NA 8.63e-04 2.73e-02
    -## k2       4.86e-03     NA 3.21e-03 7.35e-03
    -## g        1.88e-01     NA       NA       NA
    -## sigma    2.76e+00     NA 1.58e+00 3.94e+00
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO   143  474    143.0
    -## IORE  131  236     71.2
    -## DFOP  143  474    143.0
    -## 
    -## Representative half-life:
    -## [1] 71.18
    +print(p15b) +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 106.91629  68.55574 106.91629 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 84.25618
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)    Lower    Upper
    +## parent_0 1.01e+02 3.06e-17 98.31594 1.03e+02
    +## k_parent 4.86e-03 2.48e-10  0.00435 5.42e-03
    +## sigma    2.76e+00 1.28e-04  1.61402 3.91e+00
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower  Upper
    +## parent_0          99.83 1.81e-16 97.51349 102.14
    +## k__iore_parent     0.38 3.22e-01  0.00352  41.05
    +## N_parent           0.00 5.00e-01 -1.07696   1.08
    +## sigma              2.21 2.57e-04  1.23245   3.19
    +## 
    +## $DFOP
    +##          Estimate Pr(>t)    Lower    Upper
    +## parent_0 1.01e+02     NA 9.82e+01 1.04e+02
    +## k1       4.86e-03     NA 8.63e-04 2.73e-02
    +## k2       4.86e-03     NA 3.21e-03 7.35e-03
    +## g        1.88e-01     NA       NA       NA
    +## sigma    2.76e+00     NA 1.58e+00 3.94e+00
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO   143  474    143.0
    +## IORE  131  236     71.2
    +## DFOP  143  474    143.0
    +## 
    +## Representative half-life:
    +## [1] 71.18

    In mkin, only the IORE fit is affected (deemed unrealistic), as the fraction parameter of the DFOP model is restricted to the interval between 0 and 1 in mkin. The SFO fits give the same results for both mkin and PestDF.

    -
    -

    -The DFOP fraction parameter is greater than 1

    +
    +

    The DFOP fraction parameter is greater than 1 +

    -p16 <- nafta(NAFTA_SOP_Attachment[["p16"]])
    -
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    -
    ## The representative half-life of the IORE model is longer than the one corresponding
    -
    ## to the terminal degradation rate found with the DFOP model.
    -
    ## The representative half-life obtained from the DFOP model may be used
    +p16 <- nafta(NAFTA_SOP_Attachment[["p16"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The representative half-life of the IORE model is longer than the one corresponding
    +
    ## to the terminal degradation rate found with the DFOP model.
    +
    ## The representative half-life obtained from the DFOP model may be used
    -plot(p16)
    +plot(p16)

    -print(p16)
    -
    ## Sums of squares:
    -##      SFO     IORE     DFOP 
    -## 3831.804 2062.008 1550.980 
    -## 
    -## Critical sum of squares for checking the SFO model:
    -## [1] 2247.348
    -## 
    -## Parameters:
    -## $SFO
    -##          Estimate   Pr(>t)  Lower Upper
    -## parent_0   71.953 2.33e-13 60.509 83.40
    -## k_parent    0.159 4.86e-05  0.102  0.25
    -## sigma      11.302 1.25e-08  8.308 14.30
    -## 
    -## $IORE
    -##                Estimate   Pr(>t)    Lower    Upper
    -## parent_0       8.74e+01 2.48e-16 7.72e+01 97.52972
    -## k__iore_parent 4.55e-04 2.16e-01 3.48e-05  0.00595
    -## N_parent       2.70e+00 1.21e-08 1.99e+00  3.40046
    -## sigma          8.29e+00 1.61e-08 6.09e+00 10.49062
    -## 
    -## $DFOP
    -##          Estimate   Pr(>t)   Lower  Upper
    -## parent_0  88.5333 7.40e-18 79.9836 97.083
    -## k1        18.8461 5.00e-01  0.0000    Inf
    -## k2         0.0776 1.41e-05  0.0518  0.116
    -## g          0.4733 1.41e-09  0.3674  0.582
    -## sigma      7.1902 2.11e-08  5.2785  9.102
    -## 
    -## 
    -## DTx values:
    -##      DT50 DT90 DT50_rep
    -## SFO  4.35 14.4     4.35
    -## IORE 1.48 32.1     9.67
    -## DFOP 0.67 21.4     8.93
    -## 
    -## Representative half-life:
    -## [1] 8.93
    +print(p16) +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 3831.804 2062.008 1550.980 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 2247.348
    +## 
    +## Parameters:
    +## $SFO
    +##          Estimate   Pr(>t)  Lower Upper
    +## parent_0   71.953 2.33e-13 60.509 83.40
    +## k_parent    0.159 4.86e-05  0.102  0.25
    +## sigma      11.302 1.25e-08  8.308 14.30
    +## 
    +## $IORE
    +##                Estimate   Pr(>t)    Lower    Upper
    +## parent_0       8.74e+01 2.48e-16 7.72e+01 97.52972
    +## k__iore_parent 4.55e-04 2.16e-01 3.48e-05  0.00595
    +## N_parent       2.70e+00 1.21e-08 1.99e+00  3.40046
    +## sigma          8.29e+00 1.61e-08 6.09e+00 10.49062
    +## 
    +## $DFOP
    +##          Estimate   Pr(>t)   Lower  Upper
    +## parent_0  88.5333 7.40e-18 79.9836 97.083
    +## k1        18.8461 5.00e-01  0.0000    Inf
    +## k2         0.0776 1.41e-05  0.0518  0.116
    +## g          0.4733 1.41e-09  0.3674  0.582
    +## sigma      7.1902 2.11e-08  5.2785  9.102
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  4.35 14.4     4.35
    +## IORE 1.48 32.1     9.67
    +## DFOP 0.67 21.4     8.93
    +## 
    +## Representative half-life:
    +## [1] 8.93

    In PestDF, the DFOP fit seems to have stuck in a local minimum, as mkin finds a solution with a much lower \(\chi^2\) error level. As the half-life from the slower rate constant of the DFOP model is larger than the IORE derived half-life, the NAFTA recommendation obtained with mkin is to use the DFOP representative half-life of 8.9 days.

    -
    -

    -Conclusions

    +
    +

    Conclusions +

    The results obtained with mkin deviate from the results obtained with PestDF either in cases where one of the interpretive rules would apply, i.e. the IORE parameter N is less than one or the DFOP k values obtained with PestDF are equal to the SFO k values, or in cases where the DFOP model did not converge, which often lead to negative rate constants returned by PestDF.

    Therefore, mkin appears to suitable for kinetic evaluations according to the NAFTA guidance.

    -
    -

    -References

    +
    +

    References +

    US EPA. 2015. “Standard Operating Procedure for Using the NAFTA Guidance to Calculate Representative Half-Life Values and Characterizing Pesticide Degradation.”

    @@ -1016,11 +1027,13 @@
    -

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

    @@ -1029,5 +1042,7 @@ + + diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png index f5420ce8..75611a70 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png index 0ae4bd9f..55466e47 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png index 57a48119..d3143afa 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png index c42d45f0..3387ca69 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png index 52dea51e..62a135f2 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png index ca1f29be..ae4d83a4 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png index f69e6d3b..b6faeff9 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png index 71fcd257..6b9ba98c 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png index 820501a3..72df855b 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png index e264d2ea..391dfb95 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png index e5b656a4..db90244b 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png index c9664c77..a33372e8 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png index a81f814c..d64ea98d 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png index 75d72e7c..5cd6c806 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png index 3ce13a97..61359ea6 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png differ diff --git a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png index e2cf2f83..85790b1e 100644 Binary files a/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png and b/docs/dev/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png differ diff --git a/docs/dev/articles/web_only/benchmarks.html b/docs/dev/articles/web_only/benchmarks.html index 5c7aa3dc..b37ac926 100644 --- a/docs/dev/articles/web_only/benchmarks.html +++ b/docs/dev/articles/web_only/benchmarks.html @@ -34,7 +34,7 @@ mkin - 1.2.0 + 1.2.2
    @@ -112,7 +112,7 @@

    Benchmark timings for mkin

    Johannes Ranke

    -

    Last change 14 July 2022 (rebuilt 2022-11-15)

    +

    Last change 14 July 2022 (rebuilt 2022-11-24)

    Source: vignettes/web_only/benchmarks.rmd @@ -351,8 +351,16 @@ Ryzen 7 1700 4.2.2 1.2.0 -2.129 -3.784 +2.140 +3.774 + + +Linux +Ryzen 7 1700 +4.2.2 +1.2.2 +2.187 +3.851 @@ -530,9 +538,18 @@ Ryzen 7 1700 4.2.2 1.2.0 -1.559 -6.097 -2.841 +1.554 +6.193 +2.843 + + +Linux +Ryzen 7 1700 +4.2.2 +1.2.2 +1.585 +6.335 +3.003 @@ -764,12 +781,24 @@ Ryzen 7 1700 4.2.2 1.2.0 -0.911 -1.328 -1.519 -2.986 -1.957 -2.769 +0.913 +1.345 +1.539 +3.011 +1.987 +2.802 + + +Linux +Ryzen 7 1700 +4.2.2 +1.2.2 +0.935 +1.381 +1.551 +3.209 +1.976 +3.013 diff --git a/docs/dev/articles/web_only/compiled_models.html b/docs/dev/articles/web_only/compiled_models.html index ade86bc5..e9d80420 100644 --- a/docs/dev/articles/web_only/compiled_models.html +++ b/docs/dev/articles/web_only/compiled_models.html @@ -34,7 +34,7 @@ mkin - 1.2.0 + 1.2.2
    @@ -78,7 +78,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -109,7 +112,7 @@

    Performance benefit by using compiled model definitions in mkin

    Johannes Ranke

    -

    2022-11-01

    +

    2022-11-24

    Source: vignettes/web_only/compiled_models.rmd @@ -167,10 +170,10 @@ print("R package rbenchmark is not available") }
    ##                    test replications relative elapsed
    -## 4            analytical            1    1.000   0.186
    -## 3     deSolve, compiled            1    1.656   0.308
    -## 2      Eigenvalue based            1    2.102   0.391
    -## 1 deSolve, not compiled            1   38.968   7.248
    +## 4 analytical 1 1.000 0.221 +## 3 deSolve, compiled 1 1.561 0.345 +## 2 Eigenvalue based 1 1.932 0.427 +## 1 deSolve, not compiled 1 33.629 7.432

    We see that using the compiled model is by more than a factor of 10 faster than using deSolve without compiled code.

    @@ -197,10 +200,10 @@ }
    ## Temporary DLL for differentials generated and loaded
    ##                    test replications relative elapsed
    -## 2     deSolve, compiled            1    1.000   0.452
    -## 1 deSolve, not compiled            1   29.431  13.303
    -

    Here we get a performance benefit of a factor of 29 using the version of the differential equation model compiled from C code!

    -

    This vignette was built with mkin 1.2.0 on

    +## 2 deSolve, compiled 1 1.000 0.482 +## 1 deSolve, not compiled 1 27.865 13.431 +

    Here we get a performance benefit of a factor of 28 using the version of the differential equation model compiled from C code!

    +

    This vignette was built with mkin 1.2.2 on

    ## R version 4.2.2 (2022-10-31)
     ## Platform: x86_64-pc-linux-gnu (64-bit)
     ## Running under: Debian GNU/Linux 11 (bullseye)
    diff --git a/docs/dev/articles/web_only/dimethenamid_2018.html b/docs/dev/articles/web_only/dimethenamid_2018.html index 60f1ab5a..ec7f54d8 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018.html +++ b/docs/dev/articles/web_only/dimethenamid_2018.html @@ -34,7 +34,7 @@ mkin - 1.1.2 + 1.2.2
    @@ -63,11 +63,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -75,7 +78,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -106,7 +112,7 @@

    Example evaluations of the dimethenamid data from 2018

    Johannes Ranke

    -

    Last change 1 July 2022, built on 16 Sep 2022

    +

    Last change 1 July 2022, built on 24 Nov 2022

    Source: vignettes/web_only/dimethenamid_2018.rmd @@ -366,7 +372,7 @@ DFOP tc more iterations 665.88 663.80
    ) print(AIC_parent_saemix_methods_defaults)
        is     gq    lin 
    -668.27 718.36 666.49 
    +669.77 669.36 670.95
    @@ -437,7 +443,7 @@ DFOP tc more iterations 665.88 663.80 -
    R version 4.2.1 (2022-06-23)
    +
    R version 4.2.2 (2022-10-31)
     Platform: x86_64-pc-linux-gnu (64-bit)
     Running under: Debian GNU/Linux 11 (bullseye)
     
    @@ -457,24 +463,24 @@ attached base packages:
     [1] stats     graphics  grDevices utils     datasets  methods   base     
     
     other attached packages:
    -[1] nlme_3.1-158 mkin_1.1.2   knitr_1.39  
    +[1] saemix_3.2   npde_3.2     nlme_3.1-160 mkin_1.2.2   knitr_1.41  
     
     loaded via a namespace (and not attached):
    - [1] deSolve_1.33       zoo_1.8-10         tidyselect_1.1.2   xfun_0.31         
    - [5] bslib_0.4.0        purrr_0.3.4        lattice_0.20-45    colorspace_2.0-3  
    - [9] vctrs_0.4.1        generics_0.1.3     htmltools_0.5.3    yaml_2.3.5        
    -[13] utf8_1.2.2         rlang_1.0.4        pkgdown_2.0.6      saemix_3.1        
    -[17] jquerylib_0.1.4    pillar_1.8.0       glue_1.6.2         DBI_1.1.3         
    -[21] lifecycle_1.0.1    stringr_1.4.0      munsell_0.5.0      gtable_0.3.0      
    -[25] ragg_1.2.2         memoise_2.0.1      evaluate_0.15      npde_3.2          
    -[29] fastmap_1.1.0      lmtest_0.9-40      parallel_4.2.1     fansi_1.0.3       
    -[33] highr_0.9          KernSmooth_2.23-20 scales_1.2.0       cachem_1.0.6      
    -[37] desc_1.4.1         jsonlite_1.8.0     systemfonts_1.0.4  fs_1.5.2          
    -[41] textshaping_0.3.6  gridExtra_2.3      ggplot2_3.3.6      digest_0.6.29     
    -[45] stringi_1.7.8      dplyr_1.0.9        grid_4.2.1         rprojroot_2.0.3   
    -[49] cli_3.3.0          tools_4.2.1        magrittr_2.0.3     sass_0.4.2        
    -[53] tibble_3.1.8       pkgconfig_2.0.3    assertthat_0.2.1   rmarkdown_2.14.3  
    -[57] mclust_5.4.10      R6_2.5.1           compiler_4.2.1    
    + [1] deSolve_1.34 zoo_1.8-11 tidyselect_1.2.0 xfun_0.35 + [5] bslib_0.4.1 purrr_0.3.5 lattice_0.20-45 colorspace_2.0-3 + [9] vctrs_0.5.1 generics_0.1.3 htmltools_0.5.3 yaml_2.3.6 +[13] utf8_1.2.2 rlang_1.0.6 pkgdown_2.0.6 jquerylib_0.1.4 +[17] pillar_1.8.1 glue_1.6.2 DBI_1.1.3 lifecycle_1.0.3 +[21] stringr_1.4.1 munsell_0.5.0 gtable_0.3.1 ragg_1.2.4 +[25] codetools_0.2-18 memoise_2.0.1 evaluate_0.18 fastmap_1.1.0 +[29] lmtest_0.9-40 parallel_4.2.2 fansi_1.0.3 highr_0.9 +[33] scales_1.2.1 cachem_1.0.6 desc_1.4.2 jsonlite_1.8.3 +[37] systemfonts_1.0.4 fs_1.5.2 textshaping_0.3.6 gridExtra_2.3 +[41] ggplot2_3.4.0 digest_0.6.30 stringi_1.7.8 dplyr_1.0.10 +[45] grid_4.2.2 rprojroot_2.0.3 cli_3.4.1 tools_4.2.2 +[49] magrittr_2.0.3 sass_0.4.3 tibble_3.1.8 pkgconfig_2.0.3 +[53] assertthat_0.2.1 rmarkdown_2.18 R6_2.5.1 mclust_6.0.0 +[57] compiler_4.2.2

    References diff --git a/docs/dev/articles/web_only/multistart.html b/docs/dev/articles/web_only/multistart.html index 50a57d1b..fd05f340 100644 --- a/docs/dev/articles/web_only/multistart.html +++ b/docs/dev/articles/web_only/multistart.html @@ -34,7 +34,7 @@ mkin - 1.2.0 + 1.2.2

    @@ -78,7 +78,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -109,7 +112,7 @@

    Short demo of the multistart method

    Johannes Ranke

    -

    Last change 26 September 2022 (rebuilt 2022-11-01)

    +

    Last change 26 September 2022 (rebuilt 2022-11-24)

    Source: vignettes/web_only/multistart.rmd @@ -163,8 +166,8 @@
    ## Data: 155 observations of 1 variable(s) grouped in 6 datasets
     ## 
     ##                            npar    AIC    BIC     Lik Chisq Df Pr(>Chisq)
    -## best(f_saem_reduced_multi)    9 663.64 661.77 -322.82                    
    -## f_saem_full                  10 668.27 666.19 -324.13     0  1          1
    +## best(f_saem_reduced_multi) 9 663.69 661.82 -322.85 +## f_saem_full 10 669.77 667.69 -324.89 0 1 1

    While AIC and BIC are lower for the reduced model, the likelihood ratio test does not indicate a significant difference between the fits.

    diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png index 79543765..13bdb94b 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png index 4466d437..56147ae2 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png index 3dd36f91..f0b89dba 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png index 3963e993..c57c247f 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/dev/articles/web_only/saem_benchmarks.html b/docs/dev/articles/web_only/saem_benchmarks.html index afff038f..66f4b075 100644 --- a/docs/dev/articles/web_only/saem_benchmarks.html +++ b/docs/dev/articles/web_only/saem_benchmarks.html @@ -34,7 +34,7 @@ mkin - 1.2.0 + 1.2.2 @@ -112,7 +112,7 @@

    Benchmark timings for saem.mmkin

    Johannes Ranke

    -

    Last change 14 November 2022 (rebuilt 2022-11-16)

    +

    Last change 14 November 2022 (rebuilt 2022-11-24)

    Source: vignettes/web_only/saem_benchmarks.rmd @@ -304,16 +304,28 @@ t3 t4 - + + Ryzen 7 1700 Linux 1.2.0 3.2 -2.156 -4.647 -4.296 -4.951 - +2.140 +4.626 +4.328 +4.998 + + +Ryzen 7 1700 +Linux +1.2.2 +3.2 +2.427 +4.550 +4.217 +4.851 + +

    Two-component error fits for SFO, DFOP, SFORB and HS.

    @@ -327,16 +339,28 @@ - + + - - - - - + + + + + + + + + + + + + + + +
    t7 t8
    Ryzen 7 1700 Linux 1.2.0 3.25.6457.4157.8487.967
    5.6787.4418.0007.980
    Ryzen 7 1700Linux1.2.23.25.3527.2018.1748.401
    @@ -352,14 +376,24 @@ t9 t10 - + + Ryzen 7 1700 Linux 1.2.0 3.2 -24.182 -783.932 - +24.465 +800.266 + + +Ryzen 7 1700 +Linux +1.2.2 +3.2 +25.193 +798.580 + +
    @@ -374,13 +408,22 @@ saemix t11 - + + Ryzen 7 1700 Linux 1.2.0 3.2 -1322.5 - +1289.198 + + +Ryzen 7 1700 +Linux +1.2.2 +3.2 +1312.445 + +
    diff --git a/docs/dev/authors.html b/docs/dev/authors.html index 2f95f092..bd58bc3d 100644 --- a/docs/dev/authors.html +++ b/docs/dev/authors.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2 @@ -115,13 +115,13 @@

    Ranke J (2022). mkin: Kinetic Evaluation of Chemical Degradation Data. -R package version 1.2.0, https://pkgdown.jrwb.de/mkin/. +R package version 1.2.2, https://pkgdown.jrwb.de/mkin/.

    @Manual{,
       title = {mkin: Kinetic Evaluation of Chemical Degradation Data},
       author = {Johannes Ranke},
       year = {2022},
    -  note = {R package version 1.2.0},
    +  note = {R package version 1.2.2},
       url = {https://pkgdown.jrwb.de/mkin/},
     }
    diff --git a/docs/dev/index.html b/docs/dev/index.html index 4709fe29..2615d389 100644 --- a/docs/dev/index.html +++ b/docs/dev/index.html @@ -45,7 +45,7 @@ mkin - 1.2.0 + 1.2.2 @@ -153,9 +153,9 @@

    General

      -
    • 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.
    • -
    • 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).
    • -
    • The usual one-sided t-test for significant difference from zero is nevertheless shown based on estimators for the untransformed parameters.
    • +
    • Highly flexible model specification using mkinmod, including equilibrium reactions and using the single first-order reversible binding (SFORB) model, which will automatically create two state variables for the observed variable.
    • +
    • Model solution (forward modelling) in the function mkinpredict is performed either using the analytical solution for the case of parent only degradation or some simple models involving a single transformation product, , 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).
    • +
    • The usual one-sided t-test for significant difference from zero is 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.
    • The ‘variance by variable’ error model which is often fitted using Iteratively Reweighted Least Squares (IRLS) can be specified as error_model = "obs".
    • @@ -169,8 +169,8 @@
    • Model comparisons using the Akaike Information Criterion (AIC) are supported which can also be used for non-constant variance. In such cases the FOCUS chi-squared error level is not meaningful.
    • 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.
    • 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 cannot occur in a single experiment with a single defined radiolabel position.
    • -
    • When a metabolite decline phase is not described well by SFO kinetics, SFORB kinetics can be used for the metabolite. Mathematically, the SFORB model is equivalent to the DFOP model used by other tools for biphasic metabolite curves. However, the SFORB model has the advantage that there is a mechanistic interpretation of the model parameters.
    • -
    • Nonlinear mixed-effects models can be created from fits of the same degradation model to different datasets for the same compound by using the nlme.mmkin and saem.mmkin and methods. Note that the convergence of the nlme fits depends on the quality of the data. Convergence is better for simple models and data for many groups (e.g. soils). The saem method uses the saemix package as a backend. Analytical solutions suitable for use with this package have been implemented for parent only models and the most important models including one metabolite (SFO-SFO and DFOP-SFO). Fitting other models with saem.mmkin, while it makes use of the compiled ODE models that mkin provides, has longer run times (at least six minutes on my system).
    • +
    • When a metabolite decline phase is not described well by SFO kinetics, SFORB kinetics can be used for the metabolite. Mathematically, the SFORB model is equivalent to the DFOP model. However, the SFORB model has the advantage that there is a mechanistic interpretation of the model parameters.
    • +
    • Nonlinear mixed-effects models (hierarchical models) can be created from fits of the same degradation model to different datasets for the same compound by using the nlme.mmkin and saem.mmkin methods. Note that the convergence of the nlme fits depends on the quality of the data. Convergence is better for simple models and data for many groups (e.g. soils). The saem method uses the saemix package as a backend. Analytical solutions suitable for use with this package have been implemented for parent only models and the most important models including one metabolite (SFO-SFO and DFOP-SFO). Fitting other models with saem.mmkin, while it makes use of the compiled ODE models that mkin provides, has longer run times (from a couple of minutes to more than an hour).
    @@ -186,7 +186,7 @@

    GUI

    -

    There is a graphical user interface that may be useful. Please refer to its documentation page for installation instructions and a manual.

    +

    There is a graphical user interface that may be useful. Please refer to its documentation page for installation instructions and a manual. It only supports evaluations using (generalised) nonlinear regression, but not simultaneous fits using nonlinear mixed-effects models.

    News @@ -203,8 +203,8 @@

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

    -

    Thanks to René Lehmann, formerly working at the Umweltbundesamt, for the nice cooperation cooperation on parameter transformations, especially the isometric log-ratio transformation that is now used for formation fractions in case there are more than two transformation targets.

    +

    Finally, there is KineticEval, which contains some further development of the scripts used for KinGUII.

    +

    Thanks to René Lehmann, formerly working at the Umweltbundesamt, for the nice cooperation on parameter transformations, especially the isometric log-ratio transformation that is now used for formation fractions in case there are more than two transformation targets.

    Many inspirations for improvements of mkin resulted from doing kinetic evaluations of degradation data for my clients while working at Harlan Laboratories and at Eurofins Regulatory AG, and now as an independent consultant.

    Funding was received from the Umweltbundesamt in the course of the projects

      @@ -215,7 +215,8 @@
    • Project Number 120667 (Development of objective criteria for the evaluation of the visual fit in the kinetic evaluation of degradation data, 2019-2020)
    • Project Number 146839 (Checking the feasibility of using mixed-effects models for the derivation of kinetic modelling parameters from degradation studies, 2020-2021)
    -

    Thanks are due also to Emmanuelle Comets, maintainer of the saemix package, for the nice collaboration on using the SAEM algorithm and its implementation in saemix for the evaluation of chemical degradation data.

    +

    Thanks to everyone involved for collaboration and support!

    +

    Thanks are due also to Emmanuelle Comets, maintainer of the saemix package, for her interest and support for using the SAEM algorithm and its implementation in saemix for the evaluation of chemical degradation data.

    References diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index 3353922b..50afb3e9 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2

    @@ -88,7 +88,19 @@
    - + +
    +
    + +
    • ‘{data,R}/ds_mixed.rda’: Include the test data in the package instead of generating it in ‘tests/testthat/setup_script.R’. Refactor the generating code to make it consistent and update tests.

    • +
    • ‘tests/testthat/setup_script.R’: Excluded another ill-defined random effect for the DFOP fit with ‘saem’, in an attempt to avoid a platform dependence that surfaced on Fedora systems on the CRAN check farm

    • +
    • ‘tests/testthat/test_mixed.R’: Round parameters found by saemix to two significant digits before printing, to also help to avoid platform dependence of tests

    • +
    • ‘R/saem.R’: Fix a bug that prevented that ‘error.ini’ is passed to ‘saemix_model’, and set default to c(1, 1) to avoid changing test results

    • +
    • ‘R/parplot.R’: Show initial values for error model parameters

    • +
    • ‘R/loglik.mkinfit.R’: Add ‘nobs’ attribute to the resulting ‘logLik’ object, in order to make test_AIC.R succeed on current R-devel

    • +
    +
    +
    - - -
    +
    @@ -149,102 +94,110 @@ same dataset." /> same dataset.

    -
    # S3 method for mmkin
    -AIC(object, ..., k = 2)
    -
    -# S3 method for mmkin
    -BIC(object, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    object

    An object of class mmkin, containing only one -column.

    ...

    For compatibility with the generic method

    k

    As in the generic method

    - -

    Value

    - -

    As in the generic method (a numeric value for single fits, or a -dataframe if there are several fits in the column).

    -

    Author

    +
    +
    # S3 method for mmkin
    +AIC(object, ..., k = 2)
    +
    +# S3 method for mmkin
    +BIC(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    An object of class mmkin, containing only one +column.

    + +
    ...
    +

    For compatibility with the generic method

    + + +
    k
    +

    As in the generic method

    + +
    +
    +

    Value

    + + +

    As in the generic method (a numeric value for single fits, or a +dataframe if there are several fits in the column).

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - # skip, as it takes > 10 s on winbuilder - f <- mmkin(c("SFO", "FOMC", "DFOP"), - list("FOCUS A" = FOCUS_2006_A, - "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE) - # We get a warning because the FOMC model does not converge for the - # FOCUS A dataset, as it is well described by SFO - - AIC(f["SFO", "FOCUS A"]) # We get a single number for a single fit -
    #> [1] 55.28197
    AIC(f[["SFO", "FOCUS A"]]) # or when extracting an mkinfit object -
    #> [1] 55.28197
    - # For FOCUS A, the models fit almost equally well, so the higher the number - # of parameters, the higher (worse) the AIC - AIC(f[, "FOCUS A"]) -
    #> df AIC -#> SFO 3 55.28197 -#> FOMC 4 57.28222 -#> DFOP 5 59.28197
    AIC(f[, "FOCUS A"], k = 0) # If we do not penalize additional parameters, we get nearly the same -
    #> df AIC -#> SFO 3 49.28197 -#> FOMC 4 49.28222 -#> DFOP 5 49.28197
    BIC(f[, "FOCUS A"]) # Comparing the BIC gives a very similar picture -
    #> df BIC -#> SFO 3 55.52030 -#> FOMC 4 57.59999 -#> DFOP 5 59.67918
    - # For FOCUS C, the more complex models fit better - AIC(f[, "FOCUS C"]) -
    #> df AIC -#> SFO 3 59.29336 -#> FOMC 4 44.68652 -#> DFOP 5 29.02372
    BIC(f[, "FOCUS C"]) -
    #> df BIC -#> SFO 3 59.88504 -#> FOMC 4 45.47542 -#> DFOP 5 30.00984
    - -
    +
    +

    Examples

    +
    
    +   # skip, as it takes > 10 s on winbuilder
    +  f <- mmkin(c("SFO", "FOMC", "DFOP"),
    +    list("FOCUS A" = FOCUS_2006_A,
    +         "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE)
    +  # We get a warning because the FOMC model does not converge for the
    +  # FOCUS A dataset, as it is well described by SFO
    +
    +  AIC(f["SFO", "FOCUS A"]) # We get a single number for a single fit
    +#> [1] 55.28197
    +  AIC(f[["SFO", "FOCUS A"]]) # or when extracting an mkinfit object
    +#> [1] 55.28197
    +
    +  # For FOCUS A, the models fit almost equally well, so the higher the number
    +  # of parameters, the higher (worse) the AIC
    +  AIC(f[, "FOCUS A"])
    +#>      df      AIC
    +#> SFO   3 55.28197
    +#> FOMC  4 57.28222
    +#> DFOP  5 59.28197
    +  AIC(f[, "FOCUS A"], k = 0) # If we do not penalize additional parameters, we get nearly the same
    +#>      df      AIC
    +#> SFO   3 49.28197
    +#> FOMC  4 49.28222
    +#> DFOP  5 49.28197
    +  BIC(f[, "FOCUS A"])        # Comparing the BIC gives a very similar picture
    +#>      df      BIC
    +#> SFO   3 55.52030
    +#> FOMC  4 57.59999
    +#> DFOP  5 59.67918
    +
    +  # For FOCUS C, the more complex models fit better
    +  AIC(f[, "FOCUS C"])
    +#>      df      AIC
    +#> SFO   3 59.29336
    +#> FOMC  4 44.68652
    +#> DFOP  5 29.02372
    +  BIC(f[, "FOCUS C"])
    +#>      df      BIC
    +#> SFO   3 59.88504
    +#> FOMC  4 45.47542
    +#> DFOP  5 30.00984
    +  
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/CAKE_export.html b/docs/dev/reference/CAKE_export.html index 47efd056..33ae3f74 100644 --- a/docs/dev/reference/CAKE_export.html +++ b/docs/dev/reference/CAKE_export.html @@ -18,7 +18,7 @@ specified as well."> mkin - 1.1.2 + 1.2.2 @@ -45,11 +45,14 @@ specified as well.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -57,7 +60,10 @@ specified as well.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/D24_2014.html b/docs/dev/reference/D24_2014.html index 5cf7604c..14840260 100644 --- a/docs/dev/reference/D24_2014.html +++ b/docs/dev/reference/D24_2014.html @@ -22,7 +22,7 @@ constrained by data protection regulations."> mkin - 1.1.2 + 1.2.2 @@ -49,11 +49,14 @@ constrained by data protection regulations.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -61,7 +64,10 @@ constrained by data protection regulations.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/DFOP.solution.html b/docs/dev/reference/DFOP.solution.html index f41d8e9b..c6746fe7 100644 --- a/docs/dev/reference/DFOP.solution.html +++ b/docs/dev/reference/DFOP.solution.html @@ -18,7 +18,7 @@ two exponential decline functions."> - - - - - - -Subsetting method for mmkin objects — [.mmkin • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subsetting method for mmkin objects — [.mmkin • mkin + + - - - - -
    -
    - -
    - -
    +
    @@ -147,122 +92,127 @@

    Subsetting method for mmkin objects

    -
    # S3 method for mmkin
    -[(x, i, j, ..., drop = FALSE)
    +
    +
    # S3 method for mmkin
    +[(x, i, j, ..., drop = FALSE)
    +
    + +
    +

    Arguments

    +
    x
    +

    An mmkin object

    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    x

    An mmkin object

    i

    Row index selecting the fits for specific models

    j

    Column index selecting the fits to specific datasets

    ...

    Not used, only there to satisfy the generic method definition

    drop

    If FALSE, the method always returns an mmkin object, otherwise -either a list of mkinfit objects or a single mkinfit object.

    -

    Value

    +
    i
    +

    Row index selecting the fits for specific models

    -

    An object of class mmkin.

    -

    Author

    +
    j
    +

    Column index selecting the fits to specific datasets

    + + +
    ...
    +

    Not used, only there to satisfy the generic method definition

    + + +
    drop
    +

    If FALSE, the method always returns an mmkin object, otherwise +either a list of mkinfit objects or a single mkinfit object.

    + +
    +
    +

    Value

    + + +

    An object of class mmkin.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - # Only use one core, to pass R CMD check --as-cran - fits <- mmkin(c("SFO", "FOMC"), list(B = FOCUS_2006_B, C = FOCUS_2006_C), - cores = 1, quiet = TRUE) - fits["FOMC", ] -
    #> <mmkin> object -#> Status of individual fits: -#> -#> dataset -#> model B C -#> FOMC OK OK -#> -#> OK: No warnings
    fits[, "B"] -
    #> <mmkin> object -#> Status of individual fits: -#> -#> dataset -#> model B -#> SFO OK -#> FOMC OK -#> -#> OK: No warnings
    fits["SFO", "B"] -
    #> <mmkin> object -#> Status of individual fits: -#> -#> dataset -#> model B -#> SFO OK -#> -#> OK: No warnings
    - head( - # This extracts an mkinfit object with lots of components - fits[["FOMC", "B"]] - ) -
    #> $par -#> parent_0 log_alpha log_beta sigma -#> 99.666192 2.549850 5.050586 1.890202 -#> -#> $objective -#> [1] 28.58291 -#> -#> $convergence -#> [1] 0 -#> -#> $iterations -#> [1] 21 -#> -#> $evaluations -#> function gradient -#> 25 78 -#> -#> $message -#> [1] "both X-convergence and relative convergence (5)" -#>
    +
    +

    Examples

    +
    
    +  # Only use one core, to pass R CMD check --as-cran
    +  fits <- mmkin(c("SFO", "FOMC"), list(B = FOCUS_2006_B, C = FOCUS_2006_C),
    +                cores = 1, quiet = TRUE)
    +  fits["FOMC", ]
    +#> <mmkin> object
    +#> Status of individual fits:
    +#> 
    +#>       dataset
    +#> model  B  C 
    +#>   FOMC OK OK
    +#> 
    +#> OK: No warnings
    +  fits[, "B"]
    +#> <mmkin> object
    +#> Status of individual fits:
    +#> 
    +#>       dataset
    +#> model  B 
    +#>   SFO  OK
    +#>   FOMC OK
    +#> 
    +#> OK: No warnings
    +  fits["SFO", "B"]
    +#> <mmkin> object
    +#> Status of individual fits:
    +#> 
    +#>      dataset
    +#> model B 
    +#>   SFO OK
    +#> 
    +#> OK: No warnings
    +
    +  head(
    +    # This extracts an mkinfit object with lots of components
    +    fits[["FOMC", "B"]]
    +  )
    +#> $par
    +#>  parent_0 log_alpha  log_beta     sigma 
    +#> 99.666192  2.549850  5.050586  1.890202 
    +#> 
    +#> $objective
    +#> [1] 28.58291
    +#> 
    +#> $convergence
    +#> [1] 0
    +#> 
    +#> $iterations
    +#> [1] 21
    +#> 
    +#> $evaluations
    +#> function gradient 
    +#>       25       78 
    +#> 
    +#> $message
    +#> [1] "both X-convergence and relative convergence (5)"
    +#> 
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOCUS_2006_DFOP_ref_A_to_B.html b/docs/dev/reference/FOCUS_2006_DFOP_ref_A_to_B.html index a188430d..8891567a 100644 --- a/docs/dev/reference/FOCUS_2006_DFOP_ref_A_to_B.html +++ b/docs/dev/reference/FOCUS_2006_DFOP_ref_A_to_B.html @@ -1,71 +1,16 @@ - - - - - - - -Results of fitting the DFOP model to Datasets A to B of FOCUS (2006) — FOCUS_2006_DFOP_ref_A_to_B • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Results of fitting the DFOP model to Datasets A to B of FOCUS (2006) — FOCUS_2006_DFOP_ref_A_to_B • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    FOCUS_2006_DFOP_ref_A_to_B
    +
    +
    FOCUS_2006_DFOP_ref_A_to_B
    +
    +
    +

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    f

    The fitted f parameter

    -
    k1

    The fitted k1 parameter

    -
    k2

    The fitted k2 parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    f
    +

    The fitted f parameter

    + +
    k1
    +

    The fitted k1 parameter

    + +
    k2
    +

    The fitted k2 parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

    FOCUS (2006) “Guidance Document on Estimating Persistence and + +

    +
    +

    Source

    +

    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, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    -

    Examples

    -
    data(FOCUS_2006_DFOP_ref_A_to_B) -
    +
    +

    Examples

    +
    data(FOCUS_2006_DFOP_ref_A_to_B)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOCUS_2006_FOMC_ref_A_to_F.html b/docs/dev/reference/FOCUS_2006_FOMC_ref_A_to_F.html index 0bee1c16..a725ada7 100644 --- a/docs/dev/reference/FOCUS_2006_FOMC_ref_A_to_F.html +++ b/docs/dev/reference/FOCUS_2006_FOMC_ref_A_to_F.html @@ -1,71 +1,16 @@ - - - - - - - -Results of fitting the FOMC model to Datasets A to F of FOCUS (2006) — FOCUS_2006_FOMC_ref_A_to_F • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Results of fitting the FOMC model to Datasets A to F of FOCUS (2006) — FOCUS_2006_FOMC_ref_A_to_F • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    FOCUS_2006_FOMC_ref_A_to_F
    +
    +
    FOCUS_2006_FOMC_ref_A_to_F
    +
    +
    +

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    alpha

    The fitted alpha parameter

    -
    beta

    The fitted beta parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    alpha
    +

    The fitted alpha parameter

    + +
    beta
    +

    The fitted beta parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

    FOCUS (2006) “Guidance Document on Estimating Persistence and + +

    +
    +

    Source

    +

    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, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    -

    Examples

    -
    data(FOCUS_2006_FOMC_ref_A_to_F) -
    +
    +

    Examples

    +
    data(FOCUS_2006_FOMC_ref_A_to_F)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOCUS_2006_HS_ref_A_to_F.html b/docs/dev/reference/FOCUS_2006_HS_ref_A_to_F.html index 460fdf0d..d6758f62 100644 --- a/docs/dev/reference/FOCUS_2006_HS_ref_A_to_F.html +++ b/docs/dev/reference/FOCUS_2006_HS_ref_A_to_F.html @@ -1,71 +1,16 @@ - - - - - - - -Results of fitting the HS model to Datasets A to F of FOCUS (2006) — FOCUS_2006_HS_ref_A_to_F • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Results of fitting the HS model to Datasets A to F of FOCUS (2006) — FOCUS_2006_HS_ref_A_to_F • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    FOCUS_2006_HS_ref_A_to_F
    +
    +
    FOCUS_2006_HS_ref_A_to_F
    +
    +
    +

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    tb

    The fitted tb parameter

    -
    k1

    The fitted k1 parameter

    -
    k2

    The fitted k2 parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    tb
    +

    The fitted tb parameter

    + +
    k1
    +

    The fitted k1 parameter

    + +
    k2
    +

    The fitted k2 parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

    FOCUS (2006) “Guidance Document on Estimating Persistence and + +

    +
    +

    Source

    +

    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, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    -

    Examples

    -
    data(FOCUS_2006_HS_ref_A_to_F) -
    +
    +

    Examples

    +
    data(FOCUS_2006_HS_ref_A_to_F)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOCUS_2006_SFO_ref_A_to_F.html b/docs/dev/reference/FOCUS_2006_SFO_ref_A_to_F.html index c1a5fdff..445ed2d6 100644 --- a/docs/dev/reference/FOCUS_2006_SFO_ref_A_to_F.html +++ b/docs/dev/reference/FOCUS_2006_SFO_ref_A_to_F.html @@ -1,71 +1,16 @@ - - - - - - - -Results of fitting the SFO model to Datasets A to F of FOCUS (2006) — FOCUS_2006_SFO_ref_A_to_F • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Results of fitting the SFO model to Datasets A to F of FOCUS (2006) — FOCUS_2006_SFO_ref_A_to_F • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    FOCUS_2006_SFO_ref_A_to_F
    +
    +
    FOCUS_2006_SFO_ref_A_to_F
    +
    +
    +

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    k

    The fitted first-order degradation rate constant

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    k
    +

    The fitted first-order degradation rate constant

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

    FOCUS (2006) “Guidance Document on Estimating Persistence and + +

    +
    +

    Source

    +

    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, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    -

    Examples

    -
    data(FOCUS_2006_SFO_ref_A_to_F) -
    +
    +

    Examples

    +
    data(FOCUS_2006_SFO_ref_A_to_F)
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOCUS_2006_datasets.html b/docs/dev/reference/FOCUS_2006_datasets.html index fb3a8f17..955b9188 100644 --- a/docs/dev/reference/FOCUS_2006_datasets.html +++ b/docs/dev/reference/FOCUS_2006_datasets.html @@ -1,67 +1,12 @@ - - - - - - - -Datasets A to F from the FOCUS Kinetics report from 2006 — FOCUS_2006_datasets • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Datasets A to F from the FOCUS Kinetics report from 2006 — FOCUS_2006_datasets • mkin - - - - + + -
    -
    - -
    - -
    +
    -
    FOCUS_2006_A
    -  FOCUS_2006_B
    -  FOCUS_2006_C
    -  FOCUS_2006_D
    -  FOCUS_2006_E
    -  FOCUS_2006_F
    +
    +
    FOCUS_2006_A
    +  FOCUS_2006_B
    +  FOCUS_2006_C
    +  FOCUS_2006_D
    +  FOCUS_2006_E
    +  FOCUS_2006_F
    +
    +
    +

    Format

    +

    6 datasets with observations on the following variables.

    name
    +

    a factor containing the name of the observed variable

    -

    Format

    +
    time
    +

    a numeric vector containing time points

    -

    6 datasets with observations on the following variables.

    -
    name

    a factor containing the name of the observed variable

    -
    time

    a numeric vector containing time points

    -
    value

    a numeric vector containing concentrations in percent of applied radioactivity

    - -
    +
    value
    +

    a numeric vector containing concentrations in percent of applied radioactivity

    -

    Source

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence and + +

    +
    +

    Source

    +

    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, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    - -

    Examples

    -
    FOCUS_2006_C -
    #> name time value -#> 1 parent 0 85.1 -#> 2 parent 1 57.9 -#> 3 parent 3 29.9 -#> 4 parent 7 14.6 -#> 5 parent 14 9.7 -#> 6 parent 28 6.6 -#> 7 parent 63 4.0 -#> 8 parent 91 3.9 -#> 9 parent 119 0.6
    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    + +
    +

    Examples

    +
    FOCUS_2006_C
    +#>     name time value
    +#> 1 parent    0  85.1
    +#> 2 parent    1  57.9
    +#> 3 parent    3  29.9
    +#> 4 parent    7  14.6
    +#> 5 parent   14   9.7
    +#> 6 parent   28   6.6
    +#> 7 parent   63   4.0
    +#> 8 parent   91   3.9
    +#> 9 parent  119   0.6
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/FOMC.solution.html b/docs/dev/reference/FOMC.solution.html index f64e759c..e1f19dc1 100644 --- a/docs/dev/reference/FOMC.solution.html +++ b/docs/dev/reference/FOMC.solution.html @@ -18,7 +18,7 @@ a decreasing rate constant."> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Example datasets from the NAFTA SOP published 2015 — NAFTA_SOP_2015 • mkin - - - - + + -
    -
    - -
    - -
    +
    -
    NAFTA_SOP_Appendix_B
    -  NAFTA_SOP_Appendix_D
    +
    +
    NAFTA_SOP_Appendix_B
    +  NAFTA_SOP_Appendix_D
    +
    +
    +

    Format

    +

    2 datasets with observations on the following variables.

    name
    +

    a factor containing the name of the observed variable

    -

    Format

    +
    time
    +

    a numeric vector containing time points

    -

    2 datasets with observations on the following variables.

    -
    name

    a factor containing the name of the observed variable

    -
    time

    a numeric vector containing time points

    -
    value

    a numeric vector containing concentrations

    - -
    - -

    Source

    +
    value
    +

    a numeric vector containing concentrations

    + +
    +
    +

    Source

    NAFTA (2011) Guidance for evaluating and calculating degradation kinetics in environmental media. NAFTA Technical Working Group on Pesticides - https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation accessed 2019-02-22

    US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to Calculate Representative Half-life Values and Characterizing Pesticide Degradation - https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    - -

    Examples

    -
    nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1) -
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation) -
    #> Sums of squares: -#> SFO IORE DFOP -#> 1378.6832 615.7730 517.8836 -#> -#> Critical sum of squares for checking the SFO model: -#> [1] 717.4598 -#> -#> Parameters: -#> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 83.7558 1.80e-14 77.18268 90.3288 -#> k_parent 0.0017 7.43e-05 0.00112 0.0026 -#> sigma 8.7518 1.22e-05 5.64278 11.8608 -#> -#> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 -#> k__iore_parent 8.40e-14 NA 1.79e-18 3.94e-09 -#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 -#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 -#> -#> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02 -#> k1 4.24e-02 5.92e-03 2.03e-02 8.88e-02 -#> k2 8.24e-04 6.48e-03 3.89e-04 1.75e-03 -#> g 2.88e-01 2.47e-05 1.95e-01 4.03e-01 -#> sigma 5.36e+00 2.22e-05 3.43e+00 7.30e+00 -#> -#> -#> DTx values: -#> DT50 DT90 DT50_rep -#> SFO 407 1350 407 -#> IORE 541 5190000 1560000 -#> DFOP 429 2380 841 -#> -#> Representative half-life: -#> [1] 841.41
    plot(nafta_evaluation) -
    + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    +
    + +
    +

    Examples

    +
      nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    +#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +#> The representative half-life of the IORE model is longer than the one corresponding
    +#> to the terminal degradation rate found with the DFOP model.
    +#> The representative half-life obtained from the DFOP model may be used
    +  print(nafta_evaluation)
    +#> Sums of squares:
    +#>       SFO      IORE      DFOP 
    +#> 1378.6832  615.7730  517.8836 
    +#> 
    +#> Critical sum of squares for checking the SFO model:
    +#> [1] 717.4598
    +#> 
    +#> Parameters:
    +#> $SFO
    +#>          Estimate   Pr(>t)    Lower   Upper
    +#> parent_0  83.7558 1.80e-14 77.18268 90.3288
    +#> k_parent   0.0017 7.43e-05  0.00112  0.0026
    +#> sigma      8.7518 1.22e-05  5.64278 11.8608
    +#> 
    +#> $IORE
    +#>                Estimate Pr(>t)    Lower    Upper
    +#> parent_0       9.69e+01     NA 8.88e+01 1.05e+02
    +#> k__iore_parent 8.40e-14     NA 1.79e-18 3.94e-09
    +#> N_parent       6.68e+00     NA 4.19e+00 9.17e+00
    +#> sigma          5.85e+00     NA 3.76e+00 7.94e+00
    +#> 
    +#> $DFOP
    +#>          Estimate   Pr(>t)    Lower    Upper
    +#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02
    +#> k1       4.24e-02 5.92e-03 2.03e-02 8.88e-02
    +#> k2       8.24e-04 6.48e-03 3.89e-04 1.75e-03
    +#> g        2.88e-01 2.47e-05 1.95e-01 4.03e-01
    +#> sigma    5.36e+00 2.22e-05 3.43e+00 7.30e+00
    +#> 
    +#> 
    +#> DTx values:
    +#>      DT50    DT90 DT50_rep
    +#> SFO   407    1350      407
    +#> IORE  541 5190000  1560000
    +#> DFOP  429    2380      841
    +#> 
    +#> Representative half-life:
    +#> [1] 841.41
    +  plot(nafta_evaluation)
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/NAFTA_SOP_Attachment-1.png b/docs/dev/reference/NAFTA_SOP_Attachment-1.png index 9417685e..d8951fc3 100644 Binary files a/docs/dev/reference/NAFTA_SOP_Attachment-1.png and b/docs/dev/reference/NAFTA_SOP_Attachment-1.png differ diff --git a/docs/dev/reference/NAFTA_SOP_Attachment.html b/docs/dev/reference/NAFTA_SOP_Attachment.html index 311a7c61..9d878a49 100644 --- a/docs/dev/reference/NAFTA_SOP_Attachment.html +++ b/docs/dev/reference/NAFTA_SOP_Attachment.html @@ -1,67 +1,12 @@ - - - - - - - -Example datasets from Attachment 1 to the NAFTA SOP published 2015 — NAFTA_SOP_Attachment • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Example datasets from Attachment 1 to the NAFTA SOP published 2015 — NAFTA_SOP_Attachment • mkin - - - - + + -
    -
    - -
    - -
    +
    -
    NAFTA_SOP_Attachment
    - - -

    Format

    +
    +
    NAFTA_SOP_Attachment
    +
    +
    +

    Format

    A list (NAFTA_SOP_Attachment) containing 16 datasets suitable - for the evaluation with nafta

    -

    Source

    - + for the evaluation with nafta

    +
    +
    +

    Source

    NAFTA (2011) Guidance for evaluating and calculating degradation kinetics in environmental media. NAFTA Technical Working Group on Pesticides - https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation accessed 2019-02-22

    US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to Calculate Representative Half-life Values and Characterizing Pesticide Degradation - https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    - -

    Examples

    -
    nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1) -
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The half-life obtained from the IORE model may be used
    print(nafta_att_p5a) -
    #> Sums of squares: -#> SFO IORE DFOP -#> 465.21753 56.27506 32.06401 -#> -#> Critical sum of squares for checking the SFO model: -#> [1] 64.4304 -#> -#> Parameters: -#> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 95.8401 4.67e-21 92.245 99.4357 -#> k_parent 0.0102 3.92e-12 0.009 0.0117 -#> sigma 4.8230 3.81e-06 3.214 6.4318 -#> -#> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 1.01e+02 NA 9.91e+01 1.02e+02 -#> k__iore_parent 1.54e-05 NA 4.08e-06 5.84e-05 -#> N_parent 2.57e+00 NA 2.25e+00 2.89e+00 -#> sigma 1.68e+00 NA 1.12e+00 2.24e+00 -#> -#> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.99e+01 1.41e-26 98.8116 101.0810 -#> k1 2.67e-02 5.05e-06 0.0243 0.0295 -#> k2 2.26e-12 5.00e-01 0.0000 Inf -#> g 6.47e-01 3.67e-06 0.6248 0.6677 -#> sigma 1.27e+00 8.91e-06 0.8395 1.6929 -#> -#> -#> DTx values: -#> DT50 DT90 DT50_rep -#> SFO 67.7 2.25e+02 6.77e+01 -#> IORE 58.2 1.07e+03 3.22e+02 -#> DFOP 55.5 5.59e+11 3.07e+11 -#> -#> Representative half-life: -#> [1] 321.51
    plot(nafta_att_p5a) -
    + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    +
    + +
    +

    Examples

    +
      nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1)
    +#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +#> The half-life obtained from the IORE model may be used
    +  print(nafta_att_p5a)
    +#> Sums of squares:
    +#>       SFO      IORE      DFOP 
    +#> 465.21753  56.27506  32.06401 
    +#> 
    +#> Critical sum of squares for checking the SFO model:
    +#> [1] 64.4304
    +#> 
    +#> Parameters:
    +#> $SFO
    +#>          Estimate   Pr(>t)  Lower   Upper
    +#> parent_0  95.8401 4.67e-21 92.245 99.4357
    +#> k_parent   0.0102 3.92e-12  0.009  0.0117
    +#> sigma      4.8230 3.81e-06  3.214  6.4318
    +#> 
    +#> $IORE
    +#>                Estimate Pr(>t)    Lower    Upper
    +#> parent_0       1.01e+02     NA 9.91e+01 1.02e+02
    +#> k__iore_parent 1.54e-05     NA 4.08e-06 5.84e-05
    +#> N_parent       2.57e+00     NA 2.25e+00 2.89e+00
    +#> sigma          1.68e+00     NA 1.12e+00 2.24e+00
    +#> 
    +#> $DFOP
    +#>          Estimate   Pr(>t)   Lower    Upper
    +#> parent_0 9.99e+01 1.41e-26 98.8116 101.0810
    +#> k1       2.67e-02 5.05e-06  0.0243   0.0295
    +#> k2       2.26e-12 5.00e-01  0.0000      Inf
    +#> g        6.47e-01 3.67e-06  0.6248   0.6677
    +#> sigma    1.27e+00 8.91e-06  0.8395   1.6929
    +#> 
    +#> 
    +#> DTx values:
    +#>      DT50     DT90 DT50_rep
    +#> SFO  67.7 2.25e+02 6.77e+01
    +#> IORE 58.2 1.07e+03 3.22e+02
    +#> DFOP 55.5 5.59e+11 3.07e+11
    +#> 
    +#> Representative half-life:
    +#> [1] 321.51
    +  plot(nafta_att_p5a)
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png index b3448db0..ca982688 100644 Binary files a/docs/dev/reference/Rplot001.png and b/docs/dev/reference/Rplot001.png differ diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png index 27feab09..de2d61aa 100644 Binary files a/docs/dev/reference/Rplot002.png and b/docs/dev/reference/Rplot002.png differ diff --git a/docs/dev/reference/Rplot005.png b/docs/dev/reference/Rplot005.png index cb419daa..76f25647 100644 Binary files a/docs/dev/reference/Rplot005.png and b/docs/dev/reference/Rplot005.png differ diff --git a/docs/dev/reference/SFO.solution.html b/docs/dev/reference/SFO.solution.html index 970a62c5..a0bb999c 100644 --- a/docs/dev/reference/SFO.solution.html +++ b/docs/dev/reference/SFO.solution.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2 @@ -59,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/SFORB.solution.html b/docs/dev/reference/SFORB.solution.html index e3e43557..c14d3a32 100644 --- a/docs/dev/reference/SFORB.solution.html +++ b/docs/dev/reference/SFORB.solution.html @@ -21,7 +21,7 @@ and no substance in the bound fraction.">< mkin - 1.2.0 + 1.2.2 @@ -63,7 +63,10 @@ and no substance in the bound fraction.">< Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/add_err-1.png b/docs/dev/reference/add_err-1.png index 9ba106db..4a3b4062 100644 Binary files a/docs/dev/reference/add_err-1.png and b/docs/dev/reference/add_err-1.png differ diff --git a/docs/dev/reference/add_err-2.png b/docs/dev/reference/add_err-2.png index 3088c40e..5aec1744 100644 Binary files a/docs/dev/reference/add_err-2.png and b/docs/dev/reference/add_err-2.png differ diff --git a/docs/dev/reference/add_err-3.png b/docs/dev/reference/add_err-3.png index 493a761a..2e71f02f 100644 Binary files a/docs/dev/reference/add_err-3.png and b/docs/dev/reference/add_err-3.png differ diff --git a/docs/dev/reference/add_err.html b/docs/dev/reference/add_err.html index b94cef29..c70d43a0 100644 --- a/docs/dev/reference/add_err.html +++ b/docs/dev/reference/add_err.html @@ -1,69 +1,14 @@ - - - - - - - -Add normally distributed errors to simulated kinetic degradation data — add_err • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Add normally distributed errors to simulated kinetic degradation data — add_err • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +

    Normally distributed errors are added to data predicted for a specific -degradation model using mkinpredict. The variance of the error +degradation model using mkinpredict. The variance of the error may depend on the predicted value and is specified as a standard deviation.

    -
    add_err(
    -  prediction,
    -  sdfunc,
    -  secondary = c("M1", "M2"),
    -  n = 10,
    -  LOD = 0.1,
    -  reps = 2,
    -  digits = 1,
    -  seed = NA
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    prediction

    A prediction from a kinetic model as produced by -mkinpredict.

    sdfunc

    A function taking the predicted value as its only argument and +

    +
    add_err(
    +  prediction,
    +  sdfunc,
    +  secondary = c("M1", "M2"),
    +  n = 10,
    +  LOD = 0.1,
    +  reps = 2,
    +  digits = 1,
    +  seed = NA
    +)
    +
    + +
    +

    Arguments

    +
    prediction
    +

    A prediction from a kinetic model as produced by +mkinpredict.

    + + +
    sdfunc
    +

    A function taking the predicted value as its only argument and returning a standard deviation that should be used for generating the -random error terms for this value.

    secondary

    The names of state variables that should have an initial -value of zero

    n

    The number of datasets to be generated.

    LOD

    The limit of detection (LOD). Values that are below the LOD after -adding the random error will be set to NA.

    reps

    The number of replicates to be generated within the datasets.

    digits

    The number of digits to which the values will be rounded.

    seed

    The seed used for the generation of random numbers. If NA, the -seed is not set.

    - -

    Value

    - -

    A list of datasets compatible with mmkin, i.e. the -components of the list are datasets compatible with mkinfit.

    -

    References

    +random error terms for this value.

    + + +
    secondary
    +

    The names of state variables that should have an initial +value of zero

    + + +
    n
    +

    The number of datasets to be generated.

    + + +
    LOD
    +

    The limit of detection (LOD). Values that are below the LOD after +adding the random error will be set to NA.

    + +
    reps
    +

    The number of replicates to be generated within the datasets.

    + + +
    digits
    +

    The number of digits to which the values will be rounded.

    + + +
    seed
    +

    The seed used for the generation of random numbers. If NA, the +seed is not set.

    + +
    +
    +

    Value

    + + +

    A list of datasets compatible with mmkin, i.e. the +components of the list are datasets compatible with mkinfit.

    +
    +
    +

    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 https://jrwb.de/posters/piacenza_2015.pdf

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -# The kinetic model -m_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"), - M1 = mkinsub("SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -# Generate a prediction for a specific set of parameters -sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) - -# This is the prediction used for the "Type 2 datasets" on the Piacenza poster -# from 2015 -d_SFO_SFO <- mkinpredict(m_SFO_SFO, - c(k_parent = 0.1, f_parent_to_M1 = 0.5, - k_M1 = log(2)/1000), - c(parent = 100, M1 = 0), - sampling_times) - -# Add an error term with a constant (independent of the value) standard deviation -# of 10, and generate three datasets -d_SFO_SFO_err <- add_err(d_SFO_SFO, function(x) 10, n = 3, seed = 123456789 ) - -# Name the datasets for nicer plotting -names(d_SFO_SFO_err) <- paste("Dataset", 1:3) - -# Name the model in the list of models (with only one member in this case) for -# nicer plotting later on. Be quiet and use only one core not to offend CRAN -# checks -# \dontrun{ -f_SFO_SFO <- mmkin(list("SFO-SFO" = m_SFO_SFO), - d_SFO_SFO_err, cores = 1, - quiet = TRUE) - -plot(f_SFO_SFO) -
    -# We would like to inspect the fit for dataset 3 more closely -# Using double brackets makes the returned object an mkinfit object -# instead of a list of mkinfit objects, so plot.mkinfit is used -plot(f_SFO_SFO[[3]], show_residuals = TRUE) -
    -# If we use single brackets, we should give two indices (model and dataset), -# and plot.mmkin is used -plot(f_SFO_SFO[1, 3]) -
    # } - -
    +
    +

    Examples

    +
    
    +# The kinetic model
    +m_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"),
    +                     M1 = mkinsub("SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +# Generate a prediction for a specific set of parameters
    +sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +
    +# This is the prediction used for the "Type 2 datasets" on the Piacenza poster
    +# from 2015
    +d_SFO_SFO <- mkinpredict(m_SFO_SFO,
    +                         c(k_parent = 0.1, f_parent_to_M1 = 0.5,
    +                           k_M1 = log(2)/1000),
    +                         c(parent = 100, M1 = 0),
    +                         sampling_times)
    +
    +# Add an error term with a constant (independent of the value) standard deviation
    +# of 10, and generate three datasets
    +d_SFO_SFO_err <- add_err(d_SFO_SFO, function(x) 10, n = 3, seed = 123456789 )
    +
    +# Name the datasets for nicer plotting
    +names(d_SFO_SFO_err) <- paste("Dataset", 1:3)
    +
    +# Name the model in the list of models (with only one member in this case) for
    +# nicer plotting later on.  Be quiet and use only one core not to offend CRAN
    +# checks
    +# \dontrun{
    +f_SFO_SFO <- mmkin(list("SFO-SFO" = m_SFO_SFO),
    +                   d_SFO_SFO_err, cores = 1,
    +                   quiet = TRUE)
    +
    +plot(f_SFO_SFO)
    +
    +
    +# We would like to inspect the fit for dataset 3 more closely
    +# Using double brackets makes the returned object an mkinfit object
    +# instead of a list of mkinfit objects, so plot.mkinfit is used
    +plot(f_SFO_SFO[[3]], show_residuals = TRUE)
    +
    +
    +# If we use single brackets, we should give two indices (model and dataset),
    +# and plot.mmkin is used
    +plot(f_SFO_SFO[1, 3])
    +
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/anova.saem.mmkin.html b/docs/dev/reference/anova.saem.mmkin.html index 2c109cc2..1689e436 100644 --- a/docs/dev/reference/anova.saem.mmkin.html +++ b/docs/dev/reference/anova.saem.mmkin.html @@ -20,7 +20,7 @@ the model on the previous line."> - - - - - - -Confidence intervals for parameters of mkinfit objects — confint.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Confidence intervals for parameters of mkinfit objects — confint.mkinfit • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    @@ -161,279 +106,301 @@ platforms. The speed of the method could likely be improved by using the method of Venzon and Moolgavkar (1988).

    -
    # S3 method for mkinfit
    -confint(
    -  object,
    -  parm,
    -  level = 0.95,
    -  alpha = 1 - level,
    -  cutoff,
    -  method = c("quadratic", "profile"),
    -  transformed = TRUE,
    -  backtransform = TRUE,
    -  cores = parallel::detectCores(),
    -  rel_tol = 0.01,
    -  quiet = FALSE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    object

    An mkinfit object

    parm

    A vector of names of the parameters which are to be given -confidence intervals. If missing, all parameters are considered.

    level

    The confidence level required

    alpha

    The allowed error probability, overrides 'level' if specified.

    cutoff

    Possibility to specify an alternative cutoff for the difference +

    +
    # S3 method for mkinfit
    +confint(
    +  object,
    +  parm,
    +  level = 0.95,
    +  alpha = 1 - level,
    +  cutoff,
    +  method = c("quadratic", "profile"),
    +  transformed = TRUE,
    +  backtransform = TRUE,
    +  cores = parallel::detectCores(),
    +  rel_tol = 0.01,
    +  quiet = FALSE,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    An mkinfit object

    + + +
    parm
    +

    A vector of names of the parameters which are to be given +confidence intervals. If missing, all parameters are considered.

    + + +
    level
    +

    The confidence level required

    + + +
    alpha
    +

    The allowed error probability, overrides 'level' if specified.

    + + +
    cutoff
    +

    Possibility to specify an alternative cutoff for the difference in the log-likelihoods at the confidence boundary. Specifying an explicit -cutoff value overrides arguments 'level' and 'alpha'

    method

    The 'quadratic' method approximates the likelihood function at +cutoff value overrides arguments 'level' and 'alpha'

    + + +
    method
    +

    The 'quadratic' method approximates the likelihood function at the optimised parameters using the second term of the Taylor expansion, using a second derivative (hessian) contained in the object. The 'profile' method searches the parameter space for the -cutoff of the confidence intervals by means of a likelihood ratio test.

    transformed

    If the quadratic approximation is used, should it be -applied to the likelihood based on the transformed parameters?

    backtransform

    If we approximate the likelihood in terms of the +cutoff of the confidence intervals by means of a likelihood ratio test.

    + + +
    transformed
    +

    If the quadratic approximation is used, should it be +applied to the likelihood based on the transformed parameters?

    + + +
    backtransform
    +

    If we approximate the likelihood in terms of the transformed parameters, should we backtransform the parameters with -their confidence intervals?

    cores

    The number of cores to be used for multicore processing. -On Windows machines, cores > 1 is currently not supported.

    rel_tol

    If the method is 'profile', what should be the accuracy +their confidence intervals?

    + + +
    cores
    +

    The number of cores to be used for multicore processing. +On Windows machines, cores > 1 is currently not supported.

    + + +
    rel_tol
    +

    If the method is 'profile', what should be the accuracy of the lower and upper bounds, relative to the estimate obtained from -the quadratic method?

    quiet

    Should we suppress the message "Profiling the likelihood"

    ...

    Not used

    - -

    Value

    - -

    A matrix with columns giving lower and upper confidence limits for -each parameter.

    -

    References

    +the quadratic method?

    + + +
    quiet
    +

    Should we suppress the message "Profiling the likelihood"

    + +
    ...
    +

    Not used

    + +
    +
    +

    Value

    + + +

    A matrix with columns giving lower and upper confidence limits for +each parameter.

    +
    +
    +

    References

    Bates DM and Watts GW (1988) Nonlinear regression analysis & its applications

    Pawitan Y (2013) In all likelihood - Statistical modelling and inference using likelihood. Clarendon Press, Oxford.

    Venzon DJ and Moolgavkar SH (1988) A Method for Computing Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, 87–94.

    +
    -

    Examples

    -
    f <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE) -confint(f, method = "quadratic") -
    #> 2.5% 97.5% -#> parent_0 71.8242430 93.1600766 -#> k_parent 0.2109541 0.4440528 -#> sigma 1.9778868 7.3681380
    -# \dontrun{ -confint(f, method = "profile") -
    #> Profiling the likelihood
    #> 2.5% 97.5% -#> parent_0 73.0641834 92.1392181 -#> k_parent 0.2170293 0.4235348 -#> sigma 3.1307772 8.0628314
    -# Set the number of cores for the profiling method for further examples -if (identical(Sys.getenv("NOT_CRAN"), "true")) { - n_cores <- parallel::detectCores() - 1 -} else { - n_cores <- 1 -} -if (Sys.getenv("TRAVIS") != "") n_cores = 1 -if (Sys.info()["sysname"] == "Windows") n_cores = 1 - -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), - use_of_ff = "min", quiet = TRUE) -SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), - use_of_ff = "max", quiet = TRUE) -f_d_1 <- mkinfit(SFO_SFO, subset(FOCUS_2006_D, value != 0), quiet = TRUE) -system.time(ci_profile <- confint(f_d_1, method = "profile", cores = 1, quiet = TRUE)) -
    #> user system elapsed -#> 4.295 1.008 3.959
    # Using more cores does not save much time here, as parent_0 takes up most of the time -# If we additionally exclude parent_0 (the confidence of which is often of -# minor interest), we get a nice performance improvement if we use at least 4 cores -system.time(ci_profile_no_parent_0 <- confint(f_d_1, method = "profile", - c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores)) -
    #> Profiling the likelihood
    #> user system elapsed -#> 1.451 0.126 0.923
    ci_profile -
    #> 2.5% 97.5% -#> parent_0 96.456003640 1.027703e+02 -#> k_parent_sink 0.040762501 5.549764e-02 -#> k_parent_m1 0.046786482 5.500879e-02 -#> k_m1_sink 0.003892605 6.702778e-03 -#> sigma 2.535612399 3.985263e+00
    ci_quadratic_transformed <- confint(f_d_1, method = "quadratic") -ci_quadratic_transformed -
    #> 2.5% 97.5% -#> parent_0 96.403841640 1.027931e+02 -#> k_parent_sink 0.041033378 5.596269e-02 -#> k_parent_m1 0.046777902 5.511931e-02 -#> k_m1_sink 0.004012217 6.897547e-03 -#> sigma 2.396089689 3.854918e+00
    ci_quadratic_untransformed <- confint(f_d_1, method = "quadratic", transformed = FALSE) -ci_quadratic_untransformed -
    #> 2.5% 97.5% -#> parent_0 96.403841645 102.79312449 -#> k_parent_sink 0.040485331 0.05535491 -#> k_parent_m1 0.046611582 0.05494364 -#> k_m1_sink 0.003835483 0.00668582 -#> sigma 2.396089689 3.85491806
    # Against the expectation based on Bates and Watts (1988), the confidence -# intervals based on the internal parameter transformation are less -# congruent with the likelihood based intervals. Note the superiority of the -# interval based on the untransformed fit for k_m1_sink -rel_diffs_transformed <- abs((ci_quadratic_transformed - ci_profile)/ci_profile) -rel_diffs_untransformed <- abs((ci_quadratic_untransformed - ci_profile)/ci_profile) -rel_diffs_transformed < rel_diffs_untransformed -
    #> 2.5% 97.5% -#> parent_0 FALSE FALSE -#> k_parent_sink TRUE FALSE -#> k_parent_m1 TRUE FALSE -#> k_m1_sink FALSE FALSE -#> sigma FALSE FALSE
    signif(rel_diffs_transformed, 3) -
    #> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent_sink 0.006650 0.008380 -#> k_parent_m1 0.000183 0.002010 -#> k_m1_sink 0.030700 0.029100 -#> sigma 0.055000 0.032700
    signif(rel_diffs_untransformed, 3) -
    #> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent_sink 0.006800 0.002570 -#> k_parent_m1 0.003740 0.001180 -#> k_m1_sink 0.014700 0.002530 -#> sigma 0.055000 0.032700
    - -# Investigate a case with formation fractions -f_d_2 <- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), quiet = TRUE) -ci_profile_ff <- confint(f_d_2, method = "profile", cores = n_cores) -
    #> Profiling the likelihood
    ci_profile_ff -
    #> 2.5% 97.5% -#> parent_0 96.456003640 1.027703e+02 -#> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892606 6.702775e-03 -#> f_parent_to_m1 0.471328495 5.611550e-01 -#> sigma 2.535612399 3.985263e+00
    ci_quadratic_transformed_ff <- confint(f_d_2, method = "quadratic") -ci_quadratic_transformed_ff -
    #> 2.5% 97.5% -#> parent_0 96.403833578 102.79311649 -#> k_parent 0.090823771 0.10725430 -#> k_m1 0.004012219 0.00689755 -#> f_parent_to_m1 0.469118824 0.55959615 -#> sigma 2.396089689 3.85491806
    ci_quadratic_untransformed_ff <- confint(f_d_2, method = "quadratic", transformed = FALSE) -ci_quadratic_untransformed_ff -
    #> 2.5% 97.5% -#> parent_0 96.403833583 1.027931e+02 -#> k_parent 0.090491913 1.069035e-01 -#> k_m1 0.003835485 6.685823e-03 -#> f_parent_to_m1 0.469113477 5.598387e-01 -#> sigma 2.396089689 3.854918e+00
    rel_diffs_transformed_ff <- abs((ci_quadratic_transformed_ff - ci_profile_ff)/ci_profile_ff) -rel_diffs_untransformed_ff <- abs((ci_quadratic_untransformed_ff - ci_profile_ff)/ci_profile_ff) -# While the confidence interval for the parent rate constant is closer to -# the profile based interval when using the internal parameter -# transformation, the interval for the metabolite rate constant is 'better -# without internal parameter transformation. -rel_diffs_transformed_ff < rel_diffs_untransformed_ff -
    #> 2.5% 97.5% -#> parent_0 FALSE FALSE -#> k_parent TRUE TRUE -#> k_m1 FALSE FALSE -#> f_parent_to_m1 TRUE FALSE -#> sigma TRUE FALSE
    rel_diffs_transformed_ff -
    #> 2.5% 97.5% -#> parent_0 0.0005408690 0.0002217233 -#> k_parent 0.0009598532 0.0009001864 -#> k_m1 0.0307283041 0.0290588361 -#> f_parent_to_m1 0.0046881769 0.0027780063 -#> sigma 0.0550252516 0.0327066836
    rel_diffs_untransformed_ff -
    #> 2.5% 97.5% -#> parent_0 0.0005408689 0.0002217232 -#> k_parent 0.0046102156 0.0023732281 -#> k_m1 0.0146740690 0.0025291820 -#> f_parent_to_m1 0.0046995211 0.0023457712 -#> sigma 0.0550252516 0.0327066836
    -# The profiling for the following fit does not finish in a reasonable time, -# therefore we use the quadratic approximation -m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")), - M1 = mkinsub("SFO"), - M2 = mkinsub("SFO"), - use_of_ff = "max", quiet = TRUE) -DFOP_par_c <- synthetic_data_for_UBA_2014[[12]]$data -f_tc_2 <- mkinfit(m_synth_DFOP_par, DFOP_par_c, error_model = "tc", - error_model_algorithm = "direct", quiet = TRUE) -confint(f_tc_2, method = "quadratic") -
    #> 2.5% 97.5% -#> parent_0 94.596039609 106.19954892 -#> k_M1 0.037605368 0.04490762 -#> k_M2 0.008568731 0.01087676 -#> f_parent_to_M1 0.021462489 0.62023882 -#> f_parent_to_M2 0.015165617 0.37975348 -#> k1 0.273897348 0.33388101 -#> k2 0.018614554 0.02250378 -#> g 0.671943411 0.73583305 -#> sigma_low 0.251283495 0.83992077 -#> rsd_high 0.040411024 0.07662008
    confint(f_tc_2, "parent_0", method = "quadratic") -
    #> 2.5% 97.5% -#> parent_0 94.59604 106.1995
    # } -
    +
    +

    Examples

    +
    f <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
    +confint(f, method = "quadratic")
    +#>                2.5%      97.5%
    +#> parent_0 71.8242430 93.1600766
    +#> k_parent  0.2109541  0.4440528
    +#> sigma     1.9778868  7.3681380
    +
    +# \dontrun{
    +confint(f, method = "profile")
    +#> Profiling the likelihood
    +#>                2.5%      97.5%
    +#> parent_0 73.0641834 92.1392181
    +#> k_parent  0.2170293  0.4235348
    +#> sigma     3.1307772  8.0628314
    +
    +# Set the number of cores for the profiling method for further examples
    +if (identical(Sys.getenv("NOT_CRAN"), "true")) {
    +  n_cores <- parallel::detectCores() - 1
    +} else {
    +  n_cores <- 1
    +}
    +if (Sys.getenv("TRAVIS") != "") n_cores = 1
    +if (Sys.info()["sysname"] == "Windows") n_cores = 1
    +
    +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"),
    +  use_of_ff = "min", quiet = TRUE)
    +SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"),
    +  use_of_ff = "max", quiet = TRUE)
    +f_d_1 <- mkinfit(SFO_SFO, subset(FOCUS_2006_D, value != 0), quiet = TRUE)
    +system.time(ci_profile <- confint(f_d_1, method = "profile", cores = 1, quiet = TRUE))
    +#>    user  system elapsed 
    +#>   3.811   0.004   3.815 
    +# Using more cores does not save much time here, as parent_0 takes up most of the time
    +# If we additionally exclude parent_0 (the confidence of which is often of
    +# minor interest), we get a nice performance improvement if we use at least 4 cores
    +system.time(ci_profile_no_parent_0 <- confint(f_d_1, method = "profile",
    +  c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores))
    +#> Profiling the likelihood
    +#>    user  system elapsed 
    +#>   2.313   0.004   2.318 
    +ci_profile
    +#>                       2.5%        97.5%
    +#> parent_0      96.456003640 1.027703e+02
    +#> k_parent_sink  0.040762501 5.549764e-02
    +#> k_parent_m1    0.046786482 5.500879e-02
    +#> k_m1_sink      0.003892605 6.702778e-03
    +#> sigma          2.535612399 3.985263e+00
    +ci_quadratic_transformed <- confint(f_d_1, method = "quadratic")
    +ci_quadratic_transformed
    +#>                       2.5%        97.5%
    +#> parent_0      96.403841640 1.027931e+02
    +#> k_parent_sink  0.041033378 5.596269e-02
    +#> k_parent_m1    0.046777902 5.511931e-02
    +#> k_m1_sink      0.004012217 6.897547e-03
    +#> sigma          2.396089689 3.854918e+00
    +ci_quadratic_untransformed <- confint(f_d_1, method = "quadratic", transformed = FALSE)
    +ci_quadratic_untransformed
    +#>                       2.5%        97.5%
    +#> parent_0      96.403841645 102.79312449
    +#> k_parent_sink  0.040485331   0.05535491
    +#> k_parent_m1    0.046611582   0.05494364
    +#> k_m1_sink      0.003835483   0.00668582
    +#> sigma          2.396089689   3.85491806
    +# Against the expectation based on Bates and Watts (1988), the confidence
    +# intervals based on the internal parameter transformation are less
    +# congruent with the likelihood based intervals. Note the superiority of the
    +# interval based on the untransformed fit for k_m1_sink
    +rel_diffs_transformed <- abs((ci_quadratic_transformed - ci_profile)/ci_profile)
    +rel_diffs_untransformed <- abs((ci_quadratic_untransformed - ci_profile)/ci_profile)
    +rel_diffs_transformed < rel_diffs_untransformed
    +#>                2.5% 97.5%
    +#> parent_0      FALSE FALSE
    +#> k_parent_sink  TRUE FALSE
    +#> k_parent_m1    TRUE FALSE
    +#> k_m1_sink     FALSE FALSE
    +#> sigma         FALSE FALSE
    +signif(rel_diffs_transformed, 3)
    +#>                   2.5%    97.5%
    +#> parent_0      0.000541 0.000222
    +#> k_parent_sink 0.006650 0.008380
    +#> k_parent_m1   0.000183 0.002010
    +#> k_m1_sink     0.030700 0.029100
    +#> sigma         0.055000 0.032700
    +signif(rel_diffs_untransformed, 3)
    +#>                   2.5%    97.5%
    +#> parent_0      0.000541 0.000222
    +#> k_parent_sink 0.006800 0.002570
    +#> k_parent_m1   0.003740 0.001180
    +#> k_m1_sink     0.014700 0.002530
    +#> sigma         0.055000 0.032700
    +
    +
    +# Investigate a case with formation fractions
    +f_d_2 <- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), quiet = TRUE)
    +ci_profile_ff <- confint(f_d_2, method = "profile", cores = n_cores)
    +#> Profiling the likelihood
    +ci_profile_ff
    +#>                        2.5%        97.5%
    +#> parent_0       96.456003640 1.027703e+02
    +#> k_parent        0.090911032 1.071578e-01
    +#> k_m1            0.003892606 6.702775e-03
    +#> f_parent_to_m1  0.471328495 5.611550e-01
    +#> sigma           2.535612399 3.985263e+00
    +ci_quadratic_transformed_ff <- confint(f_d_2, method = "quadratic")
    +ci_quadratic_transformed_ff
    +#>                        2.5%        97.5%
    +#> parent_0       96.403833578 102.79311649
    +#> k_parent        0.090823771   0.10725430
    +#> k_m1            0.004012219   0.00689755
    +#> f_parent_to_m1  0.469118824   0.55959615
    +#> sigma           2.396089689   3.85491806
    +ci_quadratic_untransformed_ff <- confint(f_d_2, method = "quadratic", transformed = FALSE)
    +ci_quadratic_untransformed_ff
    +#>                        2.5%        97.5%
    +#> parent_0       96.403833583 1.027931e+02
    +#> k_parent        0.090491913 1.069035e-01
    +#> k_m1            0.003835485 6.685823e-03
    +#> f_parent_to_m1  0.469113477 5.598387e-01
    +#> sigma           2.396089689 3.854918e+00
    +rel_diffs_transformed_ff <- abs((ci_quadratic_transformed_ff - ci_profile_ff)/ci_profile_ff)
    +rel_diffs_untransformed_ff <- abs((ci_quadratic_untransformed_ff - ci_profile_ff)/ci_profile_ff)
    +# While the confidence interval for the parent rate constant is closer to
    +# the profile based interval when using the internal parameter
    +# transformation, the interval for the metabolite rate constant is 'better
    +# without internal parameter transformation.
    +rel_diffs_transformed_ff < rel_diffs_untransformed_ff
    +#>                 2.5% 97.5%
    +#> parent_0       FALSE FALSE
    +#> k_parent        TRUE  TRUE
    +#> k_m1           FALSE FALSE
    +#> f_parent_to_m1  TRUE FALSE
    +#> sigma           TRUE FALSE
    +rel_diffs_transformed_ff
    +#>                        2.5%        97.5%
    +#> parent_0       0.0005408690 0.0002217233
    +#> k_parent       0.0009598532 0.0009001864
    +#> k_m1           0.0307283041 0.0290588361
    +#> f_parent_to_m1 0.0046881769 0.0027780063
    +#> sigma          0.0550252516 0.0327066836
    +rel_diffs_untransformed_ff
    +#>                        2.5%        97.5%
    +#> parent_0       0.0005408689 0.0002217232
    +#> k_parent       0.0046102156 0.0023732281
    +#> k_m1           0.0146740690 0.0025291820
    +#> f_parent_to_m1 0.0046995211 0.0023457712
    +#> sigma          0.0550252516 0.0327066836
    +
    +# The profiling for the following fit does not finish in a reasonable time,
    +# therefore we use the quadratic approximation
    +m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")),
    +  M1 = mkinsub("SFO"),
    +  M2 = mkinsub("SFO"),
    +  use_of_ff = "max", quiet = TRUE)
    +DFOP_par_c <- synthetic_data_for_UBA_2014[[12]]$data
    +f_tc_2 <- mkinfit(m_synth_DFOP_par, DFOP_par_c, error_model = "tc",
    +  error_model_algorithm = "direct", quiet = TRUE)
    +confint(f_tc_2, method = "quadratic")
    +#>                        2.5%        97.5%
    +#> parent_0       94.596039609 106.19954892
    +#> k_M1            0.037605368   0.04490762
    +#> k_M2            0.008568731   0.01087676
    +#> f_parent_to_M1  0.021462489   0.62023882
    +#> f_parent_to_M2  0.015165617   0.37975348
    +#> k1              0.273897348   0.33388101
    +#> k2              0.018614554   0.02250378
    +#> g               0.671943411   0.73583305
    +#> sigma_low       0.251283495   0.83992077
    +#> rsd_high        0.040411024   0.07662008
    +confint(f_tc_2, "parent_0", method = "quadratic")
    +#>              2.5%    97.5%
    +#> parent_0 94.59604 106.1995
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/create_deg_func.html b/docs/dev/reference/create_deg_func.html index 5d5870fe..e2a42873 100644 --- a/docs/dev/reference/create_deg_func.html +++ b/docs/dev/reference/create_deg_func.html @@ -17,7 +17,7 @@ mkin - 1.1.2 + 1.2.2 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -125,8 +131,8 @@ replications = 2) #> Loading required package: rbenchmark #> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.401 1.000 0.401 0 0 -#> 2 deSolve 2 0.654 1.631 0.654 0 0 +#> 1 analytical 2 0.458 1.000 0.458 0 0 +#> 2 deSolve 2 0.713 1.557 0.713 0 0 #> sys.child #> 1 0 #> 2 0 @@ -139,8 +145,8 @@ deSolve = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "deSolve", quiet = TRUE), replications = 2) #> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.843 1.000 0.843 0 0 -#> 2 deSolve 2 1.445 1.714 1.445 0 0 +#> 1 analytical 2 0.884 1.000 0.883 0.000 0 +#> 2 deSolve 2 1.526 1.726 1.522 0.004 0 #> sys.child #> 1 0 #> 2 0 diff --git a/docs/dev/reference/dimethenamid_2018-1.png b/docs/dev/reference/dimethenamid_2018-1.png index 4300b0c0..c8b05bf5 100644 Binary files a/docs/dev/reference/dimethenamid_2018-1.png and b/docs/dev/reference/dimethenamid_2018-1.png differ diff --git a/docs/dev/reference/dimethenamid_2018.html b/docs/dev/reference/dimethenamid_2018.html index 2454a609..96ec73c6 100644 --- a/docs/dev/reference/dimethenamid_2018.html +++ b/docs/dev/reference/dimethenamid_2018.html @@ -22,7 +22,7 @@ constrained by data protection regulations."> mkin - 1.1.2 + 1.2.2 @@ -49,11 +49,14 @@ constrained by data protection regulations.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -61,7 +64,10 @@ constrained by data protection regulations.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -180,17 +186,15 @@ specific pieces of information in the comments.

    # influence of ill-defined rate constants that have # extremely small values: plot(mixed(dmta_sfo_sfo3p_tc), test_log_parms = FALSE) - # If we disregards ill-defined rate constants, the results # look more plausible, but the truth is likely to be in # between these variants plot(mixed(dmta_sfo_sfo3p_tc), test_log_parms = TRUE) - + # We can also specify a default value for the failing # log parameters, to mimic FOCUS guidance plot(mixed(dmta_sfo_sfo3p_tc), test_log_parms = TRUE, default_log_parms = log(2)/1000) - # As these attempts are not satisfying, we use nonlinear mixed-effects models # f_dmta_nlme_tc <- nlme(dmta_sfo_sfo3p_tc) # nlme reaches maxIter = 50 without convergence @@ -200,11 +204,11 @@ specific pieces of information in the comments.

    # graphics device used) #saemix::plot(f_dmta_saem_tc$so, plot.type = "convergence") summary(f_dmta_saem_tc) -#> saemix version used for fitting: 3.1 -#> mkin version used for pre-fitting: 1.1.2 -#> R version used for fitting: 4.2.1 -#> Date of fit: Fri Sep 16 10:29:07 2022 -#> Date of summary: Fri Sep 16 10:29:07 2022 +#> saemix version used for fitting: 3.2 +#> mkin version used for pre-fitting: 1.2.2 +#> R version used for fitting: 4.2.2 +#> Date of fit: Thu Nov 24 08:05:16 2022 +#> Date of summary: Thu Nov 24 08:05:16 2022 #> #> Equations: #> d_DMTA/dt = - k_DMTA * DMTA @@ -217,7 +221,7 @@ specific pieces of information in the comments.

    #> #> Model predictions using solution type deSolve #> -#> Fitted in 797.539 s +#> Fitted in 819.725 s #> Using 300, 100 iterations and 9 chains #> #> Variance model: Two-component variance function @@ -235,69 +239,79 @@ specific pieces of information in the comments.

    #> #> Likelihood computed by importance sampling #> AIC BIC logLik -#> 2276 2272 -1120 +#> 2276 2273 -1120 #> #> Optimised parameters: -#> est. lower upper -#> DMTA_0 88.5943 84.3961 92.7925 -#> log_k_DMTA -3.0466 -3.5609 -2.5322 -#> log_k_M23 -4.0684 -4.9340 -3.2029 -#> log_k_M27 -3.8628 -4.2627 -3.4628 -#> log_k_M31 -3.9803 -4.4804 -3.4801 -#> f_DMTA_ilr_1 0.1304 -0.2186 0.4795 -#> f_DMTA_ilr_2 0.1490 -0.2559 0.5540 -#> f_DMTA_ilr_3 -1.3970 -1.6976 -1.0964 +#> est. lower upper +#> DMTA_0 88.3192 83.8656 92.7729 +#> log_k_DMTA -3.0530 -3.5686 -2.5373 +#> log_k_M23 -4.0620 -4.9202 -3.2038 +#> log_k_M27 -3.8633 -4.2668 -3.4598 +#> log_k_M31 -3.9731 -4.4763 -3.4699 +#> f_DMTA_ilr_1 0.1346 -0.2150 0.4841 +#> f_DMTA_ilr_2 0.1449 -0.2593 0.5491 +#> f_DMTA_ilr_3 -1.3882 -1.7011 -1.0753 +#> a.1 0.9156 0.8229 1.0084 +#> b.1 0.1383 0.1215 0.1551 +#> SD.DMTA_0 3.7280 -0.6951 8.1511 +#> SD.log_k_DMTA 0.6431 0.2781 1.0080 +#> SD.log_k_M23 1.0096 0.3782 1.6409 +#> SD.log_k_M27 0.4583 0.1541 0.7625 +#> SD.log_k_M31 0.5738 0.1942 0.9533 +#> SD.f_DMTA_ilr_1 0.4119 0.1528 0.6709 +#> SD.f_DMTA_ilr_2 0.4780 0.1806 0.7754 +#> SD.f_DMTA_ilr_3 0.3657 0.1383 0.5931 #> #> Correlation: #> DMTA_0 l__DMTA lg__M23 lg__M27 lg__M31 f_DMTA__1 f_DMTA__2 -#> log_k_DMTA 0.0309 -#> log_k_M23 -0.0231 -0.0031 -#> log_k_M27 -0.0381 -0.0048 0.0039 -#> log_k_M31 -0.0251 -0.0031 0.0021 0.0830 -#> f_DMTA_ilr_1 -0.0046 -0.0006 0.0417 -0.0437 0.0328 -#> f_DMTA_ilr_2 -0.0008 -0.0002 0.0214 -0.0270 -0.0909 -0.0361 -#> f_DMTA_ilr_3 -0.1832 -0.0135 0.0434 0.0804 0.0395 -0.0070 0.0059 +#> log_k_DMTA 0.0303 +#> log_k_M23 -0.0229 -0.0032 +#> log_k_M27 -0.0372 -0.0049 0.0041 +#> log_k_M31 -0.0245 -0.0032 0.0022 0.0815 +#> f_DMTA_ilr_1 -0.0046 -0.0006 0.0415 -0.0433 0.0324 +#> f_DMTA_ilr_2 -0.0008 -0.0002 0.0214 -0.0267 -0.0893 -0.0361 +#> f_DMTA_ilr_3 -0.1755 -0.0135 0.0423 0.0775 0.0377 -0.0066 0.0060 #> #> Random effects: #> est. lower upper -#> SD.DMTA_0 3.3651 -0.9649 7.6951 -#> SD.log_k_DMTA 0.6415 0.2774 1.0055 -#> SD.log_k_M23 1.0176 0.3809 1.6543 -#> SD.log_k_M27 0.4538 0.1522 0.7554 -#> SD.log_k_M31 0.5684 0.1905 0.9464 -#> SD.f_DMTA_ilr_1 0.4111 0.1524 0.6699 -#> SD.f_DMTA_ilr_2 0.4788 0.1808 0.7768 -#> SD.f_DMTA_ilr_3 0.3501 0.1316 0.5685 +#> SD.DMTA_0 3.7280 -0.6951 8.1511 +#> SD.log_k_DMTA 0.6431 0.2781 1.0080 +#> SD.log_k_M23 1.0096 0.3782 1.6409 +#> SD.log_k_M27 0.4583 0.1541 0.7625 +#> SD.log_k_M31 0.5738 0.1942 0.9533 +#> SD.f_DMTA_ilr_1 0.4119 0.1528 0.6709 +#> SD.f_DMTA_ilr_2 0.4780 0.1806 0.7754 +#> SD.f_DMTA_ilr_3 0.3657 0.1383 0.5931 #> #> Variance model: -#> est. lower upper -#> a.1 0.9349 0.8409 1.029 -#> b.1 0.1344 0.1178 0.151 +#> est. lower upper +#> a.1 0.9156 0.8229 1.0084 +#> b.1 0.1383 0.1215 0.1551 #> #> Backtransformed parameters: #> est. lower upper -#> DMTA_0 88.59431 84.396147 92.79246 -#> k_DMTA 0.04752 0.028413 0.07948 -#> k_M23 0.01710 0.007198 0.04064 -#> k_M27 0.02101 0.014084 0.03134 -#> k_M31 0.01868 0.011329 0.03080 -#> f_DMTA_to_M23 0.14498 NA NA -#> f_DMTA_to_M27 0.12056 NA NA -#> f_DMTA_to_M31 0.11015 NA NA +#> DMTA_0 88.31924 83.865625 92.77286 +#> k_DMTA 0.04722 0.028196 0.07908 +#> k_M23 0.01721 0.007298 0.04061 +#> k_M27 0.02100 0.014027 0.03144 +#> k_M31 0.01882 0.011375 0.03112 +#> f_DMTA_to_M23 0.14608 NA NA +#> f_DMTA_to_M27 0.12077 NA NA +#> f_DMTA_to_M31 0.11123 NA NA #> #> Resulting formation fractions: #> ff -#> DMTA_M23 0.1450 -#> DMTA_M27 0.1206 -#> DMTA_M31 0.1101 -#> DMTA_sink 0.6243 +#> DMTA_M23 0.1461 +#> DMTA_M27 0.1208 +#> DMTA_M31 0.1112 +#> DMTA_sink 0.6219 #> #> Estimated disappearance times: #> DT50 DT90 -#> DMTA 14.59 48.45 -#> M23 40.52 134.62 -#> M27 32.99 109.60 -#> M31 37.11 123.26 +#> DMTA 14.68 48.76 +#> M23 40.27 133.76 +#> M27 33.01 109.65 +#> M31 36.84 122.38 # As the confidence interval for the random effects of DMTA_0 # includes zero, we could try an alternative model without # such random effects diff --git a/docs/dev/reference/ds_mixed-1.png b/docs/dev/reference/ds_mixed-1.png new file mode 100644 index 00000000..a7f5c395 Binary files /dev/null and b/docs/dev/reference/ds_mixed-1.png differ diff --git a/docs/dev/reference/ds_mixed.html b/docs/dev/reference/ds_mixed.html new file mode 100644 index 00000000..09a6cc8c --- /dev/null +++ b/docs/dev/reference/ds_mixed.html @@ -0,0 +1,240 @@ + +Synthetic data for hierarchical kinetic degradation models — ds_mixed • mkin + + +
    +
    + + + +
    +
    + + +
    +

    The R code used to create this data object is installed with this package in +the 'dataset_generation' directory.

    +
    + + + +
    +

    Examples

    +
    # \dontrun{
    +  sfo_mmkin <- mmkin("SFO", ds_sfo, quiet = TRUE, error_model = "tc", cores = 15)
    +  sfo_saem <- saem(sfo_mmkin, no_random_effect = "parent_0")
    +  plot(sfo_saem)
    +
    +# }
    +
    +# This is the code used to generate the datasets
    +cat(readLines(system.file("dataset_generation/ds_mixed.R", package = "mkin")), sep = "\n")
    +#> # Synthetic data for hierarchical kinetic models
    +#> # Refactored version of the code previously in tests/testthat/setup_script.R
    +#> # The number of datasets was 3 for FOMC, and 10 for HS in that script, now it
    +#> # is always 15 for consistency
    +#> 
    +#> library(mkin)  # We use mkinmod and mkinpredict
    +#> sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +#> n <- 15
    +#> log_sd <- 0.3
    +#> err_1 = list(const = 1, prop = 0.05)
    +#> tc <- function(value) sigma_twocomp(value, err_1$const, err_1$prop)
    +#> const <- function(value) 2
    +#> 
    +#> set.seed(123456)
    +#> SFO <- mkinmod(parent = mkinsub("SFO"))
    +#> sfo_pop <- list(parent_0 = 100, k_parent = 0.03)
    +#> sfo_parms <- as.matrix(data.frame(
    +#>     k_parent = rlnorm(n, log(sfo_pop$k_parent), log_sd)))
    +#> set.seed(123456)
    +#> ds_sfo <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(SFO, sfo_parms[i, ],
    +#>     c(parent = sfo_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_sfo, "pop") <- sfo_pop
    +#> attr(ds_sfo, "parms") <- sfo_parms
    +#> 
    +#> set.seed(123456)
    +#> FOMC <- mkinmod(parent = mkinsub("FOMC"))
    +#> fomc_pop <- list(parent_0 = 100, alpha = 2, beta = 8)
    +#> fomc_parms <- as.matrix(data.frame(
    +#>     alpha = rlnorm(n, log(fomc_pop$alpha), 0.4),
    +#>     beta = rlnorm(n, log(fomc_pop$beta), 0.2)))
    +#> set.seed(123456)
    +#> ds_fomc <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(FOMC, fomc_parms[i, ],
    +#>     c(parent = fomc_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_fomc, "pop") <- fomc_pop
    +#> attr(ds_fomc, "parms") <- fomc_parms
    +#> 
    +#> set.seed(123456)
    +#> DFOP <- mkinmod(parent = mkinsub("DFOP"))
    +#> dfop_pop <- list(parent_0 = 100, k1 = 0.06, k2 = 0.015, g = 0.4)
    +#> dfop_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(dfop_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(dfop_pop$k2), log_sd),
    +#>   g = plogis(rnorm(n, qlogis(dfop_pop$g), log_sd))))
    +#> set.seed(123456)
    +#> ds_dfop <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(DFOP, dfop_parms[i, ],
    +#>     c(parent = dfop_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, tc, n = 1)[[1]]
    +#> })
    +#> attr(ds_dfop, "pop") <- dfop_pop
    +#> attr(ds_dfop, "parms") <- dfop_parms
    +#> 
    +#> set.seed(123456)
    +#> HS <- mkinmod(parent = mkinsub("HS"))
    +#> hs_pop <- list(parent_0 = 100, k1 = 0.08, k2 = 0.01, tb = 15)
    +#> hs_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(hs_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(hs_pop$k2), log_sd),
    +#>   tb = rlnorm(n, log(hs_pop$tb), 0.1)))
    +#> set.seed(123456)
    +#> ds_hs <- lapply(1:n, function(i) {
    +#>   ds_mean <- mkinpredict(HS, hs_parms[i, ],
    +#>     c(parent = hs_pop$parent_0), sampling_times)
    +#>   add_err(ds_mean, const, n = 1)[[1]]
    +#> })
    +#> attr(ds_hs, "pop") <- hs_pop
    +#> attr(ds_hs, "parms") <- hs_parms
    +#> 
    +#> set.seed(123456)
    +#> DFOP_SFO <- mkinmod(
    +#>   parent = mkinsub("DFOP", "m1"),
    +#>   m1 = mkinsub("SFO"),
    +#>   quiet = TRUE)
    +#> dfop_sfo_pop <- list(parent_0 = 100,
    +#>   k_m1 = 0.007, f_parent_to_m1 = 0.5,
    +#>   k1 = 0.1, k2 = 0.02, g = 0.5)
    +#> dfop_sfo_parms <- as.matrix(data.frame(
    +#>   k1 = rlnorm(n, log(dfop_sfo_pop$k1), log_sd),
    +#>   k2 = rlnorm(n, log(dfop_sfo_pop$k2), log_sd),
    +#>   g = plogis(rnorm(n, qlogis(dfop_sfo_pop$g), log_sd)),
    +#>   f_parent_to_m1 = plogis(rnorm(n,
    +#>       qlogis(dfop_sfo_pop$f_parent_to_m1), log_sd)),
    +#>   k_m1 = rlnorm(n, log(dfop_sfo_pop$k_m1), log_sd)))
    +#> ds_dfop_sfo_mean <- lapply(1:n,
    +#>   function(i) {
    +#>     mkinpredict(DFOP_SFO, dfop_sfo_parms[i, ],
    +#>       c(parent = dfop_sfo_pop$parent_0, m1 = 0), sampling_times)
    +#>   }
    +#> )
    +#> set.seed(123456)
    +#> ds_dfop_sfo <- lapply(ds_dfop_sfo_mean, function(ds) {
    +#>   add_err(ds,
    +#>     sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2),
    +#>     n = 1, secondary = "m1")[[1]]
    +#> })
    +#> attr(ds_dfop_sfo, "pop") <- dfop_sfo_pop
    +#> attr(ds_dfop_sfo, "parms") <- dfop_sfo_parms
    +#> 
    +#> #save(ds_sfo, ds_fomc, ds_dfop, ds_hs, ds_dfop_sfo, file = "data/ds_mixed.rda", version = 2)
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/dev/reference/endpoints.html b/docs/dev/reference/endpoints.html index e8198521..f8064098 100644 --- a/docs/dev/reference/endpoints.html +++ b/docs/dev/reference/endpoints.html @@ -23,7 +23,7 @@ advantage that the SFORB model can also be used for metabolites."> mkin - 1.2.0 + 1.2.2 @@ -65,7 +65,10 @@ advantage that the SFORB model can also be used for metabolites.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/experimental_data_for_UBA-1.png b/docs/dev/reference/experimental_data_for_UBA-1.png index 33946ded..b7b4d63b 100644 Binary files a/docs/dev/reference/experimental_data_for_UBA-1.png and b/docs/dev/reference/experimental_data_for_UBA-1.png differ diff --git a/docs/dev/reference/experimental_data_for_UBA.html b/docs/dev/reference/experimental_data_for_UBA.html index 9904370f..a51ace27 100644 --- a/docs/dev/reference/experimental_data_for_UBA.html +++ b/docs/dev/reference/experimental_data_for_UBA.html @@ -1,46 +1,5 @@ - - - - - - - -Experimental datasets used for development and testing of error models — experimental_data_for_UBA_2019 • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Experimental datasets used for development and testing of error models — experimental_data_for_UBA_2019 • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    experimental_data_for_UBA_2019
    +
    +
    experimental_data_for_UBA_2019
    +
    +
    +

    Format

    +

    A list containing twelve datasets as an R6 class defined by mkinds, + each containing, among others, the following components

    title
    +

    The name of the dataset, e.g. Soil 1

    -

    Format

    +
    data
    +

    A data frame with the data in the form expected by mkinfit

    -

    A list containing twelve datasets as an R6 class defined by mkinds, - each containing, among others, the following components

    -
    title

    The name of the dataset, e.g. Soil 1

    -
    data

    A data frame with the data in the form expected by mkinfit

    -
    - -

    Source

    - +
    +
    +

    Source

    Austria (2015). Ethofumesate Renewal Assessment Report Volume 3 Annex B.8 (AS)

    Belgium (2014). Isofetamid (IKF-5411) Draft Assessment Report Volume 3 Annex B.8 (AS)

    France (2015). Imazamox Draft Renewal Assessment Report Volume 3 Annex B.8 (AS)

    -

    FOCUS (2014) “Generic guidance for Estimating Persistence and +

    FOCUS (2014) “Generic guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, Version 1.1, 18 December 2014 - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    + http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    Germany (2013). Renewal Assessment Report Glyphosate Volume 3 Annex B.8: Environmental Fate and Behaviour

    Hellas (2013). Renewal Assessment Report 2,4-D Volume 3 Annex B.8: Fate and behaviour in the @@ -236,70 +184,75 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl

    United Kingdom (2014). Thifensulfuron-methyl - Annex B.8 (Volume 3) to the Report and Proposed Decision of the United Kingdom made to the European Commission under Regulation (EC) No. 1141/2010 for renewal of an active substance

    +
    -

    Examples

    -
    # \dontrun{ - -# Model definitions -sfo_sfo <- mkinmod( - parent = mkinsub("SFO", to = "A1"), - A1 = mkinsub("SFO"), - use_of_ff = "max" -) -
    #> Temporary DLL for differentials generated and loaded
    -dfop_sfo <- mkinmod( - parent = mkinsub("DFOP", to = "A1"), - A1 = mkinsub("SFO"), - use_of_ff = "max" -) -
    #> Temporary DLL for differentials generated and loaded
    -sfo_sfo_sfo <- mkinmod( - parent = mkinsub("SFO", to = "A1"), - A1 = mkinsub("SFO", to = "A2"), - A2 = mkinsub("SFO"), - use_of_ff = "max" -) -
    #> Temporary DLL for differentials generated and loaded
    -dfop_sfo_sfo <- mkinmod( - parent = mkinsub("DFOP", to = "A1"), - A1 = mkinsub("SFO", to = "A2"), - A2 = mkinsub("SFO"), - use_of_ff = "max" -) -
    #> Temporary DLL for differentials generated and loaded
    d_1_2 <- lapply(experimental_data_for_UBA_2019[1:2], function(x) x$data) -names(d_1_2) <- paste("Soil", 1:2) - - -f_1_2_tc <- mmkin(list("DFOP-SFO-SFO" = dfop_sfo_sfo), d_1_2, error_model = "tc") - -plot(f_1_2_tc, resplot = "errmod") -
    -# }
    +
    +

    Examples

    +
    # \dontrun{
    +
    +# Model definitions
    +sfo_sfo <- mkinmod(
    +  parent = mkinsub("SFO", to = "A1"),
    +  A1 = mkinsub("SFO"),
    +  use_of_ff = "max"
    +)
    +#> Temporary DLL for differentials generated and loaded
    +
    +dfop_sfo <- mkinmod(
    +  parent = mkinsub("DFOP", to = "A1"),
    +  A1 = mkinsub("SFO"),
    +  use_of_ff = "max"
    +)
    +#> Temporary DLL for differentials generated and loaded
    +
    +sfo_sfo_sfo <- mkinmod(
    +  parent = mkinsub("SFO", to = "A1"),
    +  A1 = mkinsub("SFO", to = "A2"),
    +  A2 = mkinsub("SFO"),
    +  use_of_ff = "max"
    +)
    +#> Temporary DLL for differentials generated and loaded
    +
    +dfop_sfo_sfo <- mkinmod(
    +  parent = mkinsub("DFOP", to = "A1"),
    +  A1 = mkinsub("SFO", to = "A2"),
    +  A2 = mkinsub("SFO"),
    +  use_of_ff = "max"
    +)
    +#> Temporary DLL for differentials generated and loaded
    +d_1_2 <- lapply(experimental_data_for_UBA_2019[1:2], function(x) x$data)
    +names(d_1_2) <- paste("Soil", 1:2)
    +
    +
    +f_1_2_tc <- mmkin(list("DFOP-SFO-SFO" = dfop_sfo_sfo), d_1_2, error_model = "tc")
    +
    +plot(f_1_2_tc, resplot = "errmod")
    +
    +
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/f_time_norm_focus.html b/docs/dev/reference/f_time_norm_focus.html index 852e00a0..b556df04 100644 --- a/docs/dev/reference/f_time_norm_focus.html +++ b/docs/dev/reference/f_time_norm_focus.html @@ -1,68 +1,13 @@ - - - - - - - -Normalisation factors for aerobic soil degradation according to FOCUS guidance — f_time_norm_focus • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Normalisation factors for aerobic soil degradation according to FOCUS guidance — f_time_norm_focus • mkin - + + - - - -
    -
    - -
    - -
    +
    @@ -149,137 +94,138 @@ in Appendix 8 to the FOCUS kinetics guidance (FOCUS 2014, p. 369)." /> in Appendix 8 to the FOCUS kinetics guidance (FOCUS 2014, p. 369).

    -
    f_time_norm_focus(object, ...)
    -
    -# S3 method for numeric
    -f_time_norm_focus(
    -  object,
    -  moisture = NA,
    -  field_moisture = NA,
    -  temperature = object,
    -  Q10 = 2.58,
    -  walker = 0.7,
    -  f_na = NA,
    -  ...
    -)
    -
    -# S3 method for mkindsg
    -f_time_norm_focus(
    -  object,
    -  study_moisture_ref_source = c("auto", "meta", "focus"),
    -  Q10 = 2.58,
    -  walker = 0.7,
    -  f_na = NA,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    object

    An object containing information used for the calculations

    ...

    Currently not used

    moisture

    Numeric vector of moisture contents in \% w/w

    field_moisture

    Numeric vector of moisture contents at field capacity -(pF2) in \% w/w

    temperature

    Numeric vector of temperatures in °C

    Q10

    The Q10 value used for temperature normalisation

    walker

    The Walker exponent used for moisture normalisation

    f_na

    The factor to use for NA values. If set to NA, only factors -for complete cases will be returned.

    study_moisture_ref_source

    Source for the reference value +

    +
    f_time_norm_focus(object, ...)
    +
    +# S3 method for numeric
    +f_time_norm_focus(
    +  object,
    +  moisture = NA,
    +  field_moisture = NA,
    +  temperature = object,
    +  Q10 = 2.58,
    +  walker = 0.7,
    +  f_na = NA,
    +  ...
    +)
    +
    +# S3 method for mkindsg
    +f_time_norm_focus(
    +  object,
    +  study_moisture_ref_source = c("auto", "meta", "focus"),
    +  Q10 = 2.58,
    +  walker = 0.7,
    +  f_na = NA,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    An object containing information used for the calculations

    + + +
    ...
    +

    Currently not used

    + + +
    moisture
    +

    Numeric vector of moisture contents in \% w/w

    + + +
    field_moisture
    +

    Numeric vector of moisture contents at field capacity +(pF2) in \% w/w

    + + +
    temperature
    +

    Numeric vector of temperatures in °C

    + + +
    Q10
    +

    The Q10 value used for temperature normalisation

    + + +
    walker
    +

    The Walker exponent used for moisture normalisation

    + + +
    f_na
    +

    The factor to use for NA values. If set to NA, only factors +for complete cases will be returned.

    + + +
    study_moisture_ref_source
    +

    Source for the reference value used to calculate the study moisture. If 'auto', preference is given to a reference moisture given in the meta information, otherwise -the focus soil moisture for the soil class is used

    +the focus soil moisture for the soil class is used

    -

    References

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence +

    +
    +

    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, +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics -FOCUS (2014) “Generic guidance for Estimating Persistence +http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics +FOCUS (2014) “Generic guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in -EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, Version 1.1, 18 December 2014 -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    -

    See also

    - - - -

    Examples

    -
    f_time_norm_focus(25, 20, 25) # 1.37, compare FOCUS 2014 p. 184 -
    #> [1] 1.373956
    -D24_2014$meta -
    #> study usda_soil_type study_moisture_ref_type -#> Mississippi Cohen 1991 Silt loam <NA> -#> Fayette Liu and Adelfinskaya 2011 Silt loam pF1 -#> RefSol 03-G Liu and Adelfinskaya 2011 Loam pF1 -#> Site E1 Liu and Adelfinskaya 2011 Loam pF1 -#> Site I2 Liu and Adelfinskaya 2011 Loamy sand pF1 -#> rel_moisture temperature -#> Mississippi NA 25 -#> Fayette 0.5 20 -#> RefSol 03-G 0.5 20 -#> Site E1 0.5 20 -#> Site I2 0.5 20
    # No moisture normalisation in the first dataset, so we use f_na = 1 to get -# temperature only normalisation as in the EU evaluation -f_time_norm_focus(D24_2014, study_moisture_ref_source = "focus", f_na = 1) -
    #> $time_norm was set to -#> [1] 1.6062378 0.7118732 0.7156063 0.7156063 0.8977124
    +http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    f_time_norm_focus(25, 20, 25) # 1.37, compare FOCUS 2014 p. 184
    +#> [1] 1.373956
    +
    +D24_2014$meta
    +#>                                 study usda_soil_type study_moisture_ref_type
    +#> Mississippi                Cohen 1991      Silt loam                    <NA>
    +#> Fayette     Liu and Adelfinskaya 2011      Silt loam                     pF1
    +#> RefSol 03-G Liu and Adelfinskaya 2011           Loam                     pF1
    +#> Site E1     Liu and Adelfinskaya 2011           Loam                     pF1
    +#> Site I2     Liu and Adelfinskaya 2011     Loamy sand                     pF1
    +#>             rel_moisture temperature
    +#> Mississippi           NA          25
    +#> Fayette              0.5          20
    +#> RefSol 03-G          0.5          20
    +#> Site E1              0.5          20
    +#> Site I2              0.5          20
    +# No moisture normalisation in the first dataset, so we use f_na = 1 to get
    +# temperature only normalisation as in the EU evaluation
    +f_time_norm_focus(D24_2014, study_moisture_ref_source = "focus", f_na = 1)
    +#> $f_time_norm was (re)set to normalised values
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/focus_soil_moisture.html b/docs/dev/reference/focus_soil_moisture.html index 0e6fea28..99b4735a 100644 --- a/docs/dev/reference/focus_soil_moisture.html +++ b/docs/dev/reference/focus_soil_moisture.html @@ -1,68 +1,13 @@ - - - - - - - -FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar — focus_soil_moisture • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar — focus_soil_moisture • mkin - - + + - - -
    -
    - -
    - -
    +
    @@ -149,58 +94,60 @@ corresponds to pF2, MWHC to pF 1 and 1/3 bar to pF 2.5." /> corresponds to pF2, MWHC to pF 1 and 1/3 bar to pF 2.5.

    -
    focus_soil_moisture
    - - -

    Format

    +
    +
    focus_soil_moisture
    +
    +
    +

    Format

    A matrix with upper case USDA soil classes as row names, and water tension ('pF1', 'pF2', 'pF 2.5') as column names

    -

    Source

    - +
    +
    +

    Source

    Anonymous (2014) Generic Guidance for Tier 1 FOCUS Ground Water Assessment -Version 2.2, May 2014 https://esdac.jrc.ec.europa.eu/projects/ground-water

    - -

    Examples

    -
    focus_soil_moisture -
    #> pF1 pF2 pF2.5 -#> Sand 24 12 7 -#> Loamy sand 24 14 9 -#> Sandy loam 27 19 15 -#> Sandy clay loam 28 22 18 -#> Clay loam 32 28 25 -#> Loam 31 25 21 -#> Silt loam 32 26 21 -#> Silty clay loam 34 30 27 -#> Silt 31 27 21 -#> Sandy clay 41 35 31 -#> Silty clay 44 40 36 -#> Clay 53 48 43
    +Version 2.2, May 2014 https://esdac.jrc.ec.europa.eu/projects/ground-water

    +
    + +
    +

    Examples

    +
    focus_soil_moisture
    +#>                 pF1 pF2 pF2.5
    +#> Sand             24  12     7
    +#> Loamy sand       24  14     9
    +#> Sandy loam       27  19    15
    +#> Sandy clay loam  28  22    18
    +#> Clay loam        32  28    25
    +#> Loam             31  25    21
    +#> Silt loam        32  26    21
    +#> Silty clay loam  34  30    27
    +#> Silt             31  27    21
    +#> Sandy clay       41  35    31
    +#> Silty clay       44  40    36
    +#> Clay             53  48    43
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/get_deg_func.html b/docs/dev/reference/get_deg_func.html index fb661085..a5a77f37 100644 --- a/docs/dev/reference/get_deg_func.html +++ b/docs/dev/reference/get_deg_func.html @@ -1,67 +1,12 @@ - - - - - - - -Retrieve a degradation function from the mmkin namespace — get_deg_func • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Retrieve a degradation function from the mmkin namespace — get_deg_func • mkin - + + - - - -
    -
    - -
    - -
    +
    @@ -147,39 +92,39 @@

    Retrieve a degradation function from the mmkin namespace

    -
    get_deg_func()
    - +
    +
    get_deg_func()
    +
    -

    Value

    +
    +

    Value

    + -

    A function that was likely previously assigned from within +

    A function that was likely previously assigned from within nlme.mmkin

    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/illparms.html b/docs/dev/reference/illparms.html index c0de4115..8fe71568 100644 --- a/docs/dev/reference/illparms.html +++ b/docs/dev/reference/illparms.html @@ -21,7 +21,7 @@ without parameter transformations is used."> mkin - 1.2.0 + 1.2.2 @@ -63,7 +63,10 @@ without parameter transformations is used.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/ilr.html b/docs/dev/reference/ilr.html index 452647d6..c1396303 100644 --- a/docs/dev/reference/ilr.html +++ b/docs/dev/reference/ilr.html @@ -1,68 +1,13 @@ - - - - - - - -Function to perform isometric log-ratio transformation — ilr • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to perform isometric log-ratio transformation — ilr • mkin + + - - - - -
    -
    - -
    - -
    +
    @@ -149,86 +94,100 @@ transformations." /> transformations.

    -
    ilr(x)
    -
    -invilr(x)
    +
    +
    ilr(x)
    +
    +invilr(x)
    +
    -

    Arguments

    - - - - - - -
    x

    A numeric vector. Naturally, the forward transformation is only -sensible for vectors with all elements being greater than zero.

    +
    +

    Arguments

    +
    x
    +

    A numeric vector. Naturally, the forward transformation is only +sensible for vectors with all elements being greater than zero.

    -

    Value

    +
    +
    +

    Value

    + -

    The result of the forward or backward transformation. The returned +

    The result of the forward or backward transformation. The returned components always sum to 1 for the case of the inverse log-ratio transformation.

    -

    References

    - +
    +
    +

    References

    Peter Filzmoser, Karel Hron (2008) Outlier Detection for Compositional Data Using Robust Methods. Math Geosci 40 233-248

    -

    See also

    - -

    Another implementation can be found in R package +

    +
    +

    See also

    +

    Another implementation can be found in R package robCompositions.

    -

    Author

    - +
    +
    +

    Author

    René Lehmann and Johannes Ranke

    +
    -

    Examples

    -
    -# Order matters -ilr(c(0.1, 1, 10)) -
    #> [1] -1.628174 -2.820079
    ilr(c(10, 1, 0.1)) -
    #> [1] 1.628174 2.820079
    # Equal entries give ilr transformations with zeros as elements -ilr(c(3, 3, 3)) -
    #> [1] 0 0
    # Almost equal entries give small numbers -ilr(c(0.3, 0.4, 0.3)) -
    #> [1] -0.2034219 0.1174457
    # Only the ratio between the numbers counts, not their sum -invilr(ilr(c(0.7, 0.29, 0.01))) -
    #> [1] 0.70 0.29 0.01
    invilr(ilr(2.1 * c(0.7, 0.29, 0.01))) -
    #> [1] 0.70 0.29 0.01
    # Inverse transformation of larger numbers gives unequal elements -invilr(-10) -
    #> [1] 7.213536e-07 9.999993e-01
    invilr(c(-10, 0)) -
    #> [1] 7.207415e-07 9.991507e-01 8.486044e-04
    # The sum of the elements of the inverse ilr is 1 -sum(invilr(c(-10, 0))) -
    #> [1] 1
    # This is why we do not need all elements of the inverse transformation to go back: -a <- c(0.1, 0.3, 0.5) -b <- invilr(a) -length(b) # Four elements -
    #> [1] 4
    ilr(c(b[1:3], 1 - sum(b[1:3]))) # Gives c(0.1, 0.3, 0.5) -
    #> [1] 0.1 0.3 0.5
    -
    +
    +

    Examples

    +
    
    +# Order matters
    +ilr(c(0.1, 1, 10))
    +#> [1] -1.628174 -2.820079
    +ilr(c(10, 1, 0.1))
    +#> [1] 1.628174 2.820079
    +# Equal entries give ilr transformations with zeros as elements
    +ilr(c(3, 3, 3))
    +#> [1] 0 0
    +# Almost equal entries give small numbers
    +ilr(c(0.3, 0.4, 0.3))
    +#> [1] -0.2034219  0.1174457
    +# Only the ratio between the numbers counts, not their sum
    +invilr(ilr(c(0.7, 0.29, 0.01)))
    +#> [1] 0.70 0.29 0.01
    +invilr(ilr(2.1 * c(0.7, 0.29, 0.01)))
    +#> [1] 0.70 0.29 0.01
    +# Inverse transformation of larger numbers gives unequal elements
    +invilr(-10)
    +#> [1] 7.213536e-07 9.999993e-01
    +invilr(c(-10, 0))
    +#> [1] 7.207415e-07 9.991507e-01 8.486044e-04
    +# The sum of the elements of the inverse ilr is 1
    +sum(invilr(c(-10, 0)))
    +#> [1] 1
    +# This is why we do not need all elements of the inverse transformation to go back:
    +a <- c(0.1, 0.3, 0.5)
    +b <- invilr(a)
    +length(b) # Four elements
    +#> [1] 4
    +ilr(c(b[1:3], 1 - sum(b[1:3]))) # Gives c(0.1, 0.3, 0.5)
    +#> [1] 0.1 0.3 0.5
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/index.html b/docs/dev/reference/index.html index 5a0ec596..794126cf 100644 --- a/docs/dev/reference/index.html +++ b/docs/dev/reference/index.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2 @@ -268,9 +268,9 @@ degradation models and one or more error models

    -

    focus_soil_moisture

    +

    ds_mixed ds_sfo ds_fomc ds_dfop ds_hs ds_dfop_sfo

    -

    FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar

    +

    Synthetic data for hierarchical kinetic degradation models

    D24_2014

    @@ -327,6 +327,10 @@ degradation models and one or more error models

    test_data_from_UBA_2014

    Three experimental datasets from two water sediment systems and one soil

    + +

    focus_soil_moisture

    + +

    FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar

    print(<mkinds>)

    diff --git a/docs/dev/reference/intervals.saem.mmkin.html b/docs/dev/reference/intervals.saem.mmkin.html index ee714ad0..e67d8da0 100644 --- a/docs/dev/reference/intervals.saem.mmkin.html +++ b/docs/dev/reference/intervals.saem.mmkin.html @@ -17,7 +17,7 @@ mkin - 1.1.2 + 1.2.2 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/llhist.html b/docs/dev/reference/llhist.html index 314cb923..27e55455 100644 --- a/docs/dev/reference/llhist.html +++ b/docs/dev/reference/llhist.html @@ -18,7 +18,7 @@ original fit is shown as a red vertical line."> mkin - 1.2.0 + 1.2.2 @@ -60,7 +60,10 @@ original fit is shown as a red vertical line.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/loftest-1.png b/docs/dev/reference/loftest-1.png index d6006ecc..f1dc5fa7 100644 Binary files a/docs/dev/reference/loftest-1.png and b/docs/dev/reference/loftest-1.png differ diff --git a/docs/dev/reference/loftest-2.png b/docs/dev/reference/loftest-2.png index 4d0dc551..3f1015a9 100644 Binary files a/docs/dev/reference/loftest-2.png and b/docs/dev/reference/loftest-2.png differ diff --git a/docs/dev/reference/loftest-3.png b/docs/dev/reference/loftest-3.png index 6afd084b..d897c363 100644 Binary files a/docs/dev/reference/loftest-3.png and b/docs/dev/reference/loftest-3.png differ diff --git a/docs/dev/reference/loftest-4.png b/docs/dev/reference/loftest-4.png index f94eede1..ac44c162 100644 Binary files a/docs/dev/reference/loftest-4.png and b/docs/dev/reference/loftest-4.png differ diff --git a/docs/dev/reference/loftest-5.png b/docs/dev/reference/loftest-5.png index 43460a65..0847bbec 100644 Binary files a/docs/dev/reference/loftest-5.png and b/docs/dev/reference/loftest-5.png differ diff --git a/docs/dev/reference/loftest.html b/docs/dev/reference/loftest.html index 9dbd547d..57bd3ee5 100644 --- a/docs/dev/reference/loftest.html +++ b/docs/dev/reference/loftest.html @@ -1,70 +1,15 @@ - - - - - - - -Lack-of-fit test for models fitted to data with replicates — loftest • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Lack-of-fit test for models fitted to data with replicates — loftest • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -150,216 +95,231 @@ lrtest.default from the lmtest package." />

    This is a generic function with a method currently only defined for mkinfit objects. It fits an anova model to the data contained in the object and compares the likelihoods using the likelihood ratio test -lrtest.default from the lmtest package.

    +lrtest.default from the lmtest package.

    -
    loftest(object, ...)
    +    
    +
    loftest(object, ...)
    +
    +# S3 method for mkinfit
    +loftest(object, ...)
    +
    -# S3 method for mkinfit -loftest(object, ...)
    +
    +

    Arguments

    +
    object
    +

    A model object with a defined loftest method

    -

    Arguments

    - - - - - - - - - - -
    object

    A model object with a defined loftest method

    ...

    Not used

    -

    Details

    +
    ...
    +

    Not used

    +
    +
    +

    Details

    The anova model is interpreted as the simplest form of an mkinfit model, assuming only a constant variance about the means, but not enforcing any structure of the means, so we have one model parameter for every mean of replicate samples.

    -

    See also

    - -

    lrtest

    +
    +
    +

    See also

    +

    lrtest

    +
    -

    Examples

    -
    # \dontrun{ -test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent") -sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE) -plot_res(sfo_fit) # We see a clear pattern in the residuals -
    loftest(sfo_fit) # We have a clear lack of fit -
    #> Likelihood ratio test -#> -#> Model 1: ANOVA with error model const -#> Model 2: SFO with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 10 -40.710 -#> 2 3 -63.954 -7 46.487 7.027e-08 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    # -# We try a different model (the one that was used to generate the data) -dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE) -plot_res(dfop_fit) # We don't see systematic deviations, but heteroscedastic residuals -
    # therefore we should consider adapting the error model, although we have -loftest(dfop_fit) # no lack of fit -
    #> Likelihood ratio test -#> -#> Model 1: ANOVA with error model const -#> Model 2: DFOP with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 10 -40.710 -#> 2 5 -42.453 -5 3.485 0.6257
    # -# This is the anova model used internally for the comparison -test_data_anova <- test_data -test_data_anova$time <- as.factor(test_data_anova$time) -anova_fit <- lm(value ~ time, data = test_data_anova) -summary(anova_fit) -
    #> -#> Call: -#> lm(formula = value ~ time, data = test_data_anova) -#> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -6.1000 -0.5625 0.0000 0.5625 6.1000 -#> -#> Coefficients: -#> Estimate Std. Error t value Pr(>|t|) -#> (Intercept) 103.150 2.323 44.409 7.44e-12 *** -#> time1 -19.950 3.285 -6.073 0.000185 *** -#> time3 -50.800 3.285 -15.465 8.65e-08 *** -#> time7 -68.500 3.285 -20.854 6.28e-09 *** -#> time14 -79.750 3.285 -24.278 1.63e-09 *** -#> time28 -86.000 3.285 -26.181 8.35e-10 *** -#> time60 -94.900 3.285 -28.891 3.48e-10 *** -#> time90 -98.500 3.285 -29.986 2.49e-10 *** -#> time120 -100.450 3.285 -30.580 2.09e-10 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 3.285 on 9 degrees of freedom -#> Multiple R-squared: 0.9953, Adjusted R-squared: 0.9912 -#> F-statistic: 240.5 on 8 and 9 DF, p-value: 1.417e-09 -#>
    logLik(anova_fit) # We get the same likelihood and degrees of freedom -
    #> 'log Lik.' -40.71015 (df=10)
    # -test_data_2 <- synthetic_data_for_UBA_2014[[12]]$data -m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"), - M1 = list(type = "SFO", to = "M2"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    sfo_lin_fit <- mkinfit(m_synth_SFO_lin, test_data_2, quiet = TRUE) -plot_res(sfo_lin_fit) # not a good model, we try parallel formation -
    loftest(sfo_lin_fit) -
    #> Likelihood ratio test -#> -#> Model 1: ANOVA with error model const -#> Model 2: m_synth_SFO_lin with error model const and fixed parameter(s) M1_0, M2_0 -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 28 -93.606 -#> 2 7 -171.927 -21 156.64 < 2.2e-16 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    # -m_synth_SFO_par <- mkinmod(parent = list(type = "SFO", to = c("M1", "M2")), - M1 = list(type = "SFO"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    sfo_par_fit <- mkinfit(m_synth_SFO_par, test_data_2, quiet = TRUE) -plot_res(sfo_par_fit) # much better for metabolites -
    loftest(sfo_par_fit) -
    #> Likelihood ratio test -#> -#> Model 1: ANOVA with error model const -#> Model 2: m_synth_SFO_par with error model const and fixed parameter(s) M1_0, M2_0 -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 28 -93.606 -#> 2 7 -156.331 -21 125.45 < 2.2e-16 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    # -m_synth_DFOP_par <- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2")), - M1 = list(type = "SFO"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    dfop_par_fit <- mkinfit(m_synth_DFOP_par, test_data_2, quiet = TRUE) -plot_res(dfop_par_fit) # No visual lack of fit -
    loftest(dfop_par_fit) # no lack of fit found by the test -
    #> Likelihood ratio test -#> -#> Model 1: ANOVA with error model const -#> Model 2: m_synth_DFOP_par with error model const and fixed parameter(s) M1_0, M2_0 -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 28 -93.606 -#> 2 9 -102.763 -19 18.313 0.5016
    # -# The anova model used for comparison in the case of transformation products -test_data_anova_2 <- dfop_par_fit$data -test_data_anova_2$variable <- as.factor(test_data_anova_2$variable) -test_data_anova_2$time <- as.factor(test_data_anova_2$time) -anova_fit_2 <- lm(observed ~ time:variable - 1, data = test_data_anova_2) -summary(anova_fit_2) -
    #> -#> Call: -#> lm(formula = observed ~ time:variable - 1, data = test_data_anova_2) -#> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -6.1000 -0.5875 0.0000 0.5875 6.1000 -#> -#> Coefficients: (2 not defined because of singularities) -#> Estimate Std. Error t value Pr(>|t|) -#> time0:variableparent 103.150 1.573 65.562 < 2e-16 *** -#> time1:variableparent 83.200 1.573 52.882 < 2e-16 *** -#> time3:variableparent 52.350 1.573 33.274 < 2e-16 *** -#> time7:variableparent 34.650 1.573 22.024 < 2e-16 *** -#> time14:variableparent 23.400 1.573 14.873 6.35e-14 *** -#> time28:variableparent 17.150 1.573 10.901 5.47e-11 *** -#> time60:variableparent 8.250 1.573 5.244 1.99e-05 *** -#> time90:variableparent 4.650 1.573 2.956 0.006717 ** -#> time120:variableparent 2.700 1.573 1.716 0.098507 . -#> time0:variableM1 NA NA NA NA -#> time1:variableM1 11.850 1.573 7.532 6.93e-08 *** -#> time3:variableM1 22.700 1.573 14.428 1.26e-13 *** -#> time7:variableM1 33.050 1.573 21.007 < 2e-16 *** -#> time14:variableM1 31.250 1.573 19.863 < 2e-16 *** -#> time28:variableM1 18.900 1.573 12.013 7.02e-12 *** -#> time60:variableM1 7.550 1.573 4.799 6.28e-05 *** -#> time90:variableM1 3.850 1.573 2.447 0.021772 * -#> time120:variableM1 2.050 1.573 1.303 0.204454 -#> time0:variableM2 NA NA NA NA -#> time1:variableM2 6.700 1.573 4.259 0.000254 *** -#> time3:variableM2 16.750 1.573 10.646 8.93e-11 *** -#> time7:variableM2 25.800 1.573 16.399 6.89e-15 *** -#> time14:variableM2 28.600 1.573 18.178 6.35e-16 *** -#> time28:variableM2 25.400 1.573 16.144 9.85e-15 *** -#> time60:variableM2 21.600 1.573 13.729 3.81e-13 *** -#> time90:variableM2 17.800 1.573 11.314 2.51e-11 *** -#> time120:variableM2 14.100 1.573 8.962 2.79e-09 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 2.225 on 25 degrees of freedom -#> Multiple R-squared: 0.9979, Adjusted R-squared: 0.9957 -#> F-statistic: 469.2 on 25 and 25 DF, p-value: < 2.2e-16 -#>
    # } -
    +
    +

    Examples

    +
    # \dontrun{
    +test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    +sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    +plot_res(sfo_fit) # We see a clear pattern in the residuals
    +
    +loftest(sfo_fit)  # We have a clear lack of fit
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: ANOVA with error model const
    +#> Model 2: SFO with error model const
    +#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
    +#> 1  10 -40.710                         
    +#> 2   3 -63.954 -7 46.487  7.027e-08 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +#
    +# We try a different model (the one that was used to generate the data)
    +dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    +plot_res(dfop_fit) # We don't see systematic deviations, but heteroscedastic residuals
    +
    +# therefore we should consider adapting the error model, although we have
    +loftest(dfop_fit) # no lack of fit
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: ANOVA with error model const
    +#> Model 2: DFOP with error model const
    +#>   #Df  LogLik Df Chisq Pr(>Chisq)
    +#> 1  10 -40.710                    
    +#> 2   5 -42.453 -5 3.485     0.6257
    +#
    +# This is the anova model used internally for the comparison
    +test_data_anova <- test_data
    +test_data_anova$time <- as.factor(test_data_anova$time)
    +anova_fit <- lm(value ~ time, data = test_data_anova)
    +summary(anova_fit)
    +#> 
    +#> Call:
    +#> lm(formula = value ~ time, data = test_data_anova)
    +#> 
    +#> Residuals:
    +#>     Min      1Q  Median      3Q     Max 
    +#> -6.1000 -0.5625  0.0000  0.5625  6.1000 
    +#> 
    +#> Coefficients:
    +#>             Estimate Std. Error t value Pr(>|t|)    
    +#> (Intercept)  103.150      2.323  44.409 7.44e-12 ***
    +#> time1        -19.950      3.285  -6.073 0.000185 ***
    +#> time3        -50.800      3.285 -15.465 8.65e-08 ***
    +#> time7        -68.500      3.285 -20.854 6.28e-09 ***
    +#> time14       -79.750      3.285 -24.278 1.63e-09 ***
    +#> time28       -86.000      3.285 -26.181 8.35e-10 ***
    +#> time60       -94.900      3.285 -28.891 3.48e-10 ***
    +#> time90       -98.500      3.285 -29.986 2.49e-10 ***
    +#> time120     -100.450      3.285 -30.580 2.09e-10 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +#> 
    +#> Residual standard error: 3.285 on 9 degrees of freedom
    +#> Multiple R-squared:  0.9953,	Adjusted R-squared:  0.9912 
    +#> F-statistic: 240.5 on 8 and 9 DF,  p-value: 1.417e-09
    +#> 
    +logLik(anova_fit) # We get the same likelihood and degrees of freedom
    +#> 'log Lik.' -40.71015 (df=10)
    +#
    +test_data_2 <- synthetic_data_for_UBA_2014[[12]]$data
    +m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"),
    +  M1 = list(type = "SFO", to = "M2"),
    +  M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +sfo_lin_fit <- mkinfit(m_synth_SFO_lin, test_data_2, quiet = TRUE)
    +plot_res(sfo_lin_fit) # not a good model, we try parallel formation
    +
    +loftest(sfo_lin_fit)
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: ANOVA with error model const
    +#> Model 2: m_synth_SFO_lin with error model const and fixed parameter(s) M1_0, M2_0
    +#>   #Df   LogLik  Df  Chisq Pr(>Chisq)    
    +#> 1  28  -93.606                          
    +#> 2   7 -171.927 -21 156.64  < 2.2e-16 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +#
    +m_synth_SFO_par <- mkinmod(parent = list(type = "SFO", to = c("M1", "M2")),
    +  M1 = list(type = "SFO"),
    +  M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +sfo_par_fit <- mkinfit(m_synth_SFO_par, test_data_2, quiet = TRUE)
    +plot_res(sfo_par_fit) # much better for metabolites
    +
    +loftest(sfo_par_fit)
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: ANOVA with error model const
    +#> Model 2: m_synth_SFO_par with error model const and fixed parameter(s) M1_0, M2_0
    +#>   #Df   LogLik  Df  Chisq Pr(>Chisq)    
    +#> 1  28  -93.606                          
    +#> 2   7 -156.331 -21 125.45  < 2.2e-16 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +#
    +m_synth_DFOP_par <- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2")),
    +  M1 = list(type = "SFO"),
    +  M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +dfop_par_fit <- mkinfit(m_synth_DFOP_par, test_data_2, quiet = TRUE)
    +plot_res(dfop_par_fit) # No visual lack of fit
    +
    +loftest(dfop_par_fit)  # no lack of fit found by the test
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: ANOVA with error model const
    +#> Model 2: m_synth_DFOP_par with error model const and fixed parameter(s) M1_0, M2_0
    +#>   #Df   LogLik  Df  Chisq Pr(>Chisq)
    +#> 1  28  -93.606                      
    +#> 2   9 -102.763 -19 18.313     0.5016
    +#
    +# The anova model used for comparison in the case of transformation products
    +test_data_anova_2 <- dfop_par_fit$data
    +test_data_anova_2$variable <- as.factor(test_data_anova_2$variable)
    +test_data_anova_2$time <- as.factor(test_data_anova_2$time)
    +anova_fit_2 <- lm(observed ~ time:variable - 1, data = test_data_anova_2)
    +summary(anova_fit_2)
    +#> 
    +#> Call:
    +#> lm(formula = observed ~ time:variable - 1, data = test_data_anova_2)
    +#> 
    +#> Residuals:
    +#>     Min      1Q  Median      3Q     Max 
    +#> -6.1000 -0.5875  0.0000  0.5875  6.1000 
    +#> 
    +#> Coefficients: (2 not defined because of singularities)
    +#>                        Estimate Std. Error t value Pr(>|t|)    
    +#> time0:variableparent    103.150      1.573  65.562  < 2e-16 ***
    +#> time1:variableparent     83.200      1.573  52.882  < 2e-16 ***
    +#> time3:variableparent     52.350      1.573  33.274  < 2e-16 ***
    +#> time7:variableparent     34.650      1.573  22.024  < 2e-16 ***
    +#> time14:variableparent    23.400      1.573  14.873 6.35e-14 ***
    +#> time28:variableparent    17.150      1.573  10.901 5.47e-11 ***
    +#> time60:variableparent     8.250      1.573   5.244 1.99e-05 ***
    +#> time90:variableparent     4.650      1.573   2.956 0.006717 ** 
    +#> time120:variableparent    2.700      1.573   1.716 0.098507 .  
    +#> time0:variableM1             NA         NA      NA       NA    
    +#> time1:variableM1         11.850      1.573   7.532 6.93e-08 ***
    +#> time3:variableM1         22.700      1.573  14.428 1.26e-13 ***
    +#> time7:variableM1         33.050      1.573  21.007  < 2e-16 ***
    +#> time14:variableM1        31.250      1.573  19.863  < 2e-16 ***
    +#> time28:variableM1        18.900      1.573  12.013 7.02e-12 ***
    +#> time60:variableM1         7.550      1.573   4.799 6.28e-05 ***
    +#> time90:variableM1         3.850      1.573   2.447 0.021772 *  
    +#> time120:variableM1        2.050      1.573   1.303 0.204454    
    +#> time0:variableM2             NA         NA      NA       NA    
    +#> time1:variableM2          6.700      1.573   4.259 0.000254 ***
    +#> time3:variableM2         16.750      1.573  10.646 8.93e-11 ***
    +#> time7:variableM2         25.800      1.573  16.399 6.89e-15 ***
    +#> time14:variableM2        28.600      1.573  18.178 6.35e-16 ***
    +#> time28:variableM2        25.400      1.573  16.144 9.85e-15 ***
    +#> time60:variableM2        21.600      1.573  13.729 3.81e-13 ***
    +#> time90:variableM2        17.800      1.573  11.314 2.51e-11 ***
    +#> time120:variableM2       14.100      1.573   8.962 2.79e-09 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +#> 
    +#> Residual standard error: 2.225 on 25 degrees of freedom
    +#> Multiple R-squared:  0.9979,	Adjusted R-squared:  0.9957 
    +#> F-statistic: 469.2 on 25 and 25 DF,  p-value: < 2.2e-16
    +#> 
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/logLik.mkinfit.html b/docs/dev/reference/logLik.mkinfit.html index 3e9452c6..e77121d1 100644 --- a/docs/dev/reference/logLik.mkinfit.html +++ b/docs/dev/reference/logLik.mkinfit.html @@ -1,71 +1,16 @@ - - - - - - - -Calculated the log-likelihood of a fitted mkinfit object — logLik.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculated the log-likelihood of a fitted mkinfit object — logLik.mkinfit • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +

    This function returns the product of the likelihood densities of each observed value, as calculated as part of the fitting procedure using -dnorm, i.e. assuming normal distribution, and with the means +dnorm, i.e. assuming normal distribution, and with the means predicted by the degradation model, and the standard deviations predicted by the error model.

    -
    # S3 method for mkinfit
    -logLik(object, ...)
    - -

    Arguments

    - - - - - - - - - - -
    object

    An object of class mkinfit.

    ...

    For compatibility with the generic method

    - -

    Value

    - -

    An object of class logLik with the number of estimated +

    +
    # S3 method for mkinfit
    +logLik(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    An object of class mkinfit.

    + + +
    ...
    +

    For compatibility with the generic method

    + +
    +
    +

    Value

    + + +

    An object of class logLik with the number of estimated parameters (degradation model parameters plus variance model parameters) as attribute.

    -

    Details

    - +
    +
    +

    Details

    The total number of estimated parameters returned with the value of the likelihood is calculated as the sum of fitted degradation model parameters and the fitted error model parameters.

    -

    See also

    - -

    Compare the AIC of columns of mmkin objects using -AIC.mmkin.

    -

    Author

    - +
    +
    +

    See also

    +

    Compare the AIC of columns of mmkin objects using +AIC.mmkin.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - # \dontrun{ - sfo_sfo <- mkinmod( - parent = mkinsub("SFO", to = "m1"), - m1 = mkinsub("SFO") - ) -
    #> Temporary DLL for differentials generated and loaded
    d_t <- subset(FOCUS_2006_D, value != 0) - f_nw <- mkinfit(sfo_sfo, d_t, quiet = TRUE) # no weighting (weights are unity) - f_obs <- update(f_nw, error_model = "obs") - f_tc <- update(f_nw, error_model = "tc") - AIC(f_nw, f_obs, f_tc) -
    #> df AIC -#> f_nw 5 204.4486 -#> f_obs 6 205.8727 -#> f_tc 6 141.9656
    # } - -
    +
    +

    Examples

    +
    
    +  # \dontrun{
    +  sfo_sfo <- mkinmod(
    +    parent = mkinsub("SFO", to = "m1"),
    +    m1 = mkinsub("SFO")
    +  )
    +#> Temporary DLL for differentials generated and loaded
    +  d_t <- subset(FOCUS_2006_D, value != 0)
    +  f_nw <- mkinfit(sfo_sfo, d_t, quiet = TRUE) # no weighting (weights are unity)
    +  f_obs <- update(f_nw, error_model = "obs")
    +  f_tc <- update(f_nw, error_model = "tc")
    +  AIC(f_nw, f_obs, f_tc)
    +#>       df      AIC
    +#> f_nw   5 204.4486
    +#> f_obs  6 205.8727
    +#> f_tc   6 141.9656
    +  # }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/logLik.saem.mmkin.html b/docs/dev/reference/logLik.saem.mmkin.html index ebef3b10..fc06b36f 100644 --- a/docs/dev/reference/logLik.saem.mmkin.html +++ b/docs/dev/reference/logLik.saem.mmkin.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2 diff --git a/docs/dev/reference/logistic.solution.html b/docs/dev/reference/logistic.solution.html index 1d1880fd..ac4961bc 100644 --- a/docs/dev/reference/logistic.solution.html +++ b/docs/dev/reference/logistic.solution.html @@ -18,7 +18,7 @@ an increasing rate constant, supposedly caused by microbial growth"> mkin - 1.2.0 + 1.2.2 @@ -60,7 +60,10 @@ an increasing rate constant, supposedly caused by microbial growth">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/lrtest.mkinfit.html b/docs/dev/reference/lrtest.mkinfit.html index f2d8472e..a7198474 100644 --- a/docs/dev/reference/lrtest.mkinfit.html +++ b/docs/dev/reference/lrtest.mkinfit.html @@ -1,71 +1,16 @@ - - - - - - - -Likelihood ratio test for mkinfit models — lrtest.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Likelihood ratio test for mkinfit models — lrtest.mkinfit • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    @@ -155,115 +100,117 @@ that the models are nested, i.e. one of them has less degrees of freedom and can be expressed by fixing the parameters of the other.

    -
    # S3 method for mkinfit
    -lrtest(object, object_2 = NULL, ...)
    +    
    +
    # S3 method for mkinfit
    +lrtest(object, object_2 = NULL, ...)
    +
    +# S3 method for mmkin
    +lrtest(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    An mkinfit object, or an mmkin column +object containing two fits to the same data.

    + -# S3 method for mmkin -lrtest(object, ...)
    +
    object_2
    +

    Optionally, another mkinfit object fitted to the same data.

    -

    Arguments

    - - - - - - - - - - - - - - -
    object

    An mkinfit object, or an mmkin column -object containing two fits to the same data.

    object_2

    Optionally, another mkinfit object fitted to the same data.

    ...

    Argument to mkinfit, passed to -update.mkinfit for creating the alternative fitted object.

    -

    Details

    +
    ...
    +

    Argument to mkinfit, passed to +update.mkinfit for creating the alternative fitted object.

    +
    +
    +

    Details

    Alternatively, an argument to mkinfit can be given which is then passed -to update.mkinfit to obtain the alternative model.

    -

    The comparison is then made by the lrtest.default +to update.mkinfit to obtain the alternative model.

    +

    The comparison is then made by the lrtest.default method from the lmtest package. The model with the higher number of fitted parameters (alternative hypothesis) is listed first, then the model with the lower number of fitted parameters (null hypothesis).

    +
    -

    Examples

    -
    # \dontrun{ -test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent") -sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE) -dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE) -lrtest(dfop_fit, sfo_fit) -
    #> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: SFO with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 3 -63.954 -2 43.002 4.594e-10 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    lrtest(sfo_fit, dfop_fit) -
    #> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: SFO with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 3 -63.954 -2 43.002 4.594e-10 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    -# The following two examples are commented out as they fail during -# generation of the static help pages by pkgdown -#lrtest(dfop_fit, error_model = "tc") -#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) - -# However, this equivalent syntax also works for static help pages -lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) -
    #> Likelihood ratio test -#> -#> Model 1: DFOP with error model tc -#> Model 2: DFOP with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 6 -34.587 -#> 2 5 -42.453 -1 15.731 7.302e-05 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) -
    #> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: DFOP with error model const and fixed parameter(s) k2 -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 4 -57.340 -1 29.776 4.851e-08 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    # } -
    +
    +

    Examples

    +
    # \dontrun{
    +test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    +sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    +dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    +lrtest(dfop_fit, sfo_fit)
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: DFOP with error model const
    +#> Model 2: SFO with error model const
    +#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
    +#> 1   5 -42.453                         
    +#> 2   3 -63.954 -2 43.002  4.594e-10 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +lrtest(sfo_fit, dfop_fit)
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: DFOP with error model const
    +#> Model 2: SFO with error model const
    +#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
    +#> 1   5 -42.453                         
    +#> 2   3 -63.954 -2 43.002  4.594e-10 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +
    +# The following two examples are commented out as they fail during
    +# generation of the static help pages by pkgdown
    +#lrtest(dfop_fit, error_model = "tc")
    +#lrtest(dfop_fit, fixed_parms = c(k2 = 0))
    +
    +# However, this equivalent syntax also works for static help pages
    +lrtest(dfop_fit, update(dfop_fit, error_model = "tc"))
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: DFOP with error model tc
    +#> Model 2: DFOP with error model const
    +#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
    +#> 1   6 -34.587                         
    +#> 2   5 -42.453 -1 15.731  7.302e-05 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0)))
    +#> Likelihood ratio test
    +#> 
    +#> Model 1: DFOP with error model const
    +#> Model 2: DFOP with error model const and fixed parameter(s) k2
    +#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
    +#> 1   5 -42.453                         
    +#> 2   4 -57.340 -1 29.776  4.851e-08 ***
    +#> ---
    +#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/max_twa_parent.html b/docs/dev/reference/max_twa_parent.html index a358568a..32ffaf6d 100644 --- a/docs/dev/reference/max_twa_parent.html +++ b/docs/dev/reference/max_twa_parent.html @@ -1,73 +1,18 @@ - - - - - - - -Function to calculate maximum time weighted average concentrations from -kinetic models fitted with mkinfit — max_twa_parent • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to calculate maximum time weighted average concentrations from +kinetic models fitted with mkinfit — max_twa_parent • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +

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

    -
    max_twa_parent(fit, windows)
    +    
    +
    max_twa_parent(fit, windows)
    +
    +max_twa_sfo(M0 = 1, k, t)
    +
    +max_twa_fomc(M0 = 1, alpha, beta, t)
    +
    +max_twa_dfop(M0 = 1, k1, k2, g, t)
    +
    +max_twa_hs(M0 = 1, k1, k2, tb, t)
    +
    -max_twa_sfo(M0 = 1, k, t) +
    +

    Arguments

    +
    fit
    +

    An object of class mkinfit.

    -max_twa_fomc(M0 = 1, alpha, beta, t) -max_twa_dfop(M0 = 1, k1, k2, g, t) +
    windows
    +

    The width of the time windows for which the TWAs should be +calculated.

    -max_twa_hs(M0 = 1, k1, k2, tb, t)
    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    fit

    An object of class mkinfit.

    windows

    The width of the time windows for which the TWAs should be -calculated.

    M0

    The initial concentration for which the maximum time weighted +

    M0
    +

    The initial concentration for which the maximum time weighted average over the decline curve should be calculated. The default is to use a value of 1, which means that a relative maximum time weighted average -factor (f_twa) is calculated.

    k

    The rate constant in the case of SFO kinetics.

    t

    The width of the time window.

    alpha

    Parameter of the FOMC model.

    beta

    Parameter of the FOMC model.

    k1

    The first rate constant of the DFOP or the HS kinetics.

    k2

    The second rate constant of the DFOP or the HS kinetics.

    g

    Parameter of the DFOP model.

    tb

    Parameter of the HS model.

    - -

    Value

    - -

    For max_twa_parent, a numeric vector, named using the +factor (f_twa) is calculated.

    + + +
    k
    +

    The rate constant in the case of SFO kinetics.

    + + +
    t
    +

    The width of the time window.

    + + +
    alpha
    +

    Parameter of the FOMC model.

    + + +
    beta
    +

    Parameter of the FOMC model.

    + + +
    k1
    +

    The first rate constant of the DFOP or the HS kinetics.

    + + +
    k2
    +

    The second rate constant of the DFOP or the HS kinetics.

    + + +
    g
    +

    Parameter of the DFOP model.

    + + +
    tb
    +

    Parameter of the HS model.

    + +
    +
    +

    Value

    + + +

    For max_twa_parent, a numeric vector, named using the windows argument. For the other functions, a numeric vector of length one (also known as 'a number').

    -

    References

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence +

    +
    +

    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, +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    -

    Author

    - +http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) - max_twa_parent(fit, c(7, 21)) -
    #> 7 21 -#> 34.71343 18.22124
    -
    +
    +

    Examples

    +
    
    +  fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE)
    +  max_twa_parent(fit, c(7, 21))
    +#>        7       21 
    +#> 34.71343 18.22124 
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mccall81_245T-1.png b/docs/dev/reference/mccall81_245T-1.png index 91fe060e..79c45fe6 100644 Binary files a/docs/dev/reference/mccall81_245T-1.png and b/docs/dev/reference/mccall81_245T-1.png differ diff --git a/docs/dev/reference/mccall81_245T.html b/docs/dev/reference/mccall81_245T.html index f79137be..26173c65 100644 --- a/docs/dev/reference/mccall81_245T.html +++ b/docs/dev/reference/mccall81_245T.html @@ -1,69 +1,14 @@ - - - - - - - -Datasets on aerobic soil metabolism of 2,4,5-T in six soils — mccall81_245T • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Datasets on aerobic soil metabolism of 2,4,5-T in six soils — mccall81_245T • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    mccall81_245T
    - - -

    Format

    +
    +
    mccall81_245T
    +
    -

    A dataframe containing the following variables.

    -
    name

    the name of the compound observed. Note that T245 is used as +

    +

    Format

    +

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

    -
    time

    a numeric vector containing sampling times in days after + mkinmod.

    + +
    time
    +

    a numeric vector containing sampling times in days after treatment

    -
    value

    a numeric vector containing concentrations in percent of applied radioactivity

    -
    soil

    a factor containing the name of the soil

    - -
    -

    Source

    +
    value
    +

    a numeric vector containing concentrations in percent of applied radioactivity

    + +
    soil
    +

    a factor containing the name of the soil

    + +
    +
    +

    Source

    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 - doi: 10.1021/jf00103a026

    + doi:10.1021/jf00103a026

    +
    -

    Examples

    -
    SFO_SFO_SFO <- mkinmod(T245 = list(type = "SFO", to = "phenol"), - phenol = list(type = "SFO", to = "anisole"), - anisole = list(type = "SFO")) -
    #> Temporary DLL for differentials generated and loaded
    # \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 -
    #> Estimate se_notrans t value Pr(>t) -#> T245_0 1.038550e+02 2.1847074945 47.537272 4.472189e-18 -#> k_T245 4.337042e-02 0.0018983965 22.845818 2.276911e-13 -#> k_phenol 4.050581e-01 0.2986993563 1.356073 9.756989e-02 -#> k_anisole 6.678742e-03 0.0008021439 8.326114 2.623177e-07 -#> f_T245_to_phenol 6.227599e-01 0.3985340558 1.562627 6.949413e-02 -#> f_phenol_to_anisole 1.000000e+00 0.6718439825 1.488441 7.867789e-02 -#> sigma 2.514628e+00 0.4907558883 5.123989 6.233157e-05 -#> Lower Upper -#> T245_0 99.246061385 1.084640e+02 -#> k_T245 0.039631621 4.746194e-02 -#> k_phenol 0.218013879 7.525762e-01 -#> k_anisole 0.005370739 8.305299e-03 -#> f_T245_to_phenol 0.547559081 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 3.773626e-10 -#> -#> $distimes -#> DT50 DT90 -#> T245 15.982025 53.09114 -#> phenol 1.711229 5.68458 -#> anisole 103.784093 344.76329 -#>
    # formation fraction from phenol to anisol is practically 1. As we cannot - # fix formation fractions when using the ilr transformation, we can turn of - # the sink in the model generation - SFO_SFO_SFO_2 <- mkinmod(T245 = list(type = "SFO", to = "phenol"), - phenol = list(type = "SFO", to = "anisole", sink = FALSE), - anisole = list(type = "SFO")) -
    #> Temporary DLL for differentials generated and loaded
    fit.2 <- mkinfit(SFO_SFO_SFO_2, subset(mccall81_245T, soil == "Commerce"), - 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.1623653066 48.028439 4.993108e-19 99.271020284 -#> k_T245 4.337042e-02 0.0018343666 23.643268 3.573556e-14 0.039650976 -#> k_phenol 4.050582e-01 0.1177237473 3.440752 1.679254e-03 0.218746587 -#> k_anisole 6.678742e-03 0.0006829745 9.778903 1.872894e-08 0.005377083 -#> f_T245_to_phenol 6.227599e-01 0.0342197875 18.198824 2.039411e-12 0.547975637 -#> sigma 2.514628e+00 0.3790944250 6.633250 2.875782e-06 1.710983655 -#> Upper -#> T245_0 108.43904074 -#> k_T245 0.04743877 -#> k_phenol 0.75005585 -#> k_anisole 0.00829550 -#> f_T245_to_phenol 0.69212308 -#> sigma 3.31827222
    endpoints(fit.1) -
    #> $ff -#> T245_phenol T245_sink phenol_anisole phenol_sink -#> 6.227599e-01 3.772401e-01 1.000000e+00 3.773626e-10 -#> -#> $distimes -#> DT50 DT90 -#> T245 15.982025 53.09114 -#> phenol 1.711229 5.68458 -#> anisole 103.784093 344.76329 -#>
    plot_sep(fit.2) -
    # } -
    +
    +

    Examples

    +
      SFO_SFO_SFO <- mkinmod(T245 = list(type = "SFO", to = "phenol"),
    +    phenol = list(type = "SFO", to = "anisole"),
    +    anisole = list(type = "SFO"))
    +#> Temporary DLL for differentials generated and loaded
    +  # \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
    +#>                         Estimate   se_notrans   t value       Pr(>t)
    +#> T245_0              1.038550e+02 2.1847074945 47.537272 4.472189e-18
    +#> k_T245              4.337042e-02 0.0018983965 22.845818 2.276911e-13
    +#> k_phenol            4.050581e-01 0.2986993563  1.356073 9.756989e-02
    +#> k_anisole           6.678742e-03 0.0008021439  8.326114 2.623177e-07
    +#> f_T245_to_phenol    6.227599e-01 0.3985340558  1.562627 6.949413e-02
    +#> f_phenol_to_anisole 1.000000e+00 0.6718439825  1.488441 7.867789e-02
    +#> sigma               2.514628e+00 0.4907558883  5.123989 6.233157e-05
    +#>                            Lower        Upper
    +#> T245_0              99.246061385 1.084640e+02
    +#> k_T245               0.039631621 4.746194e-02
    +#> k_phenol             0.218013879 7.525762e-01
    +#> k_anisole            0.005370739 8.305299e-03
    +#> f_T245_to_phenol     0.547559081 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   3.773626e-10 
    +#> 
    +#> $distimes
    +#>               DT50      DT90
    +#> T245     15.982025  53.09114
    +#> phenol    1.711229   5.68458
    +#> anisole 103.784093 344.76329
    +#> 
    +    # formation fraction from phenol to anisol is practically 1. As we cannot
    +    # fix formation fractions when using the ilr transformation, we can turn of
    +    # the sink in the model generation
    +    SFO_SFO_SFO_2 <- mkinmod(T245 = list(type = "SFO", to = "phenol"),
    +      phenol = list(type = "SFO", to = "anisole", sink = FALSE),
    +      anisole = list(type = "SFO"))
    +#> Temporary DLL for differentials generated and loaded
    +    fit.2 <- mkinfit(SFO_SFO_SFO_2, subset(mccall81_245T, soil == "Commerce"),
    +      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.1623653066 48.028439 4.993108e-19 99.271020284
    +#> k_T245           4.337042e-02 0.0018343666 23.643268 3.573556e-14  0.039650976
    +#> k_phenol         4.050582e-01 0.1177237473  3.440752 1.679254e-03  0.218746587
    +#> k_anisole        6.678742e-03 0.0006829745  9.778903 1.872894e-08  0.005377083
    +#> f_T245_to_phenol 6.227599e-01 0.0342197875 18.198824 2.039411e-12  0.547975637
    +#> sigma            2.514628e+00 0.3790944250  6.633250 2.875782e-06  1.710983655
    +#>                         Upper
    +#> T245_0           108.43904074
    +#> k_T245             0.04743877
    +#> k_phenol           0.75005585
    +#> k_anisole          0.00829550
    +#> f_T245_to_phenol   0.69212308
    +#> sigma              3.31827222
    +    endpoints(fit.1)
    +#> $ff
    +#>    T245_phenol      T245_sink phenol_anisole    phenol_sink 
    +#>   6.227599e-01   3.772401e-01   1.000000e+00   3.773626e-10 
    +#> 
    +#> $distimes
    +#>               DT50      DT90
    +#> T245     15.982025  53.09114
    +#> phenol    1.711229   5.68458
    +#> anisole 103.784093 344.76329
    +#> 
    +    plot_sep(fit.2)
    +
    +  # }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mean_degparms.html b/docs/dev/reference/mean_degparms.html index 67db1868..feb37a1d 100644 --- a/docs/dev/reference/mean_degparms.html +++ b/docs/dev/reference/mean_degparms.html @@ -17,7 +17,7 @@ mkin - 1.1.2 + 1.2.2 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/mhmkin.html b/docs/dev/reference/mhmkin.html index e87e20a1..e72d17f9 100644 --- a/docs/dev/reference/mhmkin.html +++ b/docs/dev/reference/mhmkin.html @@ -22,7 +22,7 @@ mixed-effects model fitting functions."> mkin - 1.2.0 + 1.2.2 @@ -64,7 +64,10 @@ mixed-effects model fitting functions.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/mixed-1.png b/docs/dev/reference/mixed-1.png index 54b81b70..dbba1b03 100644 Binary files a/docs/dev/reference/mixed-1.png and b/docs/dev/reference/mixed-1.png differ diff --git a/docs/dev/reference/mixed.html b/docs/dev/reference/mixed.html index b2b83312..01a0614b 100644 --- a/docs/dev/reference/mixed.html +++ b/docs/dev/reference/mixed.html @@ -17,7 +17,7 @@ mkin - 1.1.0 + 1.2.2 @@ -26,7 +26,7 @@ Functions and data
  • - Example evaluation of FOCUS Example Dataset Z + Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models +
  • +
  • + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -53,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -84,73 +93,84 @@
    -
    mixed(object, ...)
    -
    -# S3 method for mmkin
    -mixed(object, method = c("none"), ...)
    -
    -# S3 method for mixed.mmkin
    -print(x, digits = max(3, getOption("digits") - 3), ...)
    +
    mixed(object, ...)
    +
    +# S3 method for mmkin
    +mixed(object, method = c("none"), ...)
    +
    +# S3 method for mixed.mmkin
    +print(x, digits = max(3, getOption("digits") - 3), ...)

    Arguments

    object

    An mmkin row object

    + +
    ...

    Currently not used

    + +
    method

    The method to be used

    + +
    x

    A mixed.mmkin object to print

    + +
    digits

    Number of digits to use for printing.

    +

    Value

    -

    An object of class 'mixed.mmkin' which has the observed data in a + + +

    An object of class 'mixed.mmkin' which has the observed data in a single dataframe which is convenient for plotting

    Examples

    -
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    -n_biphasic <- 8
    -err_1 = list(const = 1, prop = 0.07)
    -
    -DFOP_SFO <- mkinmod(
    -  parent = mkinsub("DFOP", "m1"),
    -  m1 = mkinsub("SFO"),
    -  quiet = TRUE)
    -
    -set.seed(123456)
    -log_sd <- 0.3
    -syn_biphasic_parms <- as.matrix(data.frame(
    -  k1 = rlnorm(n_biphasic, log(0.05), log_sd),
    -  k2 = rlnorm(n_biphasic, log(0.01), log_sd),
    -  g = plogis(rnorm(n_biphasic, 0, log_sd)),
    -  f_parent_to_m1 = plogis(rnorm(n_biphasic, 0, log_sd)),
    -  k_m1 = rlnorm(n_biphasic, log(0.002), log_sd)))
    -
    -ds_biphasic_mean <- lapply(1:n_biphasic,
    -  function(i) {
    -    mkinpredict(DFOP_SFO, syn_biphasic_parms[i, ],
    -      c(parent = 100, m1 = 0), sampling_times)
    -  }
    -)
    -
    -set.seed(123456L)
    -ds_biphasic <- lapply(ds_biphasic_mean, function(ds) {
    -  add_err(ds,
    -    sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2),
    -    n = 1, secondary = "m1")[[1]]
    -})
    -
    -# \dontrun{
    -f_mmkin <- mmkin(list("DFOP-SFO" = DFOP_SFO), ds_biphasic, error_model = "tc", quiet = TRUE)
    -
    -f_mixed <- mixed(f_mmkin)
    -print(f_mixed)
    +    
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +n_biphasic <- 8
    +err_1 = list(const = 1, prop = 0.07)
    +
    +DFOP_SFO <- mkinmod(
    +  parent = mkinsub("DFOP", "m1"),
    +  m1 = mkinsub("SFO"),
    +  quiet = TRUE)
    +
    +set.seed(123456)
    +log_sd <- 0.3
    +syn_biphasic_parms <- as.matrix(data.frame(
    +  k1 = rlnorm(n_biphasic, log(0.05), log_sd),
    +  k2 = rlnorm(n_biphasic, log(0.01), log_sd),
    +  g = plogis(rnorm(n_biphasic, 0, log_sd)),
    +  f_parent_to_m1 = plogis(rnorm(n_biphasic, 0, log_sd)),
    +  k_m1 = rlnorm(n_biphasic, log(0.002), log_sd)))
    +
    +ds_biphasic_mean <- lapply(1:n_biphasic,
    +  function(i) {
    +    mkinpredict(DFOP_SFO, syn_biphasic_parms[i, ],
    +      c(parent = 100, m1 = 0), sampling_times)
    +  }
    +)
    +
    +set.seed(123456L)
    +ds_biphasic <- lapply(ds_biphasic_mean, function(ds) {
    +  add_err(ds,
    +    sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2),
    +    n = 1, secondary = "m1")[[1]]
    +})
    +
    +# \dontrun{
    +f_mmkin <- mmkin(list("DFOP-SFO" = DFOP_SFO), ds_biphasic, error_model = "tc", quiet = TRUE)
    +
    +f_mixed <- mixed(f_mmkin)
    +print(f_mixed)
     #> Kinetic model fitted by nonlinear regression to each dataset
     #> Structural model:
     #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    @@ -177,9 +197,9 @@ single dataframe which is convenient for plotting

    #> 100.674757 -8.761916 -0.004347 -3.348812 -3.986853 #> g_qlogis #> -0.087392 -plot(f_mixed) +plot(f_mixed) -# } +# }
    @@ -194,7 +214,7 @@ single dataframe which is convenient for plotting

    -

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/dev/reference/mkin_long_to_wide.html b/docs/dev/reference/mkin_long_to_wide.html index 6246fbe2..3e55885f 100644 --- a/docs/dev/reference/mkin_long_to_wide.html +++ b/docs/dev/reference/mkin_long_to_wide.html @@ -1,69 +1,14 @@ - - - - - - - -Convert a dataframe from long to wide format — mkin_long_to_wide • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Convert a dataframe from long to wide format — mkin_long_to_wide • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -151,87 +96,89 @@ observed value, and converts it into a dataframe with one independent variable and several dependent variables as columns.

    -
    mkin_long_to_wide(long_data, time = "time", outtime = "time")
    +
    +
    mkin_long_to_wide(long_data, time = "time", outtime = "time")
    +
    -

    Arguments

    - - - - - - - - - - - - - - -
    long_data

    The dataframe must contain one variable called "time" with +

    +

    Arguments

    +
    long_data
    +

    The dataframe must contain one variable called "time" with the time values specified by the time argument, one column called "name" with the grouping of the observed values, and finally one column of -observed values called "value".

    time

    The name of the time variable in the long input data.

    outtime

    The name of the time variable in the wide output data.

    - -

    Value

    - -

    Dataframe in wide format.

    -

    Author

    +observed values called "value".

    + + +
    time
    +

    The name of the time variable in the long input data.

    + + +
    outtime
    +

    The name of the time variable in the wide output data.

    + +
    +
    +

    Value

    + +

    Dataframe in wide format.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -mkin_long_to_wide(FOCUS_2006_D) -
    #> time parent m1 -#> 1 0 99.46 0.00 -#> 2 0 102.04 0.00 -#> 3 1 93.50 4.84 -#> 4 1 92.50 5.64 -#> 5 3 63.23 12.91 -#> 6 3 68.99 12.96 -#> 7 7 52.32 22.97 -#> 8 7 55.13 24.47 -#> 9 14 27.27 41.69 -#> 10 14 26.64 33.21 -#> 11 21 11.50 44.37 -#> 12 21 11.64 46.44 -#> 13 35 2.85 41.22 -#> 14 35 2.91 37.95 -#> 15 50 0.69 41.19 -#> 16 50 0.63 40.01 -#> 17 75 0.05 40.09 -#> 18 75 0.06 33.85 -#> 19 100 NA 31.04 -#> 20 100 NA 33.13 -#> 21 120 NA 25.15 -#> 22 120 NA 33.31
    -
    +
    +

    Examples

    +
    
    +mkin_long_to_wide(FOCUS_2006_D)
    +#>    time parent    m1
    +#> 1     0  99.46  0.00
    +#> 2     0 102.04  0.00
    +#> 3     1  93.50  4.84
    +#> 4     1  92.50  5.64
    +#> 5     3  63.23 12.91
    +#> 6     3  68.99 12.96
    +#> 7     7  52.32 22.97
    +#> 8     7  55.13 24.47
    +#> 9    14  27.27 41.69
    +#> 10   14  26.64 33.21
    +#> 11   21  11.50 44.37
    +#> 12   21  11.64 46.44
    +#> 13   35   2.85 41.22
    +#> 14   35   2.91 37.95
    +#> 15   50   0.69 41.19
    +#> 16   50   0.63 40.01
    +#> 17   75   0.05 40.09
    +#> 18   75   0.06 33.85
    +#> 19  100     NA 31.04
    +#> 20  100     NA 33.13
    +#> 21  120     NA 25.15
    +#> 22  120     NA 33.31
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkin_wide_to_long.html b/docs/dev/reference/mkin_wide_to_long.html index f2bf00c1..fb23d3dc 100644 --- a/docs/dev/reference/mkin_wide_to_long.html +++ b/docs/dev/reference/mkin_wide_to_long.html @@ -1,69 +1,14 @@ - - - - - - - -Convert a dataframe with observations over time into long format — mkin_wide_to_long • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Convert a dataframe with observations over time into long format — mkin_wide_to_long • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +

    This function simply takes a dataframe with one independent variable and several dependent variable and converts it into the long form as required by -mkinfit.

    +mkinfit.

    -
    mkin_wide_to_long(wide_data, time = "t")
    +
    +
    mkin_wide_to_long(wide_data, time = "t")
    +
    -

    Arguments

    - - - - - - - - - - -
    wide_data

    The dataframe must contain one variable with the time +

    +

    Arguments

    +
    wide_data
    +

    The dataframe must contain one variable with the time values specified by the time argument and usually more than one -column of observed values.

    time

    The name of the time variable.

    +column of observed values.

    + -

    Value

    +
    time
    +

    The name of the time variable.

    -

    Dataframe in long format as needed for mkinfit.

    -

    Author

    +
    +
    +

    Value

    + +

    Dataframe in long format as needed for mkinfit.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -wide <- data.frame(t = c(1,2,3), x = c(1,4,7), y = c(3,4,5)) -mkin_wide_to_long(wide) -
    #> name time value -#> 1 x 1 1 -#> 2 x 2 4 -#> 3 x 3 7 -#> 4 y 1 3 -#> 5 y 2 4 -#> 6 y 3 5
    -
    +
    +

    Examples

    +
    
    +wide <- data.frame(t = c(1,2,3), x = c(1,4,7), y = c(3,4,5))
    +mkin_wide_to_long(wide)
    +#>   name time value
    +#> 1    x    1     1
    +#> 2    x    2     4
    +#> 3    x    3     7
    +#> 4    y    1     3
    +#> 5    y    2     4
    +#> 6    y    3     5
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkinds.html b/docs/dev/reference/mkinds.html index b571e3a0..a7fb9916 100644 --- a/docs/dev/reference/mkinds.html +++ b/docs/dev/reference/mkinds.html @@ -20,7 +20,7 @@ provided by this package come as mkinds objects nevertheless."> mkin - 1.1.2 + 1.2.2 @@ -47,11 +47,14 @@ provided by this package come as mkinds objects nevertheless.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -59,7 +62,10 @@ provided by this package come as mkinds objects nevertheless.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/mkindsg.html b/docs/dev/reference/mkindsg.html index d19a7a1d..cbf55fca 100644 --- a/docs/dev/reference/mkindsg.html +++ b/docs/dev/reference/mkindsg.html @@ -20,7 +20,7 @@ dataset if no data are supplied."> - - - - - - -Calculate the minimum error to assume in order to pass the variance test — mkinerrmin • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate the minimum error to assume in order to pass the variance test — mkinerrmin • mkin + + - - - - -
    -
    - -
    - -
    +
    @@ -149,89 +94,100 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> the chi-squared test as defined in the FOCUS kinetics report from 2006.

    -
    mkinerrmin(fit, alpha = 0.05)
    - -

    Arguments

    - - - - - - - - - - -
    fit

    an object of class mkinfit.

    alpha

    The confidence level chosen for the chi-squared test.

    - -

    Value

    - -

    A dataframe with the following components:

    -
    err.min

    The -relative error, expressed as a fraction.

    n.optim

    The number of -optimised parameters attributed to the data series.

    df

    The number of +

    +
    mkinerrmin(fit, alpha = 0.05)
    +
    + +
    +

    Arguments

    +
    fit
    +

    an object of class mkinfit.

    + + +
    alpha
    +

    The confidence level chosen for the chi-squared test.

    + +
    +
    +

    Value

    + + +

    A dataframe with the following components:

    +
    err.min
    +

    The +relative error, expressed as a fraction.

    +
    n.optim
    +

    The number of +optimised parameters attributed to the data series.

    +
    df
    +

    The number of remaining degrees of freedom for the chi2 error level calculations. Note that mean values are used for the chi2 statistic and therefore every time -point with observed values in the series only counts one time.

    The +point with observed values in the series only counts one time.

    +

    The dataframe has one row for the total dataset and one further row for each -observed state variable in the model. - -

    Details

    - -

    This function is used internally by summary.mkinfit.

    -

    References

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence +observed state variable in the model.

    +
    +
    +

    Details

    +

    This function is used internally by summary.mkinfit.

    +
    +
    +

    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 +Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    - -

    Examples

    -
    -SFO_SFO = mkinmod(parent = mkinsub("SFO", to = "m1"), - m1 = mkinsub("SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -fit_FOCUS_D = mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    round(mkinerrmin(fit_FOCUS_D), 4) -
    #> err.min n.optim df -#> All data 0.0640 4 15 -#> parent 0.0646 2 7 -#> m1 0.0469 2 8
    # \dontrun{ - fit_FOCUS_E = mkinfit(SFO_SFO, FOCUS_2006_E, quiet = TRUE) - round(mkinerrmin(fit_FOCUS_E), 4) -
    #> err.min n.optim df -#> All data 0.1544 4 13 -#> parent 0.1659 2 7 -#> m1 0.1095 2 6
    # } - -
    +http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    +
    + +
    +

    Examples

    +
    
    +SFO_SFO = mkinmod(parent = mkinsub("SFO", to = "m1"),
    +                  m1 = mkinsub("SFO"),
    +                  use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +fit_FOCUS_D = mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +round(mkinerrmin(fit_FOCUS_D), 4)
    +#>          err.min n.optim df
    +#> All data  0.0640       4 15
    +#> parent    0.0646       2  7
    +#> m1        0.0469       2  8
    +# \dontrun{
    +  fit_FOCUS_E = mkinfit(SFO_SFO, FOCUS_2006_E, quiet = TRUE)
    +  round(mkinerrmin(fit_FOCUS_E), 4)
    +#>          err.min n.optim df
    +#> All data  0.1544       4 13
    +#> parent    0.1659       2  7
    +#> m1        0.1095       2  6
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkinerrplot-1.png b/docs/dev/reference/mkinerrplot-1.png index bae6071d..49bb1c0e 100644 Binary files a/docs/dev/reference/mkinerrplot-1.png and b/docs/dev/reference/mkinerrplot-1.png differ diff --git a/docs/dev/reference/mkinerrplot.html b/docs/dev/reference/mkinerrplot.html index 7f1fd048..66bfb508 100644 --- a/docs/dev/reference/mkinerrplot.html +++ b/docs/dev/reference/mkinerrplot.html @@ -1,71 +1,16 @@ - - - - - - - -Function to plot squared residuals and the error model for an mkin object — mkinerrplot • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to plot squared residuals and the error model for an mkin object — mkinerrplot • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -151,128 +96,133 @@ using the argument show_errplot = TRUE." />

    This function plots the squared residuals for the specified subset of the observed variables from an mkinfit object. In addition, one or more dashed line(s) show the fitted error model. A combined plot of the fitted model -and this error model plot can be obtained with plot.mkinfit +and this error model plot can be obtained with plot.mkinfit using the argument show_errplot = TRUE.

    -
    mkinerrplot(
    -  object,
    -  obs_vars = names(object$mkinmod$map),
    -  xlim = c(0, 1.1 * max(object$data$predicted)),
    -  xlab = "Predicted",
    -  ylab = "Squared residual",
    -  maxy = "auto",
    -  legend = TRUE,
    -  lpos = "topright",
    -  col_obs = "auto",
    -  pch_obs = "auto",
    -  frame = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    object

    A fit represented in an mkinfit object.

    obs_vars

    A character vector of names of the observed variables for +

    +
    mkinerrplot(
    +  object,
    +  obs_vars = names(object$mkinmod$map),
    +  xlim = c(0, 1.1 * max(object$data$predicted)),
    +  xlab = "Predicted",
    +  ylab = "Squared residual",
    +  maxy = "auto",
    +  legend = TRUE,
    +  lpos = "topright",
    +  col_obs = "auto",
    +  pch_obs = "auto",
    +  frame = TRUE,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    + + +
    obs_vars
    +

    A character vector of names of the observed variables for which residuals should be plotted. Defaults to all observed variables in -the model

    xlim

    plot range in x direction.

    xlab

    Label for the x axis.

    ylab

    Label for the y axis.

    maxy

    Maximum value of the residuals. This is used for the scaling of -the y axis and defaults to "auto".

    legend

    Should a legend be plotted?

    lpos

    Where should the legend be placed? Default is "topright". Will -be passed on to legend.

    col_obs

    Colors for the observed variables.

    pch_obs

    Symbols to be used for the observed variables.

    frame

    Should a frame be drawn around the plots?

    ...

    further arguments passed to plot.

    - -

    Value

    - -

    Nothing is returned by this function, as it is called for its side -effect, namely to produce a plot.

    -

    See also

    +the model

    -

    mkinplot, for a way to plot the data and the fitted -lines of the mkinfit object.

    -

    Author

    -

    Johannes Ranke

    +
    xlim
    +

    plot range in x direction.

    + + +
    xlab
    +

    Label for the x axis.

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    maxy
    +

    Maximum value of the residuals. This is used for the scaling of +the y axis and defaults to "auto".

    + + +
    legend
    +

    Should a legend be plotted?

    + + +
    lpos
    +

    Where should the legend be placed? Default is "topright". Will +be passed on to legend.

    + -

    Examples

    -
    -# \dontrun{ -model <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO")) -
    #> Temporary DLL for differentials generated and loaded
    fit <- mkinfit(model, FOCUS_2006_D, error_model = "tc", quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    mkinerrplot(fit) -
    # } +
    col_obs
    +

    Colors for the observed variables.

    -
    + +
    pch_obs
    +

    Symbols to be used for the observed variables.

    + + +
    frame
    +

    Should a frame be drawn around the plots?

    + + +
    ...
    +

    further arguments passed to plot.

    + +
    +
    +

    Value

    + + +

    Nothing is returned by this function, as it is called for its side +effect, namely to produce a plot.

    +
    +
    +

    See also

    +

    mkinplot, for a way to plot the data and the fitted +lines of the mkinfit object.

    +
    +
    +

    Author

    +

    Johannes Ranke

    +
    + +
    +

    Examples

    +
    
    +# \dontrun{
    +model <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
    +#> Temporary DLL for differentials generated and loaded
    +fit <- mkinfit(model, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +mkinerrplot(fit)
    +
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkinfit.html b/docs/dev/reference/mkinfit.html index 17da44cb..ee596e89 100644 --- a/docs/dev/reference/mkinfit.html +++ b/docs/dev/reference/mkinfit.html @@ -25,7 +25,7 @@ likelihood function."> mkin - 1.2.0 + 1.2.2 @@ -67,7 +67,10 @@ likelihood function.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -381,17 +384,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: 1.2.0 +#> mkin version used for fitting: 1.2.2 #> R version used for fitting: 4.2.2 -#> Date of fit: Tue Nov 1 14:09:26 2022 -#> Date of summary: Tue Nov 1 14:09:26 2022 +#> Date of fit: Thu Nov 24 08:05:53 2022 +#> Date of summary: Thu Nov 24 08:05:53 2022 #> #> 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.049 s +#> Fitted using 222 model solutions performed in 0.045 s #> #> Error model: Constant variance #> @@ -531,11 +534,10 @@ Degradation Data. Environments 6(12) 124 analytical = mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE, error_model = "tc", solution_type = "analytical")) } -#> Loading required package: rbenchmark #> test relative elapsed -#> 3 analytical 1.000 0.559 -#> 1 deSolve_compiled 1.556 0.870 -#> 2 eigen 2.603 1.455 +#> 3 analytical 1.000 0.616 +#> 1 deSolve_compiled 1.505 0.927 +#> 2 eigen 2.455 1.512 # } # Use stepwise fitting, using optimised parameters from parent only fit, FOMC-SFO @@ -562,10 +564,10 @@ Degradation Data. Environments 6(12) 124 #> Warning: NaNs produced #> Warning: NaNs produced #> Warning: diag(.) had 0 or NA entries; non-finite result is doubtful -#> mkin version used for fitting: 1.2.0 +#> mkin version used for fitting: 1.2.2 #> R version used for fitting: 4.2.2 -#> Date of fit: Tue Nov 1 14:09:37 2022 -#> Date of summary: Tue Nov 1 14:09:37 2022 +#> Date of fit: Thu Nov 24 08:06:05 2022 +#> Date of summary: Thu Nov 24 08:06:05 2022 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent @@ -574,7 +576,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type deSolve #> -#> Fitted using 3729 model solutions performed in 2.43 s +#> Fitted using 3729 model solutions performed in 2.81 s #> #> Error model: Two-component variance function #> diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html index d0e192e7..251215a7 100644 --- a/docs/dev/reference/mkinmod.html +++ b/docs/dev/reference/mkinmod.html @@ -21,7 +21,7 @@ components."> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to plot the confidence intervals obtained using mkinfit — mkinparplot • mkin - - + + - - -
    -
    - -
    - -
    +

    This function plots the confidence intervals for the parameters fitted using -mkinfit.

    +mkinfit.

    -
    mkinparplot(object)
    +
    +
    mkinparplot(object)
    +
    -

    Arguments

    - - - - - - -
    object

    A fit represented in an mkinfit object.

    +
    +

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    -

    Value

    +
    +
    +

    Value

    + -

    Nothing is returned by this function, as it is called for its side +

    Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -# \dontrun{ -model <- mkinmod( - T245 = mkinsub("SFO", to = c("phenol"), sink = FALSE), - phenol = mkinsub("SFO", to = c("anisole")), - anisole = mkinsub("SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    fit <- mkinfit(model, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    #> Warning: Optimisation did not converge: -#> false convergence (8)
    mkinparplot(fit) -
    # } -
    +
    +

    Examples

    +
    
    +# \dontrun{
    +model <- mkinmod(
    +  T245 = mkinsub("SFO", to = c("phenol"), sink = FALSE),
    +  phenol = mkinsub("SFO", to = c("anisole")),
    +  anisole = mkinsub("SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +fit <- mkinfit(model, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +#> Warning: Optimisation did not converge:
    +#> false convergence (8)
    +mkinparplot(fit)
    +
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkinplot.html b/docs/dev/reference/mkinplot.html index 120bddb3..a8430f30 100644 --- a/docs/dev/reference/mkinplot.html +++ b/docs/dev/reference/mkinplot.html @@ -1,68 +1,13 @@ - - - - - - - -Plot the observed data and the fitted model of an mkinfit object — mkinplot • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot the observed data and the fitted model of an mkinfit object — mkinplot • mkin - - + + - - -
    -
    - -
    - -
    +

    Deprecated function. It now only calls the plot method -plot.mkinfit.

    +plot.mkinfit.

    +
    + +
    +
    mkinplot(fit, ...)
    -
    mkinplot(fit, ...)
    +
    +

    Arguments

    +
    fit
    +

    an object of class mkinfit.

    -

    Arguments

    - - - - - - - - - - -
    fit

    an object of class mkinfit.

    ...

    further arguments passed to plot.mkinfit.

    -

    Value

    +
    ...
    +

    further arguments passed to plot.mkinfit.

    -

    The function is called for its side effect.

    -

    Author

    +
    +
    +

    Value

    + +

    The function is called for its side effect.

    +
    +
    +

    Author

    Johannes Ranke

    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mkinpredict.html b/docs/dev/reference/mkinpredict.html index 0e645b51..10d2c9a9 100644 --- a/docs/dev/reference/mkinpredict.html +++ b/docs/dev/reference/mkinpredict.html @@ -19,7 +19,7 @@ kinetic parameters and initial values for the state variables."> mkin - 1.2.0 + 1.2.2 @@ -372,11 +372,10 @@ as these always return mapped output.

    c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "analytical", use_compiled = FALSE)[201,]) } -#> Loading required package: rbenchmark #> test relative elapsed #> 2 deSolve_compiled 1.0 0.005 -#> 1 eigen 4.2 0.021 -#> 4 analytical 4.2 0.021 +#> 4 analytical 1.0 0.005 +#> 1 eigen 4.4 0.022 #> 3 deSolve 41.0 0.205 # \dontrun{ diff --git a/docs/dev/reference/mkinresplot-1.png b/docs/dev/reference/mkinresplot-1.png index ffd34f6f..97ccd762 100644 Binary files a/docs/dev/reference/mkinresplot-1.png and b/docs/dev/reference/mkinresplot-1.png differ diff --git a/docs/dev/reference/mkinresplot.html b/docs/dev/reference/mkinresplot.html index 30377f2c..4d99f5be 100644 --- a/docs/dev/reference/mkinresplot.html +++ b/docs/dev/reference/mkinresplot.html @@ -1,70 +1,15 @@ - - - - - - - -Function to plot residuals stored in an mkin object — mkinresplot • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to plot residuals stored in an mkin object — mkinresplot • mkin - - - - - - - - - + + - - - - -
    -
    - -
    - -
    +

    This function plots the residuals for the specified subset of the observed variables from an mkinfit object. A combined plot of the fitted model and -the residuals can be obtained using plot.mkinfit using the +the residuals can be obtained using plot.mkinfit using the argument show_residuals = TRUE.

    -
    mkinresplot(
    -  object,
    -  obs_vars = names(object$mkinmod$map),
    -  xlim = c(0, 1.1 * max(object$data$time)),
    -  standardized = FALSE,
    -  xlab = "Time",
    -  ylab = ifelse(standardized, "Standardized residual", "Residual"),
    -  maxabs = "auto",
    -  legend = TRUE,
    -  lpos = "topright",
    -  col_obs = "auto",
    -  pch_obs = "auto",
    -  frame = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    object

    A fit represented in an mkinfit object.

    obs_vars

    A character vector of names of the observed variables for +

    +
    mkinresplot(
    +  object,
    +  obs_vars = names(object$mkinmod$map),
    +  xlim = c(0, 1.1 * max(object$data$time)),
    +  standardized = FALSE,
    +  xlab = "Time",
    +  ylab = ifelse(standardized, "Standardized residual", "Residual"),
    +  maxabs = "auto",
    +  legend = TRUE,
    +  lpos = "topright",
    +  col_obs = "auto",
    +  pch_obs = "auto",
    +  frame = TRUE,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    + + +
    obs_vars
    +

    A character vector of names of the observed variables for which residuals should be plotted. Defaults to all observed variables in -the model

    xlim

    plot range in x direction.

    standardized

    Should the residuals be standardized by dividing by the -standard deviation given by the error model of the fit?

    xlab

    Label for the x axis.

    ylab

    Label for the y axis.

    maxabs

    Maximum absolute value of the residuals. This is used for the -scaling of the y axis and defaults to "auto".

    legend

    Should a legend be plotted?

    lpos

    Where should the legend be placed? Default is "topright". Will -be passed on to legend.

    col_obs

    Colors for the observed variables.

    pch_obs

    Symbols to be used for the observed variables.

    frame

    Should a frame be drawn around the plots?

    ...

    further arguments passed to plot.

    - -

    Value

    - -

    Nothing is returned by this function, as it is called for its side -effect, namely to produce a plot.

    -

    See also

    +the model

    -

    mkinplot, for a way to plot the data and the fitted -lines of the mkinfit object, and plot_res for a function -combining the plot of the fit and the residual plot.

    -

    Author

    +
    xlim
    +

    plot range in x direction.

    + + +
    standardized
    +

    Should the residuals be standardized by dividing by the +standard deviation given by the error model of the fit?

    + + +
    xlab
    +

    Label for the x axis.

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    maxabs
    +

    Maximum absolute value of the residuals. This is used for the +scaling of the y axis and defaults to "auto".

    + + +
    legend
    +

    Should a legend be plotted?

    + + +
    lpos
    +

    Where should the legend be placed? Default is "topright". Will +be passed on to legend.

    + + +
    col_obs
    +

    Colors for the observed variables.

    + + +
    pch_obs
    +

    Symbols to be used for the observed variables.

    + + +
    frame
    +

    Should a frame be drawn around the plots?

    + + +
    ...
    +

    further arguments passed to plot.

    + +
    +
    +

    Value

    + + +

    Nothing is returned by this function, as it is called for its side +effect, namely to produce a plot.

    +
    +
    +

    See also

    +

    mkinplot, for a way to plot the data and the fitted +lines of the mkinfit object, and plot_res for a function +combining the plot of the fit and the residual plot.

    +
    +
    +

    Author

    Johannes Ranke and Katrin Lindenberger

    +
    -

    Examples

    -
    -model <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO")) -
    #> Temporary DLL for differentials generated and loaded
    fit <- mkinfit(model, FOCUS_2006_D, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    mkinresplot(fit, "m1") -
    -
    +
    +

    Examples

    +
    
    +model <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
    +#> Temporary DLL for differentials generated and loaded
    +fit <- mkinfit(model, FOCUS_2006_D, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +mkinresplot(fit, "m1")
    +
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/mmkin-1.png b/docs/dev/reference/mmkin-1.png index 701a6d6a..8ad9c11d 100644 Binary files a/docs/dev/reference/mmkin-1.png and b/docs/dev/reference/mmkin-1.png differ diff --git a/docs/dev/reference/mmkin-2.png b/docs/dev/reference/mmkin-2.png index 5277b389..da2a48a8 100644 Binary files a/docs/dev/reference/mmkin-2.png and b/docs/dev/reference/mmkin-2.png differ diff --git a/docs/dev/reference/mmkin-3.png b/docs/dev/reference/mmkin-3.png index 2659cd61..10d3f35b 100644 Binary files a/docs/dev/reference/mmkin-3.png and b/docs/dev/reference/mmkin-3.png differ diff --git a/docs/dev/reference/mmkin-4.png b/docs/dev/reference/mmkin-4.png index ae16ee79..132380a8 100644 Binary files a/docs/dev/reference/mmkin-4.png and b/docs/dev/reference/mmkin-4.png differ diff --git a/docs/dev/reference/mmkin-5.png b/docs/dev/reference/mmkin-5.png index 2b9dc831..4bfcc55e 100644 Binary files a/docs/dev/reference/mmkin-5.png and b/docs/dev/reference/mmkin-5.png differ diff --git a/docs/dev/reference/mmkin.html b/docs/dev/reference/mmkin.html index c385bbf6..5aa259f9 100644 --- a/docs/dev/reference/mmkin.html +++ b/docs/dev/reference/mmkin.html @@ -1,70 +1,15 @@ - - - - - - - -Fit one or more kinetic models with one or more state variables to one or -more datasets — mmkin • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Fit one or more kinetic models with one or more state variables to one or +more datasets — mmkin • mkin - - - - + + -
    -
    - -
    - -
    +
    -

    This function calls mkinfit on all combinations of models and +

    This function calls mkinfit on all combinations of models and datasets specified in its first two arguments.

    -
    mmkin(
    -  models = c("SFO", "FOMC", "DFOP"),
    -  datasets,
    -  cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
    -  cluster = NULL,
    -  ...
    -)
    +    
    +
    mmkin(
    +  models = c("SFO", "FOMC", "DFOP"),
    +  datasets,
    +  cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
    +  cluster = NULL,
    +  ...
    +)
    +
    +# S3 method for mmkin
    +print(x, ...)
    +
    + +
    +

    Arguments

    +
    models
    +

    Either a character vector of shorthand names like +c("SFO", "FOMC", "DFOP", "HS", "SFORB"), or an optionally named +list of mkinmod objects.

    + -# S3 method for mmkin -print(x, ...)
    +
    datasets
    +

    An optionally named list of datasets suitable as observed +data for mkinfit.

    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    models

    Either a character vector of shorthand names like -c("SFO", "FOMC", "DFOP", "HS", "SFORB"), or an optionally named -list of mkinmod objects.

    datasets

    An optionally named list of datasets suitable as observed -data for mkinfit.

    cores

    The number of cores to be used for multicore processing. This + +

    cores
    +

    The number of cores to be used for multicore processing. This is only used when the cluster argument is NULL. On Windows machines, cores > 1 is not supported, you need to use the cluster argument to use multiple logical processors. Per default, all cores -detected by parallel::detectCores() are used, except on Windows where -the default is 1.

    cluster

    A cluster as returned by makeCluster to be used -for parallel execution.

    ...

    Not used.

    x

    An mmkin object.

    +detected by parallel::detectCores() are used, except on Windows where +the default is 1.

    -

    Value

    -

    A two-dimensional array of mkinfit -objects and/or try-errors that can be indexed using the model names for the -first index (row index) and the dataset names for the second index (column -index).

    -

    See also

    +
    cluster
    +

    A cluster as returned by makeCluster to be used +for parallel execution.

    -

    [.mmkin for subsetting, plot.mmkin for -plotting.

    -

    Author

    -

    Johannes Ranke

    +
    ...
    +

    Not used.

    -

    Examples

    -
    -# \dontrun{ -m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"), - M1 = mkinsub("SFO", "M2"), - M2 = mkinsub("SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -m_synth_FOMC_lin <- mkinmod(parent = mkinsub("FOMC", "M1"), - M1 = mkinsub("SFO", "M2"), - M2 = mkinsub("SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -models <- list(SFO_lin = m_synth_SFO_lin, FOMC_lin = m_synth_FOMC_lin) -datasets <- lapply(synthetic_data_for_UBA_2014[1:3], function(x) x$data) -names(datasets) <- paste("Dataset", 1:3) -time_default <- system.time(fits.0 <- mmkin(models, datasets, quiet = TRUE)) -time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) +
    x
    +

    An mmkin object.

    -time_default -
    #> user system elapsed -#> 4.771 0.576 1.803
    time_1 -
    #> user system elapsed -#> 5.779 0.000 5.781
    -endpoints(fits.0[["SFO_lin", 2]]) -
    #> $ff -#> parent_M1 parent_sink M1_M2 M1_sink -#> 0.7340481 0.2659519 0.7505683 0.2494317 -#> -#> $distimes -#> DT50 DT90 -#> parent 0.877769 2.915885 -#> M1 2.325744 7.725956 -#> M2 33.720100 112.015749 -#>
    -# plot.mkinfit handles rows or columns of mmkin result objects -plot(fits.0[1, ]) -
    plot(fits.0[1, ], obs_var = c("M1", "M2")) -
    plot(fits.0[, 1]) -
    # Use double brackets to extract a single mkinfit object, which will be plotted -# by plot.mkinfit and can be plotted using plot_sep -plot(fits.0[[1, 1]], sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE) -
    plot_sep(fits.0[[1, 1]]) -# Plotting with mmkin (single brackets, extracting an mmkin object) does not -# allow to plot the observed variables separately -plot(fits.0[1, 1]) -
    -# On Windows, we can use multiple cores by making a cluster using the parallel -# package, which gets loaded with mkin, and passing it to mmkin, e.g. -cl <- makePSOCKcluster(12) -f <- mmkin(c("SFO", "FOMC", "DFOP"), - list(A = FOCUS_2006_A, B = FOCUS_2006_B, C = FOCUS_2006_C, D = FOCUS_2006_D), - cluster = cl, quiet = TRUE) -print(f) -
    #> <mmkin> object -#> Status of individual fits: -#> -#> dataset -#> model A B C D -#> SFO OK OK OK OK -#> FOMC OK OK OK OK -#> DFOP OK OK OK OK -#> -#> OK: No warnings
    # We get false convergence for the FOMC fit to FOCUS_2006_A because this -# dataset is really SFO, and the FOMC fit is overparameterised -stopCluster(cl) -# } +
    +
    +

    Value

    + -
    +

    A two-dimensional array of mkinfit

    + + +

    objects and/or try-errors that can be indexed using the model names for the +first index (row index) and the dataset names for the second index (column +index).

    +
    +
    +

    See also

    +

    [.mmkin for subsetting, plot.mmkin for +plotting.

    +
    +
    +

    Author

    +

    Johannes Ranke

    +
    + +
    +

    Examples

    +
    
    +# \dontrun{
    +m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"),
    +                           M1 = mkinsub("SFO", "M2"),
    +                           M2 = mkinsub("SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +m_synth_FOMC_lin <- mkinmod(parent = mkinsub("FOMC", "M1"),
    +                            M1 = mkinsub("SFO", "M2"),
    +                            M2 = mkinsub("SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +models <- list(SFO_lin = m_synth_SFO_lin, FOMC_lin = m_synth_FOMC_lin)
    +datasets <- lapply(synthetic_data_for_UBA_2014[1:3], function(x) x$data)
    +names(datasets) <- paste("Dataset", 1:3)
    +
    +time_default <- system.time(fits.0 <- mmkin(models, datasets, quiet = TRUE))
    +time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE))
    +
    +time_default
    +#>    user  system elapsed 
    +#>   7.113   0.837   2.580 
    +time_1
    +#>    user  system elapsed 
    +#>   5.617   0.008   5.626 
    +
    +endpoints(fits.0[["SFO_lin", 2]])
    +#> $ff
    +#>   parent_M1 parent_sink       M1_M2     M1_sink 
    +#>   0.7340481   0.2659519   0.7505683   0.2494317 
    +#> 
    +#> $distimes
    +#>             DT50       DT90
    +#> parent  0.877769   2.915885
    +#> M1      2.325744   7.725956
    +#> M2     33.720100 112.015749
    +#> 
    +
    +# plot.mkinfit handles rows or columns of mmkin result objects
    +plot(fits.0[1, ])
    +
    +plot(fits.0[1, ], obs_var = c("M1", "M2"))
    +
    +plot(fits.0[, 1])
    +
    +# Use double brackets to extract a single mkinfit object, which will be plotted
    +# by plot.mkinfit and can be plotted using plot_sep
    +plot(fits.0[[1, 1]], sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE)
    +
    +plot_sep(fits.0[[1, 1]])
    +# Plotting with mmkin (single brackets, extracting an mmkin object) does not
    +# allow to plot the observed variables separately
    +plot(fits.0[1, 1])
    +
    +
    +# On Windows, we can use multiple cores by making a cluster using the parallel
    +# package, which gets loaded with mkin, and passing it to mmkin, e.g.
    +cl <- makePSOCKcluster(12)
    +#> Error in makePSOCKcluster(12): could not find function "makePSOCKcluster"
    +f <- mmkin(c("SFO", "FOMC", "DFOP"),
    +  list(A = FOCUS_2006_A, B = FOCUS_2006_B, C = FOCUS_2006_C, D = FOCUS_2006_D),
    +  cluster = cl, quiet = TRUE)
    +#> Error in system.time({    if (is.null(cluster)) {        results <- parallel::mclapply(as.list(1:n.fits), fit_function,             mc.cores = cores, mc.preschedule = FALSE)    }    else {        results <- parallel::parLapply(cluster, as.list(1:n.fits),             fit_function)    }}): object 'cl' not found
    +#> Timing stopped at: 0 0 0.001
    +print(f)
    +#> Error in print(f): object 'f' not found
    +# We get false convergence for the FOMC fit to FOCUS_2006_A because this
    +# dataset is really SFO, and the FOMC fit is overparameterised
    +stopCluster(cl)
    +#> Error in stopCluster(cl): could not find function "stopCluster"
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/multistart-1.png b/docs/dev/reference/multistart-1.png index 7fc24a04..dcd493c9 100644 Binary files a/docs/dev/reference/multistart-1.png and b/docs/dev/reference/multistart-1.png differ diff --git a/docs/dev/reference/multistart-2.png b/docs/dev/reference/multistart-2.png index 7553a51a..e1983f12 100644 Binary files a/docs/dev/reference/multistart-2.png and b/docs/dev/reference/multistart-2.png differ diff --git a/docs/dev/reference/multistart.html b/docs/dev/reference/multistart.html index 3f5c4b35..0f2988bd 100644 --- a/docs/dev/reference/multistart.html +++ b/docs/dev/reference/multistart.html @@ -22,7 +22,7 @@ mixed-effects models by Duchesne et al (2021)."> mkin - 1.2.0 + 1.2.2 @@ -64,7 +64,10 @@ mixed-effects models by Duchesne et al (2021).">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/nafta-1.png b/docs/dev/reference/nafta-1.png index 4f0d7833..5d2d434b 100644 Binary files a/docs/dev/reference/nafta-1.png and b/docs/dev/reference/nafta-1.png differ diff --git a/docs/dev/reference/nafta.html b/docs/dev/reference/nafta.html index 6fb797a5..eafbca7f 100644 --- a/docs/dev/reference/nafta.html +++ b/docs/dev/reference/nafta.html @@ -1,71 +1,16 @@ - - - - - - - -Evaluate parent kinetics using the NAFTA guidance — nafta • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Evaluate parent kinetics using the NAFTA guidance — nafta • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +
    -

    The function fits the SFO, IORE and DFOP models using mmkin +

    The function fits the SFO, IORE and DFOP models using mmkin and returns an object of class nafta that has methods for printing and plotting.

    Print nafta objects. The results for the three models are printed in the order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.

    -
    nafta(ds, title = NA, quiet = FALSE, ...)
    -
    -# S3 method for nafta
    -print(x, quiet = TRUE, digits = 3, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ds

    A dataframe that must contain one variable called "time" with the -time values specified by the time argument, one column called -"name" with the grouping of the observed values, and finally one column of -observed values called "value".

    title

    Optional title of the dataset

    quiet

    Should the evaluation text be shown?

    ...

    Further arguments passed to mmkin (not for the -printing method).

    x

    An nafta object.

    digits

    Number of digits to be used for printing parameters and -dissipation times.

    - -

    Source

    +
    +
    nafta(ds, title = NA, quiet = FALSE, ...)
    +
    +# S3 method for nafta
    +print(x, quiet = TRUE, digits = 3, ...)
    +
    +
    +

    Source

    NAFTA (2011) Guidance for evaluating and calculating degradation kinetics in environmental media. NAFTA Technical Working Group on Pesticides -https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation +https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation accessed 2019-02-22

    US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to Calculate Representative Half-life Values and Characterizing Pesticide Degradation -https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    -

    Value

    +https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    +
    +
    +

    Arguments

    +
    ds
    +

    A dataframe that must contain one variable called "time" with the +time values specified by the time argument, one column called +"name" with the grouping of the observed values, and finally one column of +observed values called "value".

    + + +
    title
    +

    Optional title of the dataset

    + -

    An list of class nafta. The list element named "mmkin" is the -mmkin object containing the fits of the three models. The +

    quiet
    +

    Should the evaluation text be shown?

    + + +
    ...
    +

    Further arguments passed to mmkin (not for the +printing method).

    + + +
    x
    +

    An nafta object.

    + + +
    digits
    +

    Number of digits to be used for printing parameters and +dissipation times.

    + +
    +
    +

    Value

    + + +

    An list of class nafta. The list element named "mmkin" is the +mmkin object containing the fits of the three models. The list element named "title" contains the title of the dataset used. The list element "data" contains the dataset used in the fits.

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1) -
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation) -
    #> Sums of squares: -#> SFO IORE DFOP -#> 1378.6832 615.7730 517.8836 -#> -#> Critical sum of squares for checking the SFO model: -#> [1] 717.4598 -#> -#> Parameters: -#> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 83.7558 1.80e-14 77.18268 90.3288 -#> k_parent 0.0017 7.43e-05 0.00112 0.0026 -#> sigma 8.7518 1.22e-05 5.64278 11.8608 -#> -#> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 -#> k__iore_parent 8.40e-14 NA 1.79e-18 3.94e-09 -#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 -#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 -#> -#> $DFOP -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02 -#> k1 4.24e-02 5.92e-03 2.03e-02 8.88e-02 -#> k2 8.24e-04 6.48e-03 3.89e-04 1.75e-03 -#> g 2.88e-01 2.47e-05 1.95e-01 4.03e-01 -#> sigma 5.36e+00 2.22e-05 3.43e+00 7.30e+00 -#> -#> -#> DTx values: -#> DT50 DT90 DT50_rep -#> SFO 407 1350 407 -#> IORE 541 5190000 1560000 -#> DFOP 429 2380 841 -#> -#> Representative half-life: -#> [1] 841.41
    plot(nafta_evaluation) -
    -
    +
    +

    Examples

    +
    
    +  nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    +#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +#> The representative half-life of the IORE model is longer than the one corresponding
    +#> to the terminal degradation rate found with the DFOP model.
    +#> The representative half-life obtained from the DFOP model may be used
    +  print(nafta_evaluation)
    +#> Sums of squares:
    +#>       SFO      IORE      DFOP 
    +#> 1378.6832  615.7730  517.8836 
    +#> 
    +#> Critical sum of squares for checking the SFO model:
    +#> [1] 717.4598
    +#> 
    +#> Parameters:
    +#> $SFO
    +#>          Estimate   Pr(>t)    Lower   Upper
    +#> parent_0  83.7558 1.80e-14 77.18268 90.3288
    +#> k_parent   0.0017 7.43e-05  0.00112  0.0026
    +#> sigma      8.7518 1.22e-05  5.64278 11.8608
    +#> 
    +#> $IORE
    +#>                Estimate Pr(>t)    Lower    Upper
    +#> parent_0       9.69e+01     NA 8.88e+01 1.05e+02
    +#> k__iore_parent 8.40e-14     NA 1.79e-18 3.94e-09
    +#> N_parent       6.68e+00     NA 4.19e+00 9.17e+00
    +#> sigma          5.85e+00     NA 3.76e+00 7.94e+00
    +#> 
    +#> $DFOP
    +#>          Estimate   Pr(>t)    Lower    Upper
    +#> parent_0 9.76e+01 1.94e-13 9.02e+01 1.05e+02
    +#> k1       4.24e-02 5.92e-03 2.03e-02 8.88e-02
    +#> k2       8.24e-04 6.48e-03 3.89e-04 1.75e-03
    +#> g        2.88e-01 2.47e-05 1.95e-01 4.03e-01
    +#> sigma    5.36e+00 2.22e-05 3.43e+00 7.30e+00
    +#> 
    +#> 
    +#> DTx values:
    +#>      DT50    DT90 DT50_rep
    +#> SFO   407    1350      407
    +#> IORE  541 5190000  1560000
    +#> DFOP  429    2380      841
    +#> 
    +#> Representative half-life:
    +#> [1] 841.41
    +  plot(nafta_evaluation)
    +
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/nlme-1.png b/docs/dev/reference/nlme-1.png index 67cc7f3c..c4fc9d31 100644 Binary files a/docs/dev/reference/nlme-1.png and b/docs/dev/reference/nlme-1.png differ diff --git a/docs/dev/reference/nlme-2.png b/docs/dev/reference/nlme-2.png index bb1e6f81..d9512f41 100644 Binary files a/docs/dev/reference/nlme-2.png and b/docs/dev/reference/nlme-2.png differ diff --git a/docs/dev/reference/nlme.html b/docs/dev/reference/nlme.html index e7844299..b8b36d56 100644 --- a/docs/dev/reference/nlme.html +++ b/docs/dev/reference/nlme.html @@ -20,7 +20,7 @@ datasets. They are used internally by the nlme.mmkin() method."> mkin - 1.1.0 + 1.2.2 @@ -29,7 +29,7 @@ datasets. They are used internally by the nlme.mmkin() method.">Functions and data
  • - Example evaluation of FOCUS Example Dataset Z + Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models +
  • +
  • + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +62,10 @@ datasets. They are used internally by the nlme.mmkin() method.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -90,20 +99,25 @@ datasets. They are used internally by the nlme.m
    -
    nlme_function(object)
    -
    -nlme_data(object)
    +
    nlme_function(object)
    +
    +nlme_data(object)

    Arguments

    object

    An mmkin row object containing several fits of the same model to different datasets

    +

    Value

    -

    A function that can be used with nlme -A groupedData object

    + + +

    A function that can be used with nlme

    + + +

    A groupedData object

    See also

    @@ -112,78 +126,78 @@ A

    Examples

    -
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    -m_SFO <- mkinmod(parent = mkinsub("SFO"))
    -d_SFO_1 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.1),
    -  c(parent = 98), sampling_times)
    -d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    -d_SFO_2 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.05),
    -  c(parent = 102), sampling_times)
    -d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    -d_SFO_3 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.02),
    -  c(parent = 103), sampling_times)
    -d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    -
    -d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    -d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    -d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    -ds <- c(d1 = d1, d2 = d2, d3 = d3)
    -
    -f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    -mean_dp <- mean_degparms(f)
    -grouped_data <- nlme_data(f)
    -nlme_f <- nlme_function(f)
    -# These assignments are necessary for these objects to be
    -# visible to nlme and augPred when evaluation is done by
    -# pkgdown to generate the html docs.
    -assign("nlme_f", nlme_f, globalenv())
    -assign("grouped_data", grouped_data, globalenv())
    -
    -library(nlme)
    -m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    -  data = grouped_data,
    -  fixed = parent_0 + log_k_parent_sink ~ 1,
    -  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    -  start = mean_dp)
    -summary(m_nlme)
    +    
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +m_SFO <- mkinmod(parent = mkinsub("SFO"))
    +d_SFO_1 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.1),
    +  c(parent = 98), sampling_times)
    +d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    +d_SFO_2 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.05),
    +  c(parent = 102), sampling_times)
    +d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    +d_SFO_3 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.02),
    +  c(parent = 103), sampling_times)
    +d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    +
    +d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    +d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    +d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    +ds <- c(d1 = d1, d2 = d2, d3 = d3)
    +
    +f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    +mean_dp <- mean_degparms(f)
    +grouped_data <- nlme_data(f)
    +nlme_f <- nlme_function(f)
    +# These assignments are necessary for these objects to be
    +# visible to nlme and augPred when evaluation is done by
    +# pkgdown to generate the html docs.
    +assign("nlme_f", nlme_f, globalenv())
    +assign("grouped_data", grouped_data, globalenv())
    +
    +library(nlme)
    +m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    +  data = grouped_data,
    +  fixed = parent_0 + log_k_parent_sink ~ 1,
    +  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    +  start = mean_dp)
    +summary(m_nlme)
     #> Nonlinear mixed-effects model fit by maximum likelihood
     #>   Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) 
     #>   Data: grouped_data 
     #>        AIC      BIC    logLik
    -#>   300.6824 310.2426 -145.3412
    +#>   266.6428 275.8935 -128.3214
     #> 
     #> Random effects:
     #>  Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1)
     #>  Level: ds
     #>  Structure: Diagonal
    -#>         parent_0 log_k_parent_sink Residual
    -#> StdDev: 1.697361         0.6801209 3.666073
    +#>            parent_0 log_k_parent_sink Residual
    +#> StdDev: 0.000368491         0.7058039 3.065183
     #> 
     #> Fixed effects:  parent_0 + log_k_parent_sink ~ 1 
    -#>                       Value Std.Error DF  t-value p-value
    -#> parent_0          100.99378 1.3890416 46 72.70753       0
    -#> log_k_parent_sink  -3.07521 0.4018589 46 -7.65246       0
    +#>                       Value Std.Error DF   t-value p-value
    +#> parent_0          101.18323 0.7900461 43 128.07257       0
    +#> log_k_parent_sink  -3.08708 0.4171755 43  -7.39995       0
     #>  Correlation: 
     #>                   prnt_0
    -#> log_k_parent_sink 0.027 
    +#> log_k_parent_sink 0.031 
     #> 
     #> Standardized Within-Group Residuals:
    -#>        Min         Q1        Med         Q3        Max 
    -#> -1.9942823 -0.5622565  0.1791579  0.7165038  2.0704781 
    +#>         Min          Q1         Med          Q3         Max 
    +#> -2.38427070 -0.52059848  0.03593021  0.39987268  2.73188969 
     #> 
    -#> Number of Observations: 50
    +#> Number of Observations: 47
     #> Number of Groups: 3 
    -plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
    +plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
     
    -# augPred does not work on fits with more than one state
    -# variable
    -#
    -# The procedure is greatly simplified by the nlme.mmkin function
    -f_nlme <- nlme(f)
    -plot(f_nlme)
    +# augPred does not work on fits with more than one state
    +# variable
    +#
    +# The procedure is greatly simplified by the nlme.mmkin function
    +f_nlme <- nlme(f)
    +plot(f_nlme)
     
     
    @@ -199,7 +213,7 @@ A -

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/dev/reference/nlme.mmkin.html b/docs/dev/reference/nlme.mmkin.html index 2bbadb88..8c069470 100644 --- a/docs/dev/reference/nlme.mmkin.html +++ b/docs/dev/reference/nlme.mmkin.html @@ -19,7 +19,7 @@ have been obtained by fitting the same model to a list of datasets."> mkin - 1.1.2 + 1.2.2 @@ -46,11 +46,14 @@ have been obtained by fitting the same model to a list of datasets.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ have been obtained by fitting the same model to a list of datasets.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -97,7 +103,7 @@ have been obtained by fitting the same model to a list of datasets.

    data = "auto", fixed = lapply(as.list(names(mean_degparms(model))), function(el) eval(parse(text = paste(el, 1, sep = "~")))), - random = pdDiag(fixed), + random = pdDiag(fixed), groups, start = mean_degparms(model, random = TRUE, test_log_parms = TRUE), correlation = NULL, diff --git a/docs/dev/reference/nobs.mkinfit.html b/docs/dev/reference/nobs.mkinfit.html index 0b6c963c..8c2d04f0 100644 --- a/docs/dev/reference/nobs.mkinfit.html +++ b/docs/dev/reference/nobs.mkinfit.html @@ -1,67 +1,12 @@ - - - - - - - -Number of observations on which an mkinfit object was fitted — nobs.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Number of observations on which an mkinfit object was fitted — nobs.mkinfit • mkin - - + + - - -
    -
    - -
    - -
    +
    @@ -147,51 +92,49 @@

    Number of observations on which an mkinfit object was fitted

    -
    # S3 method for mkinfit
    -nobs(object, ...)
    +
    +
    # S3 method for mkinfit
    +nobs(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    An mkinfit object

    -

    Arguments

    - - - - - - - - - - -
    object

    An mkinfit object

    ...

    For compatibility with the generic method

    -

    Value

    +
    ...
    +

    For compatibility with the generic method

    -

    The number of rows in the data included in the mkinfit object

    +
    +
    +

    Value

    + + +

    The number of rows in the data included in the mkinfit object

    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/parms.html b/docs/dev/reference/parms.html index 95db0593..b0385c8a 100644 --- a/docs/dev/reference/parms.html +++ b/docs/dev/reference/parms.html @@ -19,7 +19,7 @@ without considering the error structure that was assumed for the fit."> mkin - 1.2.0 + 1.2.2 @@ -61,7 +61,10 @@ without considering the error structure that was assumed for the fit.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/parplot.html b/docs/dev/reference/parplot.html index ffe93e6c..9852b694 100644 --- a/docs/dev/reference/parplot.html +++ b/docs/dev/reference/parplot.html @@ -19,7 +19,7 @@ or by their medians as proposed in the paper by Duchesne et al. (2021)."> mkin - 1.2.0 + 1.2.2 @@ -61,7 +61,10 @@ or by their medians as proposed in the paper by Duchesne et al. (2021).">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -134,6 +137,12 @@ If 'median', parameters are scaled using the median parameters from all fits.

    Title of the plot

    +
    +

    Details

    +

    Starting values of degradation model parameters and error model parameters +are shown as green circles. The results obtained in the original run +are shown as red circles.

    +

    References

    Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical diff --git a/docs/dev/reference/plot.mixed.mmkin.html b/docs/dev/reference/plot.mixed.mmkin.html index b1c62721..4bd170a1 100644 --- a/docs/dev/reference/plot.mixed.mmkin.html +++ b/docs/dev/reference/plot.mixed.mmkin.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2

    @@ -59,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/plot.mkinfit.html b/docs/dev/reference/plot.mkinfit.html index 764f0699..d125a606 100644 --- a/docs/dev/reference/plot.mkinfit.html +++ b/docs/dev/reference/plot.mkinfit.html @@ -19,7 +19,7 @@ observed data together with the solution of the fitted model."> mkin - 1.1.2 + 1.2.2 @@ -46,11 +46,14 @@ observed data together with the solution of the fitted model.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ observed data together with the solution of the fitted model.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/plot.mmkin-1.png b/docs/dev/reference/plot.mmkin-1.png index 647dfb8a..235e33a7 100644 Binary files a/docs/dev/reference/plot.mmkin-1.png and b/docs/dev/reference/plot.mmkin-1.png differ diff --git a/docs/dev/reference/plot.mmkin-2.png b/docs/dev/reference/plot.mmkin-2.png index 1bc1c9db..7af84edf 100644 Binary files a/docs/dev/reference/plot.mmkin-2.png and b/docs/dev/reference/plot.mmkin-2.png differ diff --git a/docs/dev/reference/plot.mmkin-3.png b/docs/dev/reference/plot.mmkin-3.png index 50d6ffac..56bfac50 100644 Binary files a/docs/dev/reference/plot.mmkin-3.png and b/docs/dev/reference/plot.mmkin-3.png differ diff --git a/docs/dev/reference/plot.mmkin-4.png b/docs/dev/reference/plot.mmkin-4.png index e049fa16..5da05f40 100644 Binary files a/docs/dev/reference/plot.mmkin-4.png and b/docs/dev/reference/plot.mmkin-4.png differ diff --git a/docs/dev/reference/plot.mmkin-5.png b/docs/dev/reference/plot.mmkin-5.png index 2421995b..3ec224f4 100644 Binary files a/docs/dev/reference/plot.mmkin-5.png and b/docs/dev/reference/plot.mmkin-5.png differ diff --git a/docs/dev/reference/plot.mmkin.html b/docs/dev/reference/plot.mmkin.html index 9ca0df94..09f311c5 100644 --- a/docs/dev/reference/plot.mmkin.html +++ b/docs/dev/reference/plot.mmkin.html @@ -1,71 +1,16 @@ - - - - - - - -Plot model fits (observed and fitted) and the residuals for a row or column -of an mmkin object — plot.mmkin • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot model fits (observed and fitted) and the residuals for a row or column +of an mmkin object — plot.mmkin • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    -

    When x is a row selected from an mmkin object ([.mmkin), the +

    When x is a row selected from an mmkin object ([.mmkin), the same model fitted for at least one dataset is shown. When it is a column, the fit of at least one model to the same dataset is shown.

    -
    # S3 method for mmkin
    -plot(
    -  x,
    -  main = "auto",
    -  legends = 1,
    -  resplot = c("time", "errmod"),
    -  ylab = "Residue",
    -  standardized = FALSE,
    -  show_errmin = TRUE,
    -  errmin_var = "All data",
    -  errmin_digits = 3,
    -  cex = 0.7,
    -  rel.height.middle = 0.9,
    -  ymax = "auto",
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    x

    An object of class mmkin, with either one row or one -column.

    main

    The main title placed on the outer margin of the plot.

    legends

    An index for the fits for which legends should be shown.

    resplot

    Should the residuals plotted against time, using -mkinresplot, or as squared residuals against predicted -values, with the error model, using mkinerrplot.

    ylab

    Label for the y axis.

    standardized

    Should the residuals be standardized? This option -is passed to mkinresplot, it only takes effect if -resplot = "time".

    show_errmin

    Should the chi2 error level be shown on top of the plots -to the left?

    errmin_var

    The variable for which the FOCUS chi2 error value should -be shown.

    errmin_digits

    The number of significant digits for rounding the FOCUS -chi2 error percentage.

    cex

    Passed to the plot functions and mtext.

    rel.height.middle

    The relative height of the middle plot, if more -than two rows of plots are shown.

    ymax

    Maximum y axis value for plot.mkinfit.

    ...

    Further arguments passed to plot.mkinfit and -mkinresplot.

    - -

    Value

    - -

    The function is called for its side effect.

    -

    Details

    - -

    If the current plot device is a tikz device, then -latex is being used for the formatting of the chi2 error level.

    -

    Author

    +
    +
    # S3 method for mmkin
    +plot(
    +  x,
    +  main = "auto",
    +  legends = 1,
    +  resplot = c("time", "errmod"),
    +  ylab = "Residue",
    +  standardized = FALSE,
    +  show_errmin = TRUE,
    +  errmin_var = "All data",
    +  errmin_digits = 3,
    +  cex = 0.7,
    +  rel.height.middle = 0.9,
    +  ymax = "auto",
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    x
    +

    An object of class mmkin, with either one row or one +column.

    + + +
    main
    +

    The main title placed on the outer margin of the plot.

    + + +
    legends
    +

    An index for the fits for which legends should be shown.

    + + +
    resplot
    +

    Should the residuals plotted against time, using +mkinresplot, or as squared residuals against predicted +values, with the error model, using mkinerrplot.

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    standardized
    +

    Should the residuals be standardized? This option +is passed to mkinresplot, it only takes effect if +resplot = "time".

    + + +
    show_errmin
    +

    Should the chi2 error level be shown on top of the plots +to the left?

    + + +
    errmin_var
    +

    The variable for which the FOCUS chi2 error value should +be shown.

    + +
    errmin_digits
    +

    The number of significant digits for rounding the FOCUS +chi2 error percentage.

    + + +
    cex
    +

    Passed to the plot functions and mtext.

    + + +
    rel.height.middle
    +

    The relative height of the middle plot, if more +than two rows of plots are shown.

    + + +
    ymax
    +

    Maximum y axis value for plot.mkinfit.

    + + +
    ...
    +

    Further arguments passed to plot.mkinfit and +mkinresplot.

    + +
    +
    +

    Value

    + + +

    The function is called for its side effect.

    +
    +
    +

    Details

    +

    If the current plot device is a tikz device, then +latex is being used for the formatting of the chi2 error level.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    - # \dontrun{ - # Only use one core not to offend CRAN checks - fits <- mmkin(c("FOMC", "HS"), - list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles - cores = 1, quiet = TRUE, error_model = "tc") -
    #> Warning: Optimisation did not converge: -#> iteration limit reached without convergence (10)
    plot(fits[, "FOCUS C"]) -
    plot(fits["FOMC", ]) -
    plot(fits["FOMC", ], show_errmin = FALSE) -
    - # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot - # height should be smaller than the plot width (this is not possible for the html pages - # generated by pkgdown, as far as I know). - plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2]) -
    - # Show the error models - plot(fits["FOMC", ], resplot = "errmod") -
    # } - -
    +
    +

    Examples

    +
    
    +  # \dontrun{
    +  # Only use one core not to offend CRAN checks
    +  fits <- mmkin(c("FOMC", "HS"),
    +                list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles
    +                cores = 1, quiet = TRUE, error_model = "tc")
    +#> Warning: Optimisation did not converge:
    +#> iteration limit reached without convergence (10)
    +  plot(fits[, "FOCUS C"])
    +
    +  plot(fits["FOMC", ])
    +
    +  plot(fits["FOMC", ], show_errmin = FALSE)
    +
    +
    +  # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot
    +  # height should be smaller than the plot width (this is not possible for the html pages
    +  # generated by pkgdown, as far as I know).
    +  plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
    +
    +
    +  # Show the error models
    +  plot(fits["FOMC", ], resplot = "errmod")
    +
    +  # }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/plot.nafta.html b/docs/dev/reference/plot.nafta.html index c24fba99..82b46336 100644 --- a/docs/dev/reference/plot.nafta.html +++ b/docs/dev/reference/plot.nafta.html @@ -1,68 +1,13 @@ - - - - - - - -Plot the results of the three models used in the NAFTA scheme. — plot.nafta • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot the results of the three models used in the NAFTA scheme. — plot.nafta • mkin + + - - - - -
    -
    - -
    - -
    +
    @@ -149,65 +94,65 @@ function (SFO, then IORE, then DFOP)." /> function (SFO, then IORE, then DFOP).

    -
    # S3 method for nafta
    -plot(x, legend = FALSE, main = "auto", ...)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    x

    An object of class nafta.

    legend

    Should a legend be added?

    main

    Possibility to override the main title of the plot.

    ...

    Further arguments passed to plot.mmkin.

    - -

    Value

    - -

    The function is called for its side effect.

    -

    Details

    - -

    Calls plot.mmkin.

    -

    Author

    +
    +
    # S3 method for nafta
    +plot(x, legend = FALSE, main = "auto", ...)
    +
    + +
    +

    Arguments

    +
    x
    +

    An object of class nafta.

    + +
    legend
    +

    Should a legend be added?

    + + +
    main
    +

    Possibility to override the main title of the plot.

    + + +
    ...
    +

    Further arguments passed to plot.mmkin.

    + +
    +
    +

    Value

    + + +

    The function is called for its side effect.

    +
    +
    +

    Details

    +

    Calls plot.mmkin.

    +
    +
    +

    Author

    Johannes Ranke

    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/read_spreadsheet.html b/docs/dev/reference/read_spreadsheet.html index efba012b..d0ac47d4 100644 --- a/docs/dev/reference/read_spreadsheet.html +++ b/docs/dev/reference/read_spreadsheet.html @@ -22,7 +22,7 @@ factors can be given in columns named 'Temperature' and 'Moisture'."> mkin - 1.2.0 + 1.2.2 diff --git a/docs/dev/reference/reexports.html b/docs/dev/reference/reexports.html index 0999e346..ad825391 100644 --- a/docs/dev/reference/reexports.html +++ b/docs/dev/reference/reexports.html @@ -28,7 +28,7 @@ intervals, nlme mkin - 1.1.2 + 1.2.2 @@ -55,11 +55,14 @@ intervals, nlme Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -67,7 +70,10 @@ intervals, nlme Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/residuals.mkinfit.html b/docs/dev/reference/residuals.mkinfit.html index 3f518ab7..009f790f 100644 --- a/docs/dev/reference/residuals.mkinfit.html +++ b/docs/dev/reference/residuals.mkinfit.html @@ -1,67 +1,12 @@ - - - - - - - -Extract residuals from an mkinfit model — residuals.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract residuals from an mkinfit model — residuals.mkinfit • mkin - - + + - - -
    -
    - -
    - -
    +
    @@ -147,60 +92,59 @@

    Extract residuals from an mkinfit model

    -
    # S3 method for mkinfit
    -residuals(object, standardized = FALSE, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    object

    A mkinfit object

    standardized

    Should the residuals be standardized by dividing by the -standard deviation obtained from the fitted error model?

    ...

    Not used

    - - -

    Examples

    -
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE) -residuals(f) -
    #> [1] 0.09726374 -0.13912142 -0.15351210 0.73388322 -0.08657004 -0.93204702 -#> [7] -0.03269080 1.45347823 -0.88423697
    residuals(f, standardized = TRUE) -
    #> [1] 0.13969917 -0.19981904 -0.22048826 1.05407091 -0.12433989 -1.33869208 -#> [7] -0.04695355 2.08761977 -1.27002287
    +
    +
    # S3 method for mkinfit
    +residuals(object, standardized = FALSE, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    A mkinfit object

    + + +
    standardized
    +

    Should the residuals be standardized by dividing by the +standard deviation obtained from the fitted error model?

    + + +
    ...
    +

    Not used

    + +
    + +
    +

    Examples

    +
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
    +residuals(f)
    +#> [1]  0.09726374 -0.13912142 -0.15351210  0.73388322 -0.08657004 -0.93204702
    +#> [7] -0.03269080  1.45347823 -0.88423697
    +residuals(f, standardized = TRUE)
    +#> [1]  0.13969917 -0.19981904 -0.22048826  1.05407091 -0.12433989 -1.33869208
    +#> [7] -0.04695355  2.08761977 -1.27002287
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html index d2e930e1..d18cb848 100644 --- a/docs/dev/reference/saem.html +++ b/docs/dev/reference/saem.html @@ -19,7 +19,7 @@ Expectation Maximisation algorithm (SAEM)."> mkin - 1.2.0 + 1.2.2 @@ -113,7 +113,7 @@ Expectation Maximisation algorithm (SAEM).

    covariates = NULL, covariate_models = NULL, no_random_effect = NULL, - error.init = c(3, 0.1), + error.init = c(1, 1), nbiter.saemix = c(300, 100), control = list(displayProgress = FALSE, print = FALSE, nbiter.saemix = nbiter.saemix, save = FALSE, save.graphs = FALSE), @@ -430,10 +430,10 @@ using mmkin.

    summary(f_saem_dfop_sfo, data = TRUE) #> saemix version used for fitting: 3.2 -#> mkin version used for pre-fitting: 1.2.0 +#> mkin version used for pre-fitting: 1.2.2 #> R version used for fitting: 4.2.2 -#> Date of fit: Wed Nov 16 10:49:43 2022 -#> Date of summary: Wed Nov 16 10:49:43 2022 +#> Date of fit: Thu Nov 24 08:11:00 2022 +#> Date of summary: Thu Nov 24 08:11:01 2022 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -448,7 +448,7 @@ using mmkin.

    #> #> Model predictions using solution type analytical #> -#> Fitted in 8.935 s +#> Fitted in 8.778 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Constant variance diff --git a/docs/dev/reference/schaefer07_complex_case-1.png b/docs/dev/reference/schaefer07_complex_case-1.png index 96aab2dc..eee9e0cc 100644 Binary files a/docs/dev/reference/schaefer07_complex_case-1.png and b/docs/dev/reference/schaefer07_complex_case-1.png differ diff --git a/docs/dev/reference/schaefer07_complex_case.html b/docs/dev/reference/schaefer07_complex_case.html index 4ccad5c4..5ff62d34 100644 --- a/docs/dev/reference/schaefer07_complex_case.html +++ b/docs/dev/reference/schaefer07_complex_case.html @@ -1,69 +1,14 @@ - - - - - - - -Metabolism data set used for checking the software quality of KinGUI — schaefer07_complex_case • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Metabolism data set used for checking the software quality of KinGUI — schaefer07_complex_case • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    schaefer07_complex_case
    +
    +
    schaefer07_complex_case
    +
    + +
    +

    Format

    +

    The data set is a data frame with 8 observations on the following 6 variables.

    time
    +

    a numeric vector

    + +
    parent
    +

    a numeric vector

    +
    A1
    +

    a numeric vector

    -

    Format

    +
    B1
    +

    a numeric vector

    + +
    C1
    +

    a numeric vector

    + +
    A2
    +

    a numeric vector

    -

    The data set is a data frame with 8 observations on the following 6 variables.

    -
    time

    a numeric vector

    -
    parent

    a numeric vector

    -
    A1

    a numeric vector

    -
    B1

    a numeric vector

    -
    C1

    a numeric vector

    -
    A2

    a numeric vector

    The results are a data frame with 14 results for different parameter values

    -

    References

    - +
    +
    +

    References

    Schäfer D, Mikolasch B, Rainbird P and Harvey B (2007). KinGUI: a new kinetic software tool for evaluations according to FOCUS degradation kinetics. In: Del Re AAM, Capri E, Fragoulis G and Trevisan M (Eds.). Proceedings of the XIII Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923.

    +
    -

    Examples

    -
    data <- mkin_wide_to_long(schaefer07_complex_case, time = "time") -model <- mkinmod( - parent = list(type = "SFO", to = c("A1", "B1", "C1"), sink = FALSE), - A1 = list(type = "SFO", to = "A2"), - B1 = list(type = "SFO"), - C1 = list(type = "SFO"), - A2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    # \dontrun{ - fit <- mkinfit(model, data, quiet = TRUE) - plot(fit) -
    endpoints(fit) -
    #> $ff -#> parent_A1 parent_B1 parent_C1 parent_sink A1_A2 A1_sink -#> 0.3809620 0.1954667 0.4235713 0.0000000 0.4479619 0.5520381 -#> -#> $distimes -#> DT50 DT90 -#> parent 13.95078 46.34350 -#> A1 49.75342 165.27728 -#> B1 37.26908 123.80520 -#> C1 11.23131 37.30961 -#> A2 28.50624 94.69567 -#>
    # } - # Compare with the results obtained in the original publication - print(schaefer07_complex_results) -
    #> compound parameter KinGUI ModelMaker deviation -#> 1 parent degradation rate 0.0496 0.0506 2.0 -#> 2 parent DT50 13.9900 13.6900 2.2 -#> 3 metabolite A1 formation fraction 0.3803 0.3696 2.9 -#> 4 metabolite A1 degradation rate 0.0139 0.0136 2.2 -#> 5 metabolite A1 DT50 49.9600 50.8900 1.8 -#> 6 metabolite B1 formation fraction 0.1866 0.1818 2.6 -#> 7 metabolite B1 degradation rate 0.0175 0.0172 1.7 -#> 8 metabolite B1 DT50 39.6100 40.2400 1.6 -#> 9 metabolite C1 formation fraction 0.4331 0.4486 3.5 -#> 10 metabolite C1 degradation rate 0.0638 0.0700 8.9 -#> 11 metabolite C1 DT50 10.8700 9.9000 9.8 -#> 12 metabolite A2 formation fraction 0.4529 0.4559 0.7 -#> 13 metabolite A2 degradation rate 0.0245 0.0244 0.4 -#> 14 metabolite A2 DT50 28.2400 28.4500 0.7
    +
    +

    Examples

    +
    data <- mkin_wide_to_long(schaefer07_complex_case, time = "time")
    +model <- mkinmod(
    +  parent = list(type = "SFO", to = c("A1", "B1", "C1"), sink = FALSE),
    +  A1 = list(type = "SFO", to = "A2"),
    +  B1 = list(type = "SFO"),
    +  C1 = list(type = "SFO"),
    +  A2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +  # \dontrun{
    +    fit <- mkinfit(model, data, quiet = TRUE)
    +    plot(fit)
    +
    +    endpoints(fit)
    +#> $ff
    +#>   parent_A1   parent_B1   parent_C1 parent_sink       A1_A2     A1_sink 
    +#>   0.3809620   0.1954667   0.4235713   0.0000000   0.4479619   0.5520381 
    +#> 
    +#> $distimes
    +#>            DT50      DT90
    +#> parent 13.95078  46.34350
    +#> A1     49.75342 165.27728
    +#> B1     37.26908 123.80520
    +#> C1     11.23131  37.30961
    +#> A2     28.50624  94.69567
    +#> 
    +  # }
    + # Compare with the results obtained in the original publication
    + print(schaefer07_complex_results)
    +#>         compound          parameter  KinGUI ModelMaker deviation
    +#> 1         parent   degradation rate  0.0496     0.0506       2.0
    +#> 2         parent               DT50 13.9900    13.6900       2.2
    +#> 3  metabolite A1 formation fraction  0.3803     0.3696       2.9
    +#> 4  metabolite A1   degradation rate  0.0139     0.0136       2.2
    +#> 5  metabolite A1               DT50 49.9600    50.8900       1.8
    +#> 6  metabolite B1 formation fraction  0.1866     0.1818       2.6
    +#> 7  metabolite B1   degradation rate  0.0175     0.0172       1.7
    +#> 8  metabolite B1               DT50 39.6100    40.2400       1.6
    +#> 9  metabolite C1 formation fraction  0.4331     0.4486       3.5
    +#> 10 metabolite C1   degradation rate  0.0638     0.0700       8.9
    +#> 11 metabolite C1               DT50 10.8700     9.9000       9.8
    +#> 12 metabolite A2 formation fraction  0.4529     0.4559       0.7
    +#> 13 metabolite A2   degradation rate  0.0245     0.0244       0.4
    +#> 14 metabolite A2               DT50 28.2400    28.4500       0.7
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/set_nd_nq.html b/docs/dev/reference/set_nd_nq.html index 6c6a5d46..fab0a72d 100644 --- a/docs/dev/reference/set_nd_nq.html +++ b/docs/dev/reference/set_nd_nq.html @@ -21,7 +21,7 @@ it automates the proposal of Boesten et al (2015)."> mkin - 1.2.0 + 1.2.2 @@ -63,7 +63,10 @@ it automates the proposal of Boesten et al (2015).">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/sigma_twocomp-1.png b/docs/dev/reference/sigma_twocomp-1.png index 6e61684e..0353b72c 100644 Binary files a/docs/dev/reference/sigma_twocomp-1.png and b/docs/dev/reference/sigma_twocomp-1.png differ diff --git a/docs/dev/reference/sigma_twocomp.html b/docs/dev/reference/sigma_twocomp.html index b7d295b2..292bf8e8 100644 --- a/docs/dev/reference/sigma_twocomp.html +++ b/docs/dev/reference/sigma_twocomp.html @@ -1,68 +1,13 @@ - - - - - - - -Two-component error model — sigma_twocomp • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Two-component error model — sigma_twocomp • mkin + + - - - - -
    -
    - -
    - -
    +
    @@ -149,40 +94,43 @@ dependence of the measured value \(y\):" /> dependence of the measured value \(y\):

    -
    sigma_twocomp(y, sigma_low, rsd_high)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    y

    The magnitude of the observed value

    sigma_low

    The asymptotic minimum of the standard deviation for low -observed values

    rsd_high

    The coefficient describing the increase of the standard -deviation with the magnitude of the observed value

    - -

    Value

    - -

    The standard deviation of the response variable.

    -

    Details

    +
    +
    sigma_twocomp(y, sigma_low, rsd_high)
    +
    + +
    +

    Arguments

    +
    y
    +

    The magnitude of the observed value

    + +
    sigma_low
    +

    The asymptotic minimum of the standard deviation for low +observed values

    + + +
    rsd_high
    +

    The coefficient describing the increase of the standard +deviation with the magnitude of the observed value

    + +
    +
    +

    Value

    + + +

    The standard deviation of the response variable.

    +
    +
    +

    Details

    $$\sigma = \sqrt{ \sigma_{low}^2 + y^2 * {rsd}_{high}^2}$$ sigma = sqrt(sigma_low^2 + y^2 * rsd_high^2)

    This is the error model used for example by Werner et al. (1978). The model proposed by Rocke and Lorenzato (1995) can be written in this form as well, but assumes approximate lognormal distribution of errors for high values of y.

    -

    References

    - +
    +
    +

    References

    Werner, Mario, Brooks, Samuel H., and Knott, Lancaster B. (1978) Additive, Multiplicative, and Mixed Analytical Errors. Clinical Chemistry 24(11), 1895-1898.

    @@ -190,61 +138,62 @@ Additive, Multiplicative, and Mixed Analytical Errors. Clinical Chemistry measurement error in analytical chemistry. Technometrics 37(2), 176-184.

    Ranke J and Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical Degradation Data. Environments 6(12) 124 -doi: 10.3390/environments6120124 +doi:10.3390/environments6120124 .

    +
    -

    Examples

    -
    times <- c(0, 1, 3, 7, 14, 28, 60, 90, 120) -d_pred <- data.frame(time = times, parent = 100 * exp(- 0.03 * times)) -set.seed(123456) -d_syn <- add_err(d_pred, function(y) sigma_twocomp(y, 1, 0.07), - reps = 2, n = 1)[[1]] -f_nls <- nls(value ~ SSasymp(time, 0, parent_0, lrc), data = d_syn, - start = list(parent_0 = 100, lrc = -3)) -library(nlme) -f_gnls <- gnls(value ~ SSasymp(time, 0, parent_0, lrc), - data = d_syn, na.action = na.omit, - start = list(parent_0 = 100, lrc = -3)) -if (length(findFunction("varConstProp")) > 0) { - f_gnls_tc <- update(f_gnls, weights = varConstProp()) - f_gnls_tc_sf <- update(f_gnls_tc, control = list(sigma = 1)) -} -f_mkin <- mkinfit("SFO", d_syn, error_model = "const", quiet = TRUE) -f_mkin_tc <- mkinfit("SFO", d_syn, error_model = "tc", quiet = TRUE) -plot_res(f_mkin_tc, standardized = TRUE) -
    AIC(f_nls, f_gnls, f_gnls_tc, f_gnls_tc_sf, f_mkin, f_mkin_tc) -
    #> df AIC -#> f_nls 3 114.4817 -#> f_gnls 3 114.4817 -#> f_gnls_tc 5 103.6447 -#> f_gnls_tc_sf 4 101.6447 -#> f_mkin 3 114.4817 -#> f_mkin_tc 4 101.6446
    +
    +

    Examples

    +
    times <- c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +d_pred <- data.frame(time = times, parent = 100 * exp(- 0.03 * times))
    +set.seed(123456)
    +d_syn <- add_err(d_pred, function(y) sigma_twocomp(y, 1, 0.07),
    +  reps = 2, n = 1)[[1]]
    +f_nls <- nls(value ~ SSasymp(time, 0, parent_0, lrc), data = d_syn,
    + start = list(parent_0 = 100, lrc = -3))
    +library(nlme)
    +f_gnls <- gnls(value ~ SSasymp(time, 0, parent_0, lrc),
    +  data = d_syn, na.action = na.omit,
    +  start = list(parent_0 = 100, lrc = -3))
    +if (length(findFunction("varConstProp")) > 0) {
    +  f_gnls_tc <- update(f_gnls, weights = varConstProp())
    +  f_gnls_tc_sf <- update(f_gnls_tc, control = list(sigma = 1))
    +}
    +f_mkin <- mkinfit("SFO", d_syn, error_model = "const", quiet = TRUE)
    +f_mkin_tc <- mkinfit("SFO", d_syn, error_model = "tc", quiet = TRUE)
    +plot_res(f_mkin_tc, standardized = TRUE)
    +
    +AIC(f_nls, f_gnls, f_gnls_tc, f_gnls_tc_sf, f_mkin, f_mkin_tc)
    +#>              df      AIC
    +#> f_nls         3 114.4817
    +#> f_gnls        3 114.4817
    +#> f_gnls_tc     5 103.6447
    +#> f_gnls_tc_sf  4 101.6447
    +#> f_mkin        3 114.4817
    +#> f_mkin_tc     4 101.6446
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/status.html b/docs/dev/reference/status.html index 4c856100..c3516f07 100644 --- a/docs/dev/reference/status.html +++ b/docs/dev/reference/status.html @@ -17,7 +17,7 @@ mkin - 1.2.0 + 1.2.2 @@ -59,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/summary.mkinfit.html b/docs/dev/reference/summary.mkinfit.html index 3994a424..ad8432bf 100644 --- a/docs/dev/reference/summary.mkinfit.html +++ b/docs/dev/reference/summary.mkinfit.html @@ -21,7 +21,7 @@ values."> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Synthetic datasets for one parent compound with two metabolites — synthetic_data_for_UBA_2014 • mkin - - - - - - - - - - - - - + + -
    -
    - -
    - -
    +
    -
    synthetic_data_for_UBA_2014
    +
    +
    synthetic_data_for_UBA_2014
    +
    +
    +

    Format

    +

    A list containing twelve datasets as an R6 class defined by mkinds, + each containing, among others, the following components

    title
    +

    The name of the dataset, e.g. SFO_lin_a

    -

    Format

    +
    data
    +

    A data frame with the data in the form expected by mkinfit

    -

    A list containing twelve datasets as an R6 class defined by mkinds, - each containing, among others, the following components

    -
    title

    The name of the dataset, e.g. SFO_lin_a

    -
    data

    A data frame with the data in the form expected by mkinfit

    -
    - -

    Source

    - +
    +
    +

    Source

    Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452

    Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for measurement error in analytical chemistry. Technometrics 37(2), 176-184.

    +
    -

    Examples

    -
    # \dontrun{ -# The data have been generated using the following kinetic models -m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"), - M1 = list(type = "SFO", to = "M2"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    - -m_synth_SFO_par <- mkinmod(parent = list(type = "SFO", to = c("M1", "M2"), - sink = FALSE), - M1 = list(type = "SFO"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -m_synth_DFOP_lin <- mkinmod(parent = list(type = "DFOP", to = "M1"), - M1 = list(type = "SFO", to = "M2"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -m_synth_DFOP_par <- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2"), - sink = FALSE), - M1 = list(type = "SFO"), - M2 = list(type = "SFO"), use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -# The model predictions without intentional error were generated as follows -sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) - -d_synth_SFO_lin <- mkinpredict(m_synth_SFO_lin, - c(k_parent = 0.7, f_parent_to_M1 = 0.8, - k_M1 = 0.3, f_M1_to_M2 = 0.7, - k_M2 = 0.02), - c(parent = 100, M1 = 0, M2 = 0), - sampling_times) - -d_synth_DFOP_lin <- mkinpredict(m_synth_DFOP_lin, - c(k1 = 0.2, k2 = 0.02, g = 0.5, - f_parent_to_M1 = 0.5, k_M1 = 0.3, - f_M1_to_M2 = 0.7, k_M2 = 0.02), - c(parent = 100, M1 = 0, M2 = 0), - sampling_times) - -d_synth_SFO_par <- mkinpredict(m_synth_SFO_par, - c(k_parent = 0.2, - f_parent_to_M1 = 0.8, k_M1 = 0.01, - f_parent_to_M2 = 0.2, k_M2 = 0.02), - c(parent = 100, M1 = 0, M2 = 0), - sampling_times) - -d_synth_DFOP_par <- mkinpredict(m_synth_DFOP_par, - c(k1 = 0.3, k2 = 0.02, g = 0.7, - f_parent_to_M1 = 0.6, k_M1 = 0.04, - f_parent_to_M2 = 0.4, k_M2 = 0.01), - c(parent = 100, M1 = 0, M2 = 0), - sampling_times) - -# Construct names for datasets with errors -d_synth_names = paste0("d_synth_", c("SFO_lin", "SFO_par", - "DFOP_lin", "DFOP_par")) - -# Original function used or adding errors. The add_err function now published -# with this package is a slightly generalised version where the names of -# secondary compartments that should have an initial value of zero (M1 and M2 -# in this case) are not hardcoded any more. -# add_err = function(d, sdfunc, LOD = 0.1, reps = 2, seed = 123456789) -# { -# set.seed(seed) -# d_long = mkin_wide_to_long(d, time = "time") -# d_rep = data.frame(lapply(d_long, rep, each = 2)) -# d_rep$value = rnorm(length(d_rep$value), d_rep$value, sdfunc(d_rep$value)) -# -# d_rep[d_rep$time == 0 & d_rep$name %in% c("M1", "M2"), "value"] <- 0 -# d_NA <- transform(d_rep, value = ifelse(value < LOD, NA, value)) -# d_NA$value <- round(d_NA$value, 1) -# return(d_NA) -# } - -# The following is the simplified version of the two-component model of Rocke -# and Lorenzato (1995) -sdfunc_twocomp = function(value, sd_low, rsd_high) { - sqrt(sd_low^2 + value^2 * rsd_high^2) -} - -# Add the errors. -for (d_synth_name in d_synth_names) -{ - d_synth = get(d_synth_name) - assign(paste0(d_synth_name, "_a"), add_err(d_synth, function(value) 3)) - assign(paste0(d_synth_name, "_b"), add_err(d_synth, function(value) 7)) - assign(paste0(d_synth_name, "_c"), add_err(d_synth, - function(value) sdfunc_twocomp(value, 0.5, 0.07))) - -} - -d_synth_err_names = c( - paste(rep(d_synth_names, each = 3), letters[1:3], sep = "_") -) - -# This is just one example of an evaluation using the kinetic model used for -# the generation of the data - fit <- mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data, - quiet = TRUE) - plot_sep(fit) -
    summary(fit) -
    #> mkin version used for fitting: 1.0.3.9000 -#> R version used for fitting: 4.0.3 -#> Date of fit: Mon Feb 15 17:13:29 2021 -#> Date of summary: Mon Feb 15 17:13:29 2021 -#> -#> Equations: -#> d_parent/dt = - k_parent * parent -#> d_M1/dt = + f_parent_to_M1 * k_parent * parent - k_M1 * M1 -#> d_M2/dt = + f_M1_to_M2 * k_M1 * M1 - k_M2 * M2 -#> -#> Model predictions using solution type deSolve -#> -#> Fitted using 833 model solutions performed in 0.649 s -#> -#> Error model: Constant variance -#> -#> Error model algorithm: OLS -#> -#> Starting values for parameters to be optimised: -#> value type -#> parent_0 101.3500 state -#> k_parent 0.1000 deparm -#> k_M1 0.1001 deparm -#> k_M2 0.1002 deparm -#> f_parent_to_M1 0.5000 deparm -#> f_M1_to_M2 0.5000 deparm -#> -#> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 101.350000 -Inf Inf -#> log_k_parent -2.302585 -Inf Inf -#> log_k_M1 -2.301586 -Inf Inf -#> log_k_M2 -2.300587 -Inf Inf -#> f_parent_qlogis 0.000000 -Inf Inf -#> f_M1_qlogis 0.000000 -Inf Inf -#> -#> Fixed parameter values: -#> value type -#> M1_0 0 state -#> M2_0 0 state -#> -#> Results: -#> -#> AIC BIC logLik -#> 188.7274 200.3723 -87.36368 -#> -#> Optimised, transformed parameters with symmetric confidence intervals: -#> Estimate Std. Error Lower Upper -#> parent_0 102.1000 1.57000 98.8600 105.3000 -#> log_k_parent -0.3020 0.03885 -0.3812 -0.2229 -#> log_k_M1 -1.2070 0.07123 -1.3520 -1.0620 -#> log_k_M2 -3.9010 0.06571 -4.0350 -3.7670 -#> f_parent_qlogis 1.2010 0.23530 0.7216 1.6800 -#> f_M1_qlogis 0.9589 0.24890 0.4520 1.4660 -#> sigma 2.2730 0.25740 1.7490 2.7970 -#> -#> Parameter correlation: -#> parent_0 log_k_parent log_k_M1 log_k_M2 f_parent_qlogis -#> parent_0 1.000e+00 3.933e-01 -1.605e-01 2.819e-02 -4.624e-01 -#> log_k_parent 3.933e-01 1.000e+00 -4.082e-01 7.166e-02 -5.682e-01 -#> log_k_M1 -1.605e-01 -4.082e-01 1.000e+00 -3.929e-01 7.478e-01 -#> log_k_M2 2.819e-02 7.166e-02 -3.929e-01 1.000e+00 -2.658e-01 -#> f_parent_qlogis -4.624e-01 -5.682e-01 7.478e-01 -2.658e-01 1.000e+00 -#> f_M1_qlogis 1.614e-01 4.102e-01 -8.109e-01 5.419e-01 -8.605e-01 -#> sigma -2.900e-08 -8.030e-09 -2.741e-08 3.938e-08 -2.681e-08 -#> f_M1_qlogis sigma -#> parent_0 1.614e-01 -2.900e-08 -#> log_k_parent 4.102e-01 -8.030e-09 -#> log_k_M1 -8.109e-01 -2.741e-08 -#> log_k_M2 5.419e-01 3.938e-08 -#> f_parent_qlogis -8.605e-01 -2.681e-08 -#> f_M1_qlogis 1.000e+00 4.971e-08 -#> sigma 4.971e-08 1.000e+00 -#> -#> Backtransformed parameters: -#> Confidence intervals for internally transformed parameters are asymmetric. -#> t-test (unrealistically) based on the assumption of normal distribution -#> for estimators of untransformed parameters. -#> Estimate t value Pr(>t) Lower Upper -#> parent_0 102.10000 65.000 7.281e-36 98.86000 105.30000 -#> k_parent 0.73930 25.740 2.948e-23 0.68310 0.80020 -#> k_M1 0.29920 14.040 1.577e-15 0.25880 0.34590 -#> k_M2 0.02023 15.220 1.653e-16 0.01769 0.02312 -#> f_parent_to_M1 0.76870 18.370 7.295e-19 0.67300 0.84290 -#> f_M1_to_M2 0.72290 14.500 6.418e-16 0.61110 0.81240 -#> sigma 2.27300 8.832 2.161e-10 1.74900 2.79700 -#> -#> FOCUS Chi2 error levels in percent: -#> err.min n.optim df -#> All data 8.454 6 17 -#> parent 8.660 2 6 -#> M1 10.583 2 5 -#> M2 3.586 2 6 -#> -#> Resulting formation fractions: -#> ff -#> parent_M1 0.7687 -#> parent_sink 0.2313 -#> M1_M2 0.7229 -#> M1_sink 0.2771 -#> -#> Estimated disappearance times: -#> DT50 DT90 -#> parent 0.9376 3.114 -#> M1 2.3170 7.697 -#> M2 34.2689 113.839 -#> -#> Data: -#> time variable observed predicted residual -#> 0 parent 101.5 1.021e+02 -0.56248 -#> 0 parent 101.2 1.021e+02 -0.86248 -#> 1 parent 53.9 4.873e+01 5.17118 -#> 1 parent 47.5 4.873e+01 -1.22882 -#> 3 parent 10.4 1.111e+01 -0.70773 -#> 3 parent 7.6 1.111e+01 -3.50773 -#> 7 parent 1.1 5.772e-01 0.52283 -#> 7 parent 0.3 5.772e-01 -0.27717 -#> 14 parent 3.5 3.264e-03 3.49674 -#> 28 parent 3.2 1.045e-07 3.20000 -#> 90 parent 0.6 9.530e-10 0.60000 -#> 120 parent 3.5 -5.940e-10 3.50000 -#> 1 M1 36.4 3.479e+01 1.61088 -#> 1 M1 37.4 3.479e+01 2.61088 -#> 3 M1 34.3 3.937e+01 -5.07027 -#> 3 M1 39.8 3.937e+01 0.42973 -#> 7 M1 15.1 1.549e+01 -0.38715 -#> 7 M1 17.8 1.549e+01 2.31285 -#> 14 M1 5.8 1.995e+00 3.80469 -#> 14 M1 1.2 1.995e+00 -0.79531 -#> 60 M1 0.5 2.111e-06 0.50000 -#> 90 M1 3.2 -9.670e-10 3.20000 -#> 120 M1 1.5 7.670e-10 1.50000 -#> 120 M1 0.6 7.670e-10 0.60000 -#> 1 M2 4.8 4.455e+00 0.34517 -#> 3 M2 20.9 2.153e+01 -0.62527 -#> 3 M2 19.3 2.153e+01 -2.22527 -#> 7 M2 42.0 4.192e+01 0.07941 -#> 7 M2 43.1 4.192e+01 1.17941 -#> 14 M2 49.4 4.557e+01 3.83353 -#> 14 M2 44.3 4.557e+01 -1.26647 -#> 28 M2 34.6 3.547e+01 -0.87275 -#> 28 M2 33.0 3.547e+01 -2.47275 -#> 60 M2 18.8 1.858e+01 0.21837 -#> 60 M2 17.6 1.858e+01 -0.98163 -#> 90 M2 10.6 1.013e+01 0.47130 -#> 90 M2 10.8 1.013e+01 0.67130 -#> 120 M2 9.8 5.521e+00 4.27893 -#> 120 M2 3.3 5.521e+00 -2.22107
    # } -
    +
    +

    Examples

    +
    # \dontrun{
    +# The data have been generated using the following kinetic models
    +m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"),
    +                           M1 = list(type = "SFO", to = "M2"),
    +                           M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +
    +m_synth_SFO_par <- mkinmod(parent = list(type = "SFO", to = c("M1", "M2"),
    +                                         sink = FALSE),
    +                           M1 = list(type = "SFO"),
    +                           M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +m_synth_DFOP_lin <- mkinmod(parent = list(type = "DFOP", to = "M1"),
    +                            M1 = list(type = "SFO", to = "M2"),
    +                            M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +m_synth_DFOP_par <- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2"),
    +                                          sink = FALSE),
    +                            M1 = list(type = "SFO"),
    +                            M2 = list(type = "SFO"), use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +# The model predictions without intentional error were generated as follows
    +sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +
    +d_synth_SFO_lin <- mkinpredict(m_synth_SFO_lin,
    +                               c(k_parent = 0.7, f_parent_to_M1 = 0.8,
    +                                 k_M1 = 0.3, f_M1_to_M2 = 0.7,
    +                                 k_M2 = 0.02),
    +                               c(parent = 100, M1 = 0, M2 = 0),
    +                               sampling_times)
    +
    +d_synth_DFOP_lin <- mkinpredict(m_synth_DFOP_lin,
    +                                c(k1 = 0.2, k2 = 0.02, g = 0.5,
    +                                  f_parent_to_M1 = 0.5, k_M1 = 0.3,
    +                                  f_M1_to_M2 = 0.7, k_M2 = 0.02),
    +                                 c(parent = 100, M1 = 0, M2 = 0),
    +                                 sampling_times)
    +
    +d_synth_SFO_par <- mkinpredict(m_synth_SFO_par,
    +                               c(k_parent = 0.2,
    +                                 f_parent_to_M1 = 0.8, k_M1 = 0.01,
    +                                 f_parent_to_M2 = 0.2, k_M2 = 0.02),
    +                                 c(parent = 100, M1 = 0, M2 = 0),
    +                                 sampling_times)
    +
    +d_synth_DFOP_par <- mkinpredict(m_synth_DFOP_par,
    +                               c(k1 = 0.3, k2 = 0.02, g = 0.7,
    +                                 f_parent_to_M1 = 0.6, k_M1 = 0.04,
    +                                 f_parent_to_M2 = 0.4, k_M2 = 0.01),
    +                                 c(parent = 100, M1 = 0, M2 = 0),
    +                                 sampling_times)
    +
    +# Construct names for datasets with errors
    +d_synth_names = paste0("d_synth_", c("SFO_lin", "SFO_par",
    +                                     "DFOP_lin", "DFOP_par"))
    +
    +# Original function used or adding errors. The add_err function now published
    +# with this package is a slightly generalised version where the names of
    +# secondary compartments that should have an initial value of zero (M1 and M2
    +# in this case) are not hardcoded any more.
    +# add_err = function(d, sdfunc, LOD = 0.1, reps = 2, seed = 123456789)
    +# {
    +#   set.seed(seed)
    +#   d_long = mkin_wide_to_long(d, time = "time")
    +#   d_rep = data.frame(lapply(d_long, rep, each = 2))
    +#   d_rep$value = rnorm(length(d_rep$value), d_rep$value, sdfunc(d_rep$value))
    +#
    +#   d_rep[d_rep$time == 0 & d_rep$name %in% c("M1", "M2"), "value"] <- 0
    +#   d_NA <- transform(d_rep, value = ifelse(value < LOD, NA, value))
    +#   d_NA$value <- round(d_NA$value, 1)
    +#   return(d_NA)
    +# }
    +
    +# The following is the simplified version of the two-component model of Rocke
    +# and Lorenzato (1995)
    +sdfunc_twocomp = function(value, sd_low, rsd_high) {
    +  sqrt(sd_low^2 + value^2 * rsd_high^2)
    +}
    +
    +# Add the errors.
    +for (d_synth_name in d_synth_names)
    +{
    +  d_synth = get(d_synth_name)
    +  assign(paste0(d_synth_name, "_a"), add_err(d_synth, function(value) 3))
    +  assign(paste0(d_synth_name, "_b"), add_err(d_synth, function(value) 7))
    +  assign(paste0(d_synth_name, "_c"), add_err(d_synth,
    +                           function(value) sdfunc_twocomp(value, 0.5, 0.07)))
    +
    +}
    +
    +d_synth_err_names = c(
    +  paste(rep(d_synth_names, each = 3), letters[1:3], sep = "_")
    +)
    +
    +# This is just one example of an evaluation using the kinetic model used for
    +# the generation of the data
    +  fit <- mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data,
    +                 quiet = TRUE)
    +  plot_sep(fit)
    +
    +  summary(fit)
    +#> mkin version used for fitting:    1.2.2 
    +#> R version used for fitting:       4.2.2 
    +#> Date of fit:     Thu Nov 24 08:11:54 2022 
    +#> Date of summary: Thu Nov 24 08:11:54 2022 
    +#> 
    +#> Equations:
    +#> d_parent/dt = - k_parent * parent
    +#> d_M1/dt = + f_parent_to_M1 * k_parent * parent - k_M1 * M1
    +#> d_M2/dt = + f_M1_to_M2 * k_M1 * M1 - k_M2 * M2
    +#> 
    +#> Model predictions using solution type deSolve 
    +#> 
    +#> Fitted using 833 model solutions performed in 0.574 s
    +#> 
    +#> Error model: Constant variance 
    +#> 
    +#> Error model algorithm: OLS 
    +#> 
    +#> Starting values for parameters to be optimised:
    +#>                   value   type
    +#> parent_0       101.3500  state
    +#> k_parent         0.1000 deparm
    +#> k_M1             0.1001 deparm
    +#> k_M2             0.1002 deparm
    +#> f_parent_to_M1   0.5000 deparm
    +#> f_M1_to_M2       0.5000 deparm
    +#> 
    +#> Starting values for the transformed parameters actually optimised:
    +#>                      value lower upper
    +#> parent_0        101.350000  -Inf   Inf
    +#> log_k_parent     -2.302585  -Inf   Inf
    +#> log_k_M1         -2.301586  -Inf   Inf
    +#> log_k_M2         -2.300587  -Inf   Inf
    +#> f_parent_qlogis   0.000000  -Inf   Inf
    +#> f_M1_qlogis       0.000000  -Inf   Inf
    +#> 
    +#> Fixed parameter values:
    +#>      value  type
    +#> M1_0     0 state
    +#> M2_0     0 state
    +#> 
    +#> Results:
    +#> 
    +#>        AIC      BIC    logLik
    +#>   188.7274 200.3723 -87.36368
    +#> 
    +#> Optimised, transformed parameters with symmetric confidence intervals:
    +#>                 Estimate Std. Error   Lower    Upper
    +#> parent_0        102.1000    1.57000 98.8600 105.3000
    +#> log_k_parent     -0.3020    0.03885 -0.3812  -0.2229
    +#> log_k_M1         -1.2070    0.07123 -1.3520  -1.0620
    +#> log_k_M2         -3.9010    0.06571 -4.0350  -3.7670
    +#> f_parent_qlogis   1.2010    0.23530  0.7216   1.6800
    +#> f_M1_qlogis       0.9589    0.24890  0.4520   1.4660
    +#> sigma             2.2730    0.25740  1.7490   2.7970
    +#> 
    +#> Parameter correlation:
    +#>                   parent_0 log_k_parent   log_k_M1   log_k_M2 f_parent_qlogis
    +#> parent_0         1.000e+00    3.933e-01 -1.605e-01  2.819e-02      -4.624e-01
    +#> log_k_parent     3.933e-01    1.000e+00 -4.082e-01  7.166e-02      -5.682e-01
    +#> log_k_M1        -1.605e-01   -4.082e-01  1.000e+00 -3.929e-01       7.478e-01
    +#> log_k_M2         2.819e-02    7.166e-02 -3.929e-01  1.000e+00      -2.658e-01
    +#> f_parent_qlogis -4.624e-01   -5.682e-01  7.478e-01 -2.658e-01       1.000e+00
    +#> f_M1_qlogis      1.614e-01    4.102e-01 -8.109e-01  5.419e-01      -8.605e-01
    +#> sigma           -2.900e-08   -8.030e-09 -2.741e-08  3.938e-08      -2.681e-08
    +#>                 f_M1_qlogis      sigma
    +#> parent_0          1.614e-01 -2.900e-08
    +#> log_k_parent      4.102e-01 -8.030e-09
    +#> log_k_M1         -8.109e-01 -2.741e-08
    +#> log_k_M2          5.419e-01  3.938e-08
    +#> f_parent_qlogis  -8.605e-01 -2.681e-08
    +#> f_M1_qlogis       1.000e+00  4.971e-08
    +#> sigma             4.971e-08  1.000e+00
    +#> 
    +#> Backtransformed parameters:
    +#> Confidence intervals for internally transformed parameters are asymmetric.
    +#> t-test (unrealistically) based on the assumption of normal distribution
    +#> for estimators of untransformed parameters.
    +#>                 Estimate t value    Pr(>t)    Lower     Upper
    +#> parent_0       102.10000  65.000 7.281e-36 98.86000 105.30000
    +#> k_parent         0.73930  25.740 2.948e-23  0.68310   0.80020
    +#> k_M1             0.29920  14.040 1.577e-15  0.25880   0.34590
    +#> k_M2             0.02023  15.220 1.653e-16  0.01769   0.02312
    +#> f_parent_to_M1   0.76870  18.370 7.295e-19  0.67300   0.84290
    +#> f_M1_to_M2       0.72290  14.500 6.418e-16  0.61110   0.81240
    +#> sigma            2.27300   8.832 2.161e-10  1.74900   2.79700
    +#> 
    +#> FOCUS Chi2 error levels in percent:
    +#>          err.min n.optim df
    +#> All data   8.454       6 17
    +#> parent     8.660       2  6
    +#> M1        10.583       2  5
    +#> M2         3.586       2  6
    +#> 
    +#> Resulting formation fractions:
    +#>                 ff
    +#> parent_M1   0.7687
    +#> parent_sink 0.2313
    +#> M1_M2       0.7229
    +#> M1_sink     0.2771
    +#> 
    +#> Estimated disappearance times:
    +#>           DT50    DT90
    +#> parent  0.9376   3.114
    +#> M1      2.3170   7.697
    +#> M2     34.2689 113.839
    +#> 
    +#> Data:
    +#>  time variable observed  predicted residual
    +#>     0   parent    101.5  1.021e+02 -0.56248
    +#>     0   parent    101.2  1.021e+02 -0.86248
    +#>     1   parent     53.9  4.873e+01  5.17118
    +#>     1   parent     47.5  4.873e+01 -1.22882
    +#>     3   parent     10.4  1.111e+01 -0.70773
    +#>     3   parent      7.6  1.111e+01 -3.50773
    +#>     7   parent      1.1  5.772e-01  0.52283
    +#>     7   parent      0.3  5.772e-01 -0.27717
    +#>    14   parent      3.5  3.264e-03  3.49674
    +#>    28   parent      3.2  1.045e-07  3.20000
    +#>    90   parent      0.6  9.530e-10  0.60000
    +#>   120   parent      3.5 -5.940e-10  3.50000
    +#>     1       M1     36.4  3.479e+01  1.61088
    +#>     1       M1     37.4  3.479e+01  2.61088
    +#>     3       M1     34.3  3.937e+01 -5.07027
    +#>     3       M1     39.8  3.937e+01  0.42973
    +#>     7       M1     15.1  1.549e+01 -0.38715
    +#>     7       M1     17.8  1.549e+01  2.31285
    +#>    14       M1      5.8  1.995e+00  3.80469
    +#>    14       M1      1.2  1.995e+00 -0.79531
    +#>    60       M1      0.5  2.111e-06  0.50000
    +#>    90       M1      3.2 -9.670e-10  3.20000
    +#>   120       M1      1.5  7.670e-10  1.50000
    +#>   120       M1      0.6  7.670e-10  0.60000
    +#>     1       M2      4.8  4.455e+00  0.34517
    +#>     3       M2     20.9  2.153e+01 -0.62527
    +#>     3       M2     19.3  2.153e+01 -2.22527
    +#>     7       M2     42.0  4.192e+01  0.07941
    +#>     7       M2     43.1  4.192e+01  1.17941
    +#>    14       M2     49.4  4.557e+01  3.83353
    +#>    14       M2     44.3  4.557e+01 -1.26647
    +#>    28       M2     34.6  3.547e+01 -0.87275
    +#>    28       M2     33.0  3.547e+01 -2.47275
    +#>    60       M2     18.8  1.858e+01  0.21837
    +#>    60       M2     17.6  1.858e+01 -0.98163
    +#>    90       M2     10.6  1.013e+01  0.47130
    +#>    90       M2     10.8  1.013e+01  0.67130
    +#>   120       M2      9.8  5.521e+00  4.27893
    +#>   120       M2      3.3  5.521e+00 -2.22107
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/test_data_from_UBA_2014-1.png b/docs/dev/reference/test_data_from_UBA_2014-1.png index 7bf0bd0f..e4fc2a4c 100644 Binary files a/docs/dev/reference/test_data_from_UBA_2014-1.png and b/docs/dev/reference/test_data_from_UBA_2014-1.png differ diff --git a/docs/dev/reference/test_data_from_UBA_2014-2.png b/docs/dev/reference/test_data_from_UBA_2014-2.png index fc1f77e0..4ce36561 100644 Binary files a/docs/dev/reference/test_data_from_UBA_2014-2.png and b/docs/dev/reference/test_data_from_UBA_2014-2.png differ diff --git a/docs/dev/reference/test_data_from_UBA_2014.html b/docs/dev/reference/test_data_from_UBA_2014.html index 539b8287..05529e0e 100644 --- a/docs/dev/reference/test_data_from_UBA_2014.html +++ b/docs/dev/reference/test_data_from_UBA_2014.html @@ -1,68 +1,13 @@ - - - - - - - -Three experimental datasets from two water sediment systems and one soil — test_data_from_UBA_2014 • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Three experimental datasets from two water sediment systems and one soil — test_data_from_UBA_2014 • mkin - - - - + + -
    -
    - -
    - -
    +
    -
    test_data_from_UBA_2014
    +
    +
    test_data_from_UBA_2014
    +
    +
    +

    Format

    +

    A list containing three datasets as an R6 class defined by mkinds. + Each dataset has, among others, the following components

    title
    +

    The name of the dataset, e.g. UBA_2014_WS_river

    -

    Format

    +
    data
    +

    A data frame with the data in the form expected by mkinfit

    -

    A list containing three datasets as an R6 class defined by mkinds. - Each dataset has, among others, the following components

    -
    title

    The name of the dataset, e.g. UBA_2014_WS_river

    -
    data

    A data frame with the data in the form expected by mkinfit

    -
    - -

    Source

    - +
    +
    +

    Source

    Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452

    +
    -

    Examples

    -
    # \dontrun{ - # This is a level P-II evaluation of the dataset according to the FOCUS kinetics - # guidance. Due to the strong correlation of the parameter estimates, the - # covariance matrix is not returned. Note that level P-II evaluations are - # generally considered deprecated due to the frequent occurrence of such - # large parameter correlations, among other reasons (e.g. the adequacy of the - # model). - m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"), - parent_s = mkinsub("SFO", "parent_w")) -
    #> Temporary DLL for differentials generated and loaded
    f_river <- mkinfit(m_ws, test_data_from_UBA_2014[[1]]$data, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    plot_sep(f_river) -
    - summary(f_river)$bpar -
    #> Warning: Could not calculate correlation; no covariance matrix
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_w_0 95.91998118 NA NA NA NA NA -#> k_parent_w 0.41145375 NA NA NA NA NA -#> k_parent_s 0.04663944 NA NA NA NA NA -#> f_parent_w_to_parent_s 0.12467894 NA NA NA NA NA -#> f_parent_s_to_parent_w 0.50000000 NA NA NA NA NA -#> sigma 3.13612618 NA NA NA NA NA
    mkinerrmin(f_river) -
    #> err.min n.optim df -#> All data 0.1090929 5 6 -#> parent_w 0.0817436 3 3 -#> parent_s 0.1619965 2 3
    - # This is the evaluation used for the validation of software packages - # in the expertise from 2014 - m_soil <- mkinmod(parent = mkinsub("SFO", c("M1", "M2")), - M1 = mkinsub("SFO", "M3"), - M2 = mkinsub("SFO", "M3"), - M3 = mkinsub("SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    - f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright")) -
    summary(f_soil)$bpar -
    #> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 76.55425650 0.859186399 89.1008710 1.113861e-26 74.755959418 -#> k_parent 0.12081956 0.004601918 26.2541722 1.077359e-16 0.111561575 -#> k_M1 0.84258615 0.806160102 1.0451846 1.545268e-01 0.113779609 -#> k_M2 0.04210880 0.017083034 2.4649483 1.170188e-02 0.018013857 -#> k_M3 0.01122918 0.007245856 1.5497385 6.885052e-02 0.002909431 -#> f_parent_to_M1 0.32240200 0.240783943 1.3389680 9.819076e-02 NA -#> f_parent_to_M2 0.16099855 0.033691952 4.7785464 6.531136e-05 NA -#> f_M1_to_M3 0.27921507 0.269423780 1.0363416 1.565267e-01 0.022978205 -#> f_M2_to_M3 0.55641252 0.595119966 0.9349586 1.807707e-01 0.008002509 -#> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 -#> Upper -#> parent_0 78.35255358 -#> k_parent 0.13084582 -#> k_M1 6.23970702 -#> k_M2 0.09843260 -#> k_M3 0.04333992 -#> f_parent_to_M1 NA -#> f_parent_to_M2 NA -#> f_M1_to_M3 0.86450775 -#> f_M2_to_M3 0.99489895 -#> sigma 1.45337221
    mkinerrmin(f_soil) -
    #> err.min n.optim df -#> All data 0.09649963 9 20 -#> parent 0.04721283 2 6 -#> M1 0.26551208 2 5 -#> M2 0.20327575 2 5 -#> M3 0.05196550 3 4
    # } -
    +
    +

    Examples

    +
      # \dontrun{
    +  # This is a level P-II evaluation of the dataset according to the FOCUS kinetics
    +  # guidance. Due to the strong correlation of the parameter estimates, the
    +  # covariance matrix is not returned. Note that level P-II evaluations are
    +  # generally considered deprecated due to the frequent occurrence of such
    +  # large parameter correlations, among other reasons (e.g. the adequacy of the
    +  # model).
    +  m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"),
    +                  parent_s = mkinsub("SFO", "parent_w"))
    +#> Temporary DLL for differentials generated and loaded
    +  f_river <- mkinfit(m_ws, test_data_from_UBA_2014[[1]]$data, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +  plot_sep(f_river)
    +
    +
    +  summary(f_river)$bpar
    +#> Warning: Could not calculate correlation; no covariance matrix
    +#>                           Estimate se_notrans t value Pr(>t) Lower Upper
    +#> parent_w_0             95.91998118         NA      NA     NA    NA    NA
    +#> k_parent_w              0.41145375         NA      NA     NA    NA    NA
    +#> k_parent_s              0.04663944         NA      NA     NA    NA    NA
    +#> f_parent_w_to_parent_s  0.12467894         NA      NA     NA    NA    NA
    +#> f_parent_s_to_parent_w  0.50000000         NA      NA     NA    NA    NA
    +#> sigma                   3.13612618         NA      NA     NA    NA    NA
    +  mkinerrmin(f_river)
    +#>            err.min n.optim df
    +#> All data 0.1090929       5  6
    +#> parent_w 0.0817436       3  3
    +#> parent_s 0.1619965       2  3
    +
    +  # This is the evaluation used for the validation of software packages
    +  # in the expertise from 2014
    +  m_soil <- mkinmod(parent = mkinsub("SFO", c("M1", "M2")),
    +                    M1 = mkinsub("SFO", "M3"),
    +                    M2 = mkinsub("SFO", "M3"),
    +                    M3 = mkinsub("SFO"),
    +                    use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +  f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +  plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright"))
    +
    +  summary(f_soil)$bpar
    +#>                   Estimate  se_notrans    t value       Pr(>t)        Lower
    +#> parent_0       76.55425650 0.859186399 89.1008710 1.113861e-26 74.755959418
    +#> k_parent        0.12081956 0.004601918 26.2541722 1.077359e-16  0.111561575
    +#> k_M1            0.84258615 0.806160102  1.0451846 1.545268e-01  0.113779609
    +#> k_M2            0.04210880 0.017083034  2.4649483 1.170188e-02  0.018013857
    +#> k_M3            0.01122918 0.007245856  1.5497385 6.885052e-02  0.002909431
    +#> f_parent_to_M1  0.32240200 0.240783943  1.3389680 9.819076e-02           NA
    +#> f_parent_to_M2  0.16099855 0.033691952  4.7785464 6.531136e-05           NA
    +#> f_M1_to_M3      0.27921507 0.269423780  1.0363416 1.565267e-01  0.022978205
    +#> f_M2_to_M3      0.55641252 0.595119966  0.9349586 1.807707e-01  0.008002509
    +#> sigma           1.14005399 0.149696423  7.6157731 1.727024e-07  0.826735778
    +#>                      Upper
    +#> parent_0       78.35255358
    +#> k_parent        0.13084582
    +#> k_M1            6.23970702
    +#> k_M2            0.09843260
    +#> k_M3            0.04333992
    +#> f_parent_to_M1          NA
    +#> f_parent_to_M2          NA
    +#> f_M1_to_M3      0.86450775
    +#> f_M2_to_M3      0.99489895
    +#> sigma           1.45337221
    +  mkinerrmin(f_soil)
    +#>             err.min n.optim df
    +#> All data 0.09649963       9 20
    +#> parent   0.04721283       2  6
    +#> M1       0.26551208       2  5
    +#> M2       0.20327575       2  5
    +#> M3       0.05196550       3  4
    +  # }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/tex_listing.html b/docs/dev/reference/tex_listing.html index c82138b7..03bd83f2 100644 --- a/docs/dev/reference/tex_listing.html +++ b/docs/dev/reference/tex_listing.html @@ -18,7 +18,7 @@ option results = "asis".'> mkin - 1.2.0 + 1.2.2 @@ -60,7 +60,10 @@ option results = "asis".'> Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/transform_odeparms.html b/docs/dev/reference/transform_odeparms.html index 75d6a1f9..a7a01043 100644 --- a/docs/dev/reference/transform_odeparms.html +++ b/docs/dev/reference/transform_odeparms.html @@ -1,72 +1,17 @@ - - - - - - - -Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +
    @@ -154,205 +99,221 @@ restricted values to the full scale of real numbers. For kinetic rate 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.

    +the ilr transformation is used.

    +
    + +
    +
    transform_odeparms(
    +  parms,
    +  mkinmod,
    +  transform_rates = TRUE,
    +  transform_fractions = TRUE
    +)
    +
    +backtransform_odeparms(
    +  transparms,
    +  mkinmod,
    +  transform_rates = TRUE,
    +  transform_fractions = TRUE
    +)
    -
    transform_odeparms(
    -  parms,
    -  mkinmod,
    -  transform_rates = TRUE,
    -  transform_fractions = TRUE
    -)
    +    
    +

    Arguments

    +
    parms
    +

    Parameters of kinetic models as used in the differential +equations.

    -backtransform_odeparms( - transparms, - mkinmod, - transform_rates = TRUE, - transform_fractions = TRUE -)
    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    parms

    Parameters of kinetic models as used in the differential -equations.

    mkinmod

    The kinetic model of class mkinmod, containing +

    mkinmod
    +

    The kinetic model of class mkinmod, containing the names of the model variables that are needed for grouping the -formation fractions before ilr transformation, the parameter -names and the information if the pathway to sink is included in the model.

    transform_rates

    Boolean specifying if kinetic rate constants should +formation fractions before ilr transformation, the parameter +names and the information if the pathway to sink is included in the model.

    + + +
    transform_rates
    +

    Boolean specifying if kinetic rate constants should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the estimator. If TRUE, also alpha and beta parameters of the FOMC model are log-transformed, as well as k1 and k2 rate constants for the DFOP and HS -models and the break point tb of the HS model.

    transform_fractions

    Boolean specifying if formation fractions +models and the break point tb of the HS model.

    + + +
    transform_fractions
    +

    Boolean specifying if formation fractions constants should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the estimator. The default (TRUE) is to do transformations. The g parameter of the DFOP model is also seen as a fraction. If a single fraction is transformed (g parameter of DFOP or only a single target variable e.g. a single metabolite plus a pathway to sink), a -logistic transformation is used stats::qlogis(). In other cases, i.e. if +logistic transformation is used stats::qlogis(). In other cases, i.e. if two or more formation fractions need to be transformed whose sum cannot -exceed one, the ilr transformation is used.

    transparms

    Transformed parameters of kinetic models as used in the -fitting procedure.

    +exceed one, the ilr transformation is used.

    + -

    Value

    +
    transparms
    +

    Transformed parameters of kinetic models as used in the +fitting procedure.

    -

    A vector of transformed or backtransformed parameters

    -

    Details

    +
    +
    +

    Value

    + +

    A vector of transformed or backtransformed parameters

    +
    +
    +

    Details

    The transformation of sets of formation fractions is fragile, as it supposes the same ordering of the components in forward and backward transformation. -This is no problem for the internal use in mkinfit.

    -

    Author

    - +This is no problem for the internal use in mkinfit.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -SFO_SFO <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = TRUE), - m1 = list(type = "SFO"), use_of_ff = "min") -
    #> Temporary DLL for differentials generated and loaded
    -# Fit the model to the FOCUS example dataset D using defaults -FOCUS_D <- subset(FOCUS_2006_D, value != 0) # remove zero values to avoid warning -fit <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE) -fit.s <- summary(fit) -# Transformed and backtransformed parameters -print(fit.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.60 1.5702 96.40 102.79 -#> log_k_parent_sink -3.04 0.0763 -3.19 -2.88 -#> log_k_parent_m1 -2.98 0.0403 -3.06 -2.90 -#> log_k_m1_sink -5.25 0.1332 -5.52 -4.98 -#> sigma 3.13 0.3585 2.40 3.85
    print(fit.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04103 0.0560 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04678 0.0551 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
    -# \dontrun{ -# Compare to the version without transforming rate parameters (does not work -# with analytical solution, we get NA values for m1 in predictions) -fit.2 <- mkinfit(SFO_SFO, FOCUS_D, transform_rates = FALSE, - solution_type = "deSolve", quiet = TRUE) -fit.2.s <- summary(fit.2) -print(fit.2.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.59848 1.57022 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 2.39609 3.85e+00
    print(fit.2.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.85e+00
    # } - -initials <- fit$start$value -names(initials) <- rownames(fit$start) -transformed <- fit$start_transformed$value -names(transformed) <- rownames(fit$start_transformed) -transform_odeparms(initials, SFO_SFO) -
    #> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 100.750000 -2.302585 -2.301586 -2.300587
    backtransform_odeparms(transformed, SFO_SFO) -
    #> parent_0 k_parent_sink k_parent_m1 k_m1_sink -#> 100.7500 0.1000 0.1001 0.1002
    -# \dontrun{ -# The case of formation fractions (this is now the default) -SFO_SFO.ff <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = TRUE), - m1 = list(type = "SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_D, quiet = TRUE) -fit.ff.s <- summary(fit.ff) -print(fit.ff.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.5985 1.5702 96.404 102.79 -#> log_k_parent -2.3157 0.0409 -2.399 -2.23 -#> log_k_m1 -5.2475 0.1332 -5.518 -4.98 -#> f_parent_qlogis 0.0579 0.0893 -0.124 0.24 -#> sigma 3.1255 0.3585 2.396 3.85
    print(fit.ff.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40383 102.7931 -#> k_parent 0.09870 0.00403 24.47 4.96e-23 0.09082 0.1073 -#> k_m1 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> f_parent_to_m1 0.51448 0.02230 23.07 3.10e-22 0.46912 0.5596 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
    initials <- c("f_parent_to_m1" = 0.5) -transformed <- transform_odeparms(initials, SFO_SFO.ff) -backtransform_odeparms(transformed, SFO_SFO.ff) -
    #> f_parent_to_m1 -#> 0.5
    -# And without sink -SFO_SFO.ff.2 <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = FALSE), - m1 = list(type = "SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    - -fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_D, quiet = TRUE) -fit.ff.2.s <- summary(fit.ff.2) -print(fit.ff.2.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 84.79 3.012 78.67 90.91 -#> log_k_parent -2.76 0.082 -2.92 -2.59 -#> log_k_m1 -4.21 0.123 -4.46 -3.96 -#> sigma 8.22 0.943 6.31 10.14
    print(fit.ff.2.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 84.7916 3.01203 28.15 1.92e-25 78.6704 90.913 -#> k_parent 0.0635 0.00521 12.19 2.91e-14 0.0538 0.075 -#> k_m1 0.0148 0.00182 8.13 8.81e-10 0.0115 0.019 -#> sigma 8.2229 0.94323 8.72 1.73e-10 6.3060 10.140
    # } - -
    +
    +

    Examples

    +
    
    +SFO_SFO <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = TRUE),
    +  m1 = list(type = "SFO"), use_of_ff = "min")
    +#> Temporary DLL for differentials generated and loaded
    +
    +# Fit the model to the FOCUS example dataset D using defaults
    +FOCUS_D <- subset(FOCUS_2006_D, value != 0) # remove zero values to avoid warning
    +fit <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE)
    +fit.s <- summary(fit)
    +# Transformed and backtransformed parameters
    +print(fit.s$par, 3)
    +#>                   Estimate Std. Error Lower  Upper
    +#> parent_0             99.60     1.5702 96.40 102.79
    +#> log_k_parent_sink    -3.04     0.0763 -3.19  -2.88
    +#> log_k_parent_m1      -2.98     0.0403 -3.06  -2.90
    +#> log_k_m1_sink        -5.25     0.1332 -5.52  -4.98
    +#> sigma                 3.13     0.3585  2.40   3.85
    +print(fit.s$bpar, 3)
    +#>               Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0      99.59848    1.57022   63.43 2.30e-36 96.40384 102.7931
    +#> k_parent_sink  0.04792    0.00365   13.11 6.13e-15  0.04103   0.0560
    +#> k_parent_m1    0.05078    0.00205   24.80 3.27e-23  0.04678   0.0551
    +#> k_m1_sink      0.00526    0.00070    7.51 6.16e-09  0.00401   0.0069
    +#> sigma          3.12550    0.35852    8.72 2.24e-10  2.39609   3.8549
    +
    +# \dontrun{
    +# Compare to the version without transforming rate parameters (does not work
    +# with analytical solution, we get NA values for m1 in predictions)
    +fit.2 <- mkinfit(SFO_SFO, FOCUS_D, transform_rates = FALSE,
    +  solution_type = "deSolve", quiet = TRUE)
    +fit.2.s <- summary(fit.2)
    +print(fit.2.s$par, 3)
    +#>               Estimate Std. Error    Lower    Upper
    +#> parent_0      99.59848    1.57022 96.40384 1.03e+02
    +#> k_parent_sink  0.04792    0.00365  0.04049 5.54e-02
    +#> k_parent_m1    0.05078    0.00205  0.04661 5.49e-02
    +#> k_m1_sink      0.00526    0.00070  0.00384 6.69e-03
    +#> sigma          3.12550    0.35852  2.39609 3.85e+00
    +print(fit.2.s$bpar, 3)
    +#>               Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0      99.59848    1.57022   63.43 2.30e-36 96.40384 1.03e+02
    +#> k_parent_sink  0.04792    0.00365   13.11 6.13e-15  0.04049 5.54e-02
    +#> k_parent_m1    0.05078    0.00205   24.80 3.27e-23  0.04661 5.49e-02
    +#> k_m1_sink      0.00526    0.00070    7.51 6.16e-09  0.00384 6.69e-03
    +#> sigma          3.12550    0.35852    8.72 2.24e-10  2.39609 3.85e+00
    +# }
    +
    +initials <- fit$start$value
    +names(initials) <- rownames(fit$start)
    +transformed <- fit$start_transformed$value
    +names(transformed) <- rownames(fit$start_transformed)
    +transform_odeparms(initials, SFO_SFO)
    +#>          parent_0 log_k_parent_sink   log_k_parent_m1     log_k_m1_sink 
    +#>        100.750000         -2.302585         -2.301586         -2.300587 
    +backtransform_odeparms(transformed, SFO_SFO)
    +#>      parent_0 k_parent_sink   k_parent_m1     k_m1_sink 
    +#>      100.7500        0.1000        0.1001        0.1002 
    +
    +# \dontrun{
    +# The case of formation fractions (this is now the default)
    +SFO_SFO.ff <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = TRUE),
    +  m1 = list(type = "SFO"),
    +  use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_D, quiet = TRUE)
    +fit.ff.s <- summary(fit.ff)
    +print(fit.ff.s$par, 3)
    +#>                 Estimate Std. Error  Lower  Upper
    +#> parent_0         99.5985     1.5702 96.404 102.79
    +#> log_k_parent     -2.3157     0.0409 -2.399  -2.23
    +#> log_k_m1         -5.2475     0.1332 -5.518  -4.98
    +#> f_parent_qlogis   0.0579     0.0893 -0.124   0.24
    +#> sigma             3.1255     0.3585  2.396   3.85
    +print(fit.ff.s$bpar, 3)
    +#>                Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0       99.59848    1.57022   63.43 2.30e-36 96.40383 102.7931
    +#> k_parent        0.09870    0.00403   24.47 4.96e-23  0.09082   0.1073
    +#> k_m1            0.00526    0.00070    7.51 6.16e-09  0.00401   0.0069
    +#> f_parent_to_m1  0.51448    0.02230   23.07 3.10e-22  0.46912   0.5596
    +#> sigma           3.12550    0.35852    8.72 2.24e-10  2.39609   3.8549
    +initials <- c("f_parent_to_m1" = 0.5)
    +transformed <- transform_odeparms(initials, SFO_SFO.ff)
    +backtransform_odeparms(transformed, SFO_SFO.ff)
    +#> f_parent_to_m1 
    +#>            0.5 
    +
    +# And without sink
    +SFO_SFO.ff.2 <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = FALSE),
    +  m1 = list(type = "SFO"),
    +  use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +
    +fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_D, quiet = TRUE)
    +fit.ff.2.s <- summary(fit.ff.2)
    +print(fit.ff.2.s$par, 3)
    +#>              Estimate Std. Error Lower Upper
    +#> parent_0        84.79      3.012 78.67 90.91
    +#> log_k_parent    -2.76      0.082 -2.92 -2.59
    +#> log_k_m1        -4.21      0.123 -4.46 -3.96
    +#> sigma            8.22      0.943  6.31 10.14
    +print(fit.ff.2.s$bpar, 3)
    +#>          Estimate se_notrans t value   Pr(>t)   Lower  Upper
    +#> parent_0  84.7916    3.01203   28.15 1.92e-25 78.6704 90.913
    +#> k_parent   0.0635    0.00521   12.19 2.91e-14  0.0538  0.075
    +#> k_m1       0.0148    0.00182    8.13 8.81e-10  0.0115  0.019
    +#> sigma      8.2229    0.94323    8.72 1.73e-10  6.3060 10.140
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/update.mkinfit-1.png b/docs/dev/reference/update.mkinfit-1.png index df8473c1..12fe1f5b 100644 Binary files a/docs/dev/reference/update.mkinfit-1.png and b/docs/dev/reference/update.mkinfit-1.png differ diff --git a/docs/dev/reference/update.mkinfit-2.png b/docs/dev/reference/update.mkinfit-2.png index 13c99b44..21817f94 100644 Binary files a/docs/dev/reference/update.mkinfit-2.png and b/docs/dev/reference/update.mkinfit-2.png differ diff --git a/docs/dev/reference/update.mkinfit.html b/docs/dev/reference/update.mkinfit.html index 83f45028..cf611716 100644 --- a/docs/dev/reference/update.mkinfit.html +++ b/docs/dev/reference/update.mkinfit.html @@ -1,70 +1,15 @@ - - - - - - - -Update an mkinfit model with different arguments — update.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Update an mkinfit model with different arguments — update.mkinfit • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -153,66 +98,67 @@ updated fit. Values specified as 'parms.ini' and/or 'state.ini' will override these starting values.

    -
    # S3 method for mkinfit
    -update(object, ..., evaluate = TRUE)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    object

    An mkinfit object to be updated

    ...

    Arguments to mkinfit that should replace +

    +
    # S3 method for mkinfit
    +update(object, ..., evaluate = TRUE)
    +
    + +
    +

    Arguments

    +
    object
    +

    An mkinfit object to be updated

    + + +
    ...
    +

    Arguments to mkinfit that should replace the arguments from the original call. Arguments set to NULL will -remove arguments given in the original call

    evaluate

    Should the call be evaluated or returned as a call

    - - -

    Examples

    -
    # \dontrun{ -fit <- mkinfit("SFO", subset(FOCUS_2006_D, value != 0), quiet = TRUE) -parms(fit) -
    #> parent_0 k_parent sigma -#> 99.44423885 0.09793574 3.39632469
    plot_err(fit) -
    fit_2 <- update(fit, error_model = "tc") -parms(fit_2) -
    #> parent_0 k_parent sigma_low rsd_high -#> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02
    plot_err(fit_2) -
    # } -
    +remove arguments given in the original call

    + + +
    evaluate
    +

    Should the call be evaluated or returned as a call

    + +
    + +
    +

    Examples

    +
    # \dontrun{
    +fit <- mkinfit("SFO", subset(FOCUS_2006_D, value != 0), quiet = TRUE)
    +parms(fit)
    +#>    parent_0    k_parent       sigma 
    +#> 99.44423885  0.09793574  3.39632469 
    +plot_err(fit)
    +
    +fit_2 <- update(fit, error_model = "tc")
    +parms(fit_2)
    +#>     parent_0     k_parent    sigma_low     rsd_high 
    +#> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02 
    +plot_err(fit_2)
    +
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/sitemap.xml b/docs/dev/sitemap.xml index 04cf230e..06f56c5d 100644 --- a/docs/dev/sitemap.xml +++ b/docs/dev/sitemap.xml @@ -120,6 +120,9 @@ https://pkgdown.jrwb.de/mkin/reference/dimethenamid_2018.html + + https://pkgdown.jrwb.de/mkin/reference/ds_mixed.html + https://pkgdown.jrwb.de/mkin/reference/endpoints.html diff --git a/vignettes/web_only/mkin_benchmarks.rda b/vignettes/web_only/mkin_benchmarks.rda index 629b70bd..aec48422 100644 Binary files a/vignettes/web_only/mkin_benchmarks.rda and b/vignettes/web_only/mkin_benchmarks.rda differ diff --git a/vignettes/web_only/saem_benchmarks.rda b/vignettes/web_only/saem_benchmarks.rda index 509b1008..6921f78c 100644 Binary files a/vignettes/web_only/saem_benchmarks.rda and b/vignettes/web_only/saem_benchmarks.rda differ -- cgit v1.2.1 From 61b9a4046582da5cf88bd3c04d0d6ca77adc3405 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 25 Nov 2022 19:10:28 +0100 Subject: mhmkin: Easy specification of ill-defined parms The argument 'no_random_effect' now accepts an illparms.mhmkin object --- NEWS.md | 2 +- R/mhmkin.R | 38 ++++++++++++++++++++------------------ man/mhmkin.Rd | 16 +++++++--------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/NEWS.md b/NEWS.md index 7f14e06b..f07c6983 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # mkin 1.2.2 -- +- 'R/mhmkin.R': Allow an 'illparms.mhmkin' object as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. # mkin 1.2.1 (2022-11-19) diff --git a/R/mhmkin.R b/R/mhmkin.R index 1f29dc40..6a61e8bb 100644 --- a/R/mhmkin.R +++ b/R/mhmkin.R @@ -12,13 +12,13 @@ #' degradation models to the same data #' @param backend The backend to be used for fitting. Currently, only saemix is #' supported -#' @param no_random_effect Default is NULL and will be passed to [saem]. If -#' you specify "auto", random effects are only included if the number -#' of datasets in which the parameter passed the t-test is at least 'auto_ranef_threshold'. -#' Beware that while this may make for convenient model reduction or even -#' numerical stability of the algorithm, it will likely lead to -#' underparameterised models. -#' @param auto_ranef_threshold See 'no_random_effect. +#' @param no_random_effect Default is NULL and will be passed to [saem]. If a +#' character vector is supplied, it will be passed to all calls to [saem], +#' regardless if the corresponding parameter is in the model. Alternatively, +#' an object of class [illparms.mhmkin] can be specified. This has to have +#' the same dimensions as the return object of the current call. In this way, +#' ill-defined parameters found in corresponding simpler versions of the +#' degradation model can be specified. #' @param algorithm The algorithm to be used for fitting (currently not used) #' @param \dots Further arguments that will be passed to the nonlinear mixed-effects #' model fitting function. @@ -51,7 +51,7 @@ mhmkin.mmkin <- function(objects, ...) { #' @export #' @rdname mhmkin mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", - no_random_effect = NULL, auto_ranef_threshold = 3, + no_random_effect = NULL, ..., cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL) { @@ -102,22 +102,24 @@ mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", deg_index <- w[1] error_index <- w[2] mmkin_row <- objects[[error_index]][deg_index, ] - if (identical(no_random_effect, "auto")) { - ip <- illparms(mmkin_row) - ipt <- table(unlist(lapply(as.list(ip), strsplit, ", "))) - no_ranef <- names(ipt)[which((length(ds) - ipt) <= auto_ranef_threshold)] - transparms <- rownames(mmkin_row[[1]]$start_transformed) - bparms <- rownames(mmkin_row[[1]]$start) - names(transparms) <- bparms - no_ranef_trans <- transparms[no_ranef] + if (is(no_random_effect, "illparms.mhmkin")) { + if (identical(dim(no_random_effect), dim(fit_indices))) { + no_ranef_split <- strsplit(no_random_effect[[fit_index]], ", ") + no_ranef <- sapply(no_ranef_split, function(x) { + gsub("sd\\((.*)\\)", "\\1", x) + }) + } else { + stop("Dimensions of illparms.mhmkin object given as 'no_random_effect' are not suitable") + } } else { - no_ranef_trans <- no_random_effect + no_ranef <- no_random_effect } res <- try(do.call(backend_function, - args = c(list(mmkin_row), dot_args, list(no_random_effect = no_ranef_trans)))) + args = c(list(mmkin_row), dot_args, list(no_random_effect = no_ranef)))) return(res) } + fit_time <- system.time({ if (is.null(cluster)) { results <- parallel::mclapply(as.list(1:n.fits), fit_function, diff --git a/man/mhmkin.Rd b/man/mhmkin.Rd index 597fa8ac..4230e44f 100644 --- a/man/mhmkin.Rd +++ b/man/mhmkin.Rd @@ -18,7 +18,6 @@ mhmkin(objects, ...) backend = "saemix", algorithm = "saem", no_random_effect = NULL, - auto_ranef_threshold = 3, ..., cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL @@ -42,14 +41,13 @@ supported} \item{algorithm}{The algorithm to be used for fitting (currently not used)} -\item{no_random_effect}{Default is NULL and will be passed to \link{saem}. If -you specify "auto", random effects are only included if the number -of datasets in which the parameter passed the t-test is at least 'auto_ranef_threshold'. -Beware that while this may make for convenient model reduction or even -numerical stability of the algorithm, it will likely lead to -underparameterised models.} - -\item{auto_ranef_threshold}{See 'no_random_effect.} +\item{no_random_effect}{Default is NULL and will be passed to \link{saem}. If a +character vector is supplied, it will be passed to all calls to \link{saem}, +regardless if the corresponding parameter is in the model. Alternatively, +an object of class \link{illparms.mhmkin} can be specified. This has to have +the same dimensions as the return object of the current call. In this way, +ill-defined parameters found in corresponding simpler versions of the +degradation model can be specified.} \item{cores}{The number of cores to be used for multicore processing. This is only used when the \code{cluster} argument is \code{NULL}. On Windows -- cgit v1.2.1 From aaa4cab7e0c7212f91147a9789af54b97fe342ca Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 29 Nov 2022 20:23:17 +0100 Subject: Complete starting values in summary for saem.mmkin fits Also update tests to the changes in mhmkin (see NEWS) --- NEWS.md | 4 ++- R/summary.saem.mmkin.R | 11 ++++++- log/build.log | 2 +- log/test.log | 34 +++++++++++----------- .../illparms_hfits_synth_no_ranef_auto.txt | 4 --- tests/testthat/print_hfits_synth_no_ranef_auto.txt | 9 ------ tests/testthat/summary_hfit_sfo_tc.txt | 11 ++++++- tests/testthat/summary_saem_dfop_sfo_s.txt | 15 +++++++++- tests/testthat/test_mhmkin.R | 10 ------- 9 files changed, 55 insertions(+), 45 deletions(-) delete mode 100644 tests/testthat/illparms_hfits_synth_no_ranef_auto.txt delete mode 100644 tests/testthat/print_hfits_synth_no_ranef_auto.txt diff --git a/NEWS.md b/NEWS.md index f07c6983..35f499d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ # mkin 1.2.2 -- 'R/mhmkin.R': Allow an 'illparms.mhmkin' object as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. +- 'R/mhmkin.R': Allow an 'illparms.mhmkin' object as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well. + +- 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters # mkin 1.2.1 (2022-11-19) diff --git a/R/summary.saem.mmkin.R b/R/summary.saem.mmkin.R index 2754e9f0..7337b0f3 100644 --- a/R/summary.saem.mmkin.R +++ b/R/summary.saem.mmkin.R @@ -225,13 +225,22 @@ print.summary.saem.mmkin <- function(x, digits = max(3, getOption("digits") - 3) obs = "Variance unique to each observed variable", tc = "Two-component variance function"), "\n") - cat("\nMean of starting values for individual parameters:\n") + cat("\nStarting values for degradation parameters:\n") print(x$mean_dp_start, digits = digits) cat("\nFixed degradation parameter values:\n") if(length(x$fixed$value) == 0) cat("None\n") else print(x$fixed, digits = digits) + cat("\nStarting values for random effects (square root of initial entries in omega):\n") + print(sqrt(x$so@model@omega.init), digits = digits) + + cat("\nStarting values for error model parameters:\n") + errparms <- x$so@model@error.init + names(errparms) <- x$so@model@name.sigma + errparms <- errparms[x$so@model@indx.res] + print(errparms, digits = digits) + cat("\nResults:\n\n") cat("Likelihood computed by importance sampling\n") print(data.frame(AIC = x$AIC, BIC = x$BIC, logLik = x$logLik, diff --git a/log/build.log b/log/build.log index 6be01938..dbe0cd5b 100644 --- a/log/build.log +++ b/log/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_1.2.1.tar.gz’ +* building ‘mkin_1.2.2.tar.gz’ diff --git a/log/test.log b/log/test.log index 0b9aa7eb..e17ecc1f 100644 --- a/log/test.log +++ b/log/test.log @@ -5,54 +5,54 @@ ✔ | 5 | Calculation of Akaike weights ✔ | 3 | Export dataset for reading into CAKE ✔ | 12 | Confidence intervals and p-values [1.1s] -✔ | 1 12 | Dimethenamid data from 2018 [33.3s] +✔ | 1 12 | Dimethenamid data from 2018 [32.2s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data Reason: Fitting this ODE model with saemix takes about 15 minutes on my system ──────────────────────────────────────────────────────────────────────────────── -✔ | 14 | Error model fitting [5.0s] +✔ | 14 | Error model fitting [4.9s] ✔ | 5 | Time step normalisation ✔ | 4 | Calculation of FOCUS chi2 error levels [0.6s] ✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s] -✔ | 4 | Test fitting the decline of metabolites from their maximum [0.4s] -✔ | 1 | Fitting the logistic model [0.3s] -✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [25.5s] -✔ | 1 11 | Nonlinear mixed-effects models [13.2s] +✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3s] +✔ | 1 | Fitting the logistic model [0.2s] +✔ | 8 | Batch fitting and diagnosing hierarchical kinetic models [14.5s] +✔ | 1 11 | Nonlinear mixed-effects models [13.1s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits Reason: Fitting with saemix takes around 10 minutes when using deSolve ──────────────────────────────────────────────────────────────────────────────── ✔ | 3 | Test dataset classes mkinds and mkindsg -✔ | 10 | Special cases of mkinfit calls [0.5s] +✔ | 10 | Special cases of mkinfit calls [0.4s] ✔ | 3 | mkinfit features [0.7s] ✔ | 8 | mkinmod model generation and printing [0.2s] ✔ | 3 | Model predictions with mkinpredict [0.3s] -✔ | 12 | Multistart method for saem.mmkin models [51.1s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.3s] -✔ | 9 | Nonlinear mixed-effects models with nlme [9.2s] -✔ | 15 | Plotting [10.3s] +✔ | 12 | Multistart method for saem.mmkin models [50.1s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.2s] +✔ | 9 | Nonlinear mixed-effects models with nlme [8.7s] +✔ | 15 | Plotting [10.2s] ✔ | 4 | Residuals extracted from mkinfit models -✔ | 1 36 | saemix parent models [73.7s] +✔ | 1 36 | saemix parent models [103.8s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem Reason: This still takes almost 2.5 minutes although we do not solve ODEs ──────────────────────────────────────────────────────────────────────────────── -✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5s] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.4s] ✔ | 11 | Processing of residue series ✔ | 10 | Fitting the SFORB model [3.8s] ✔ | 1 | Summaries of old mkinfit objects ✔ | 5 | Summary [0.2s] -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.4s] -✔ | 9 | Hypothesis tests [8.8s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2s] +✔ | 9 | Hypothesis tests [8.1s] ✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 251.2 s +Duration: 266.0 s ── Skipped tests ────────────────────────────────────────────────────────────── • Fitting this ODE model with saemix takes about 15 minutes on my system (1) • Fitting with saemix takes around 10 minutes when using deSolve (1) • This still takes almost 2.5 minutes although we do not solve ODEs (1) -[ FAIL 0 | WARN 0 | SKIP 3 | PASS 270 ] +[ FAIL 0 | WARN 0 | SKIP 3 | PASS 268 ] Error while shutting down parallel: unable to terminate some child processes diff --git a/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt b/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt deleted file mode 100644 index a64ed222..00000000 --- a/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt +++ /dev/null @@ -1,4 +0,0 @@ - error -degradation const tc - SFO sd(parent_0) - FOMC b.1 diff --git a/tests/testthat/print_hfits_synth_no_ranef_auto.txt b/tests/testthat/print_hfits_synth_no_ranef_auto.txt deleted file mode 100644 index 9af1cbcd..00000000 --- a/tests/testthat/print_hfits_synth_no_ranef_auto.txt +++ /dev/null @@ -1,9 +0,0 @@ - object -Status of individual fits: - - error -degradation const tc - SFO OK OK - FOMC OK OK - -OK: Fit terminated successfully diff --git a/tests/testthat/summary_hfit_sfo_tc.txt b/tests/testthat/summary_hfit_sfo_tc.txt index bb5bf6fb..0a61f75f 100644 --- a/tests/testthat/summary_hfit_sfo_tc.txt +++ b/tests/testthat/summary_hfit_sfo_tc.txt @@ -17,13 +17,22 @@ Using 300, 100 iterations and 9 chains Variance model: Two-component variance function -Mean of starting values for individual parameters: +Starting values for degradation parameters: parent_0 log_k_parent 101 -3 Fixed degradation parameter values: None +Starting values for random effects (square root of initial entries in omega): + parent_0 log_k_parent +parent_0 4 0.0 +log_k_parent 0 0.4 + +Starting values for error model parameters: +a.1 b.1 + 1 1 + Results: Likelihood computed by importance sampling diff --git a/tests/testthat/summary_saem_dfop_sfo_s.txt b/tests/testthat/summary_saem_dfop_sfo_s.txt index 7c337843..6468ff17 100644 --- a/tests/testthat/summary_saem_dfop_sfo_s.txt +++ b/tests/testthat/summary_saem_dfop_sfo_s.txt @@ -22,7 +22,7 @@ Using 300, 100 iterations and 4 chains Variance model: Two-component variance function -Mean of starting values for individual parameters: +Starting values for degradation parameters: parent_0 k_m1 f_parent_to_m1 k1 k2 1e+02 7e-03 5e-01 1e-01 2e-02 g @@ -31,6 +31,19 @@ Mean of starting values for individual parameters: Fixed degradation parameter values: None +Starting values for random effects (square root of initial entries in omega): + parent_0 k_m1 f_parent_to_m1 k1 k2 g +parent_0 101 0 0 0 0 0 +k_m1 0 1 0 0 0 0 +f_parent_to_m1 0 0 1 0 0 0 +k1 0 0 0 1 0 0 +k2 0 0 0 0 1 0 +g 0 0 0 0 0 1 + +Starting values for error model parameters: +a.1 b.1 + 1 1 + Results: Likelihood computed by importance sampling diff --git a/tests/testthat/test_mhmkin.R b/tests/testthat/test_mhmkin.R index 93333ac1..e2339f28 100644 --- a/tests/testthat/test_mhmkin.R +++ b/tests/testthat/test_mhmkin.R @@ -46,14 +46,4 @@ test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", { print(fits_synth_const), "print_fits_synth_const.txt") - hfits_no_ranef_auto <- update(hfits, no_random_effect = "auto", auto_ranef_threshold = 2) - - expect_known_output( - print(hfits_no_ranef_auto), - "print_hfits_synth_no_ranef_auto.txt") - - expect_known_output( - print(illparms(hfits_no_ranef_auto)), - "illparms_hfits_synth_no_ranef_auto.txt") - }) -- cgit v1.2.1 From 74e44dfed5af6e6fd421abe82d3e3f190771f85a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 1 Dec 2022 11:20:00 +0100 Subject: Possibility to manually specify no_random_effects in mhmkin --- NEWS.md | 2 +- R/mhmkin.R | 91 ++++++++++++++++++++++++------- log/check.log | 8 +-- log/test.log | 48 ++++++++-------- man/mhmkin.Rd | 50 +++++++++++++++-- tests/testthat/illparms_hfits_synth.txt | 10 +--- tests/testthat/print_fits_synth_const.txt | 4 +- tests/testthat/summary_hfit_sfo_tc.txt | 34 ++++++------ tests/testthat/test_mhmkin.R | 34 ++++++++---- 9 files changed, 187 insertions(+), 94 deletions(-) diff --git a/NEWS.md b/NEWS.md index 35f499d5..65df4191 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # mkin 1.2.2 -- 'R/mhmkin.R': Allow an 'illparms.mhmkin' object as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well. +- 'R/mhmkin.R': Allow an 'illparms.mhmkin' object or a list with suitable dimensions as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well. - 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters diff --git a/R/mhmkin.R b/R/mhmkin.R index 6a61e8bb..a9798ff4 100644 --- a/R/mhmkin.R +++ b/R/mhmkin.R @@ -14,11 +14,12 @@ #' supported #' @param no_random_effect Default is NULL and will be passed to [saem]. If a #' character vector is supplied, it will be passed to all calls to [saem], -#' regardless if the corresponding parameter is in the model. Alternatively, -#' an object of class [illparms.mhmkin] can be specified. This has to have -#' the same dimensions as the return object of the current call. In this way, -#' ill-defined parameters found in corresponding simpler versions of the -#' degradation model can be specified. +#' which will exclude random effects for all matching parameters. Alternatively, +#' a list of character vectors or an object of class [illparms.mhmkin] can be +#' specified. They have to have the same dimensions that the return object of +#' the current call will have, i.e. the number of rows must match the number +#' of degradation models in the mmkin object(s), and the number of columns must +#' match the number of error models used in the mmkin object(s). #' @param algorithm The algorithm to be used for fitting (currently not used) #' @param \dots Further arguments that will be passed to the nonlinear mixed-effects #' model fitting function. @@ -50,6 +51,42 @@ mhmkin.mmkin <- function(objects, ...) { #' @export #' @rdname mhmkin +#' @examples +#' \dontrun{ +#' # We start with separate evaluations of all the first six datasets with two +#' # degradation models and two error models +#' f_sep_const <- mmkin(c("SFO", "FOMC"), ds_fomc[1:6], cores = 2, quiet = TRUE) +#' f_sep_tc <- update(f_sep_const, error_model = "tc") +#' # The mhmkin function sets up hierarchical degradation models aka +#' # nonlinear mixed-effects models for all four combinations, specifying +#' # uncorrelated random effects for all degradation parameters +#' f_saem_1 <- mhmkin(list(f_sep_const, f_sep_tc), cores = 2) +#' status(f_saem_1) +#' # The 'illparms' function shows that in all hierarchical fits, at least +#' # one random effect is ill-defined (the confidence interval for the +#' # random effect expressed as standard deviation includes zero) +#' illparms(f_saem_1) +#' # Therefore we repeat the fits, excluding the ill-defined random effects +#' f_saem_2 <- update(f_saem_1, no_random_effect = illparms(f_saem_1)) +#' status(f_saem_2) +#' illparms(f_saem_2) +#' # Model comparisons show that FOMC with two-component error is preferable, +#' # and confirms our reduction of the default parameter model +#' anova(f_saem_1) +#' anova(f_saem_2) +#' # The convergence plot for the selected model looks fine +#' saemix::plot(f_saem_2[["FOMC", "tc"]]$so, plot.type = "convergence") +#' # The plot of predictions versus data shows that we have a pretty data-rich +#' # situation with homogeneous distribution of residuals, because we used the +#' # same degradation model, error model and parameter distribution model that +#' # was used in the data generation. +#' plot(f_saem_2[["FOMC", "tc"]]) +#' # We can specify the same parameter model reductions manually +#' no_ranef <- list("parent_0", "log_beta", "parent_0", c("parent_0", "log_beta")) +#' dim(no_ranef) <- c(2, 2) +#' f_saem_2m <- update(f_saem_1, no_random_effect = no_ranef) +#' anova(f_saem_2m) +#' } mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", no_random_effect = NULL, ..., @@ -97,25 +134,38 @@ mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", dimnames(fit_indices) <- list(degradation = names(deg_models), error = error_models) - fit_function <- function(fit_index) { - w <- which(fit_indices == fit_index, arr.ind = TRUE) - deg_index <- w[1] - error_index <- w[2] - mmkin_row <- objects[[error_index]][deg_index, ] + if (is.null(no_random_effect) || length(dim(no_random_effect)) == 1) { + no_ranef <- rep(list(no_random_effect), n.fits) + dim(no_ranef) <- dim(fit_indices) + } else { + if (!identical(dim(no_random_effect), dim(fit_indices))) { + stop("Dimensions of argument 'no_random_effect' are not suitable") + } if (is(no_random_effect, "illparms.mhmkin")) { - if (identical(dim(no_random_effect), dim(fit_indices))) { - no_ranef_split <- strsplit(no_random_effect[[fit_index]], ", ") - no_ranef <- sapply(no_ranef_split, function(x) { - gsub("sd\\((.*)\\)", "\\1", x) + no_ranef_dim <- dim(no_random_effect) + no_ranef <- lapply(no_random_effect, function(x) { + no_ranef_split <- strsplit(x, ", ") + ret <- sapply(no_ranef_split, function(y) { + gsub("sd\\((.*)\\)", "\\1", y) }) - } else { - stop("Dimensions of illparms.mhmkin object given as 'no_random_effect' are not suitable") - } + return(ret) + }) + dim(no_ranef) <- no_ranef_dim } else { no_ranef <- no_random_effect } + } + + fit_function <- function(fit_index) { + w <- which(fit_indices == fit_index, arr.ind = TRUE) + deg_index <- w[1] + error_index <- w[2] + mmkin_row <- objects[[error_index]][deg_index, ] res <- try(do.call(backend_function, - args = c(list(mmkin_row), dot_args, list(no_random_effect = no_ranef)))) + args = c( + list(mmkin_row), + dot_args, + list(no_random_effect = no_ranef[[deg_index, error_index]])))) return(res) } @@ -145,15 +195,16 @@ mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", #' @param j Column index selecting the fits to specific datasets #' @param drop If FALSE, the method always returns an mhmkin object, otherwise #' either a list of fit objects or a single fit object. -#' @return An object of class \code{\link{mhmkin}}. +#' @return An object inheriting from \code{\link{mhmkin}}. #' @rdname mhmkin #' @export `[.mhmkin` <- function(x, i, j, ..., drop = FALSE) { + original_class <- class(x) class(x) <- NULL x_sub <- x[i, j, drop = drop] if (!drop) { - class(x_sub) <- "mhmkin" + class(x_sub) <- original_class } return(x_sub) } diff --git a/log/check.log b/log/check.log index 31fc31eb..42365918 100644 --- a/log/check.log +++ b/log/check.log @@ -5,7 +5,7 @@ * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘1.2.1’ +* this is package ‘mkin’ version ‘1.2.2’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers Maintainer: ‘Johannes Ranke ’ @@ -18,7 +18,7 @@ Maintainer: ‘Johannes Ranke ’ * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking serialization versions ... OK -* checking whether package ‘mkin’ can be installed ... OK +* checking whether package ‘mkin’ can be installed ... [11s/11s] OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK @@ -41,7 +41,7 @@ Maintainer: ‘Johannes Ranke ’ * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK -* checking R code for possible problems ... [17s/17s] OK +* checking R code for possible problems ... [19s/19s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -57,7 +57,7 @@ Maintainer: ‘Johannes Ranke ’ * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... [20s/20s] OK +* checking examples ... [24s/24s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK diff --git a/log/test.log b/log/test.log index e17ecc1f..84fa49b9 100644 --- a/log/test.log +++ b/log/test.log @@ -1,58 +1,58 @@ ℹ Testing mkin ✔ | F W S OK | Context ✔ | 5 | AIC calculation -✔ | 5 | Analytical solutions for coupled models [3.3s] +✔ | 5 | Analytical solutions for coupled models [4.2s] ✔ | 5 | Calculation of Akaike weights ✔ | 3 | Export dataset for reading into CAKE -✔ | 12 | Confidence intervals and p-values [1.1s] -✔ | 1 12 | Dimethenamid data from 2018 [32.2s] +✔ | 12 | Confidence intervals and p-values [1.2s] +✔ | 1 12 | Dimethenamid data from 2018 [42.0s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data Reason: Fitting this ODE model with saemix takes about 15 minutes on my system ──────────────────────────────────────────────────────────────────────────────── -✔ | 14 | Error model fitting [4.9s] +✔ | 14 | Error model fitting [6.5s] ✔ | 5 | Time step normalisation -✔ | 4 | Calculation of FOCUS chi2 error levels [0.6s] -✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s] -✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3s] -✔ | 1 | Fitting the logistic model [0.2s] -✔ | 8 | Batch fitting and diagnosing hierarchical kinetic models [14.5s] -✔ | 1 11 | Nonlinear mixed-effects models [13.1s] +✔ | 4 | Calculation of FOCUS chi2 error levels [0.7s] +✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [1.1s] +✔ | 4 | Test fitting the decline of metabolites from their maximum [0.5s] +✔ | 1 | Fitting the logistic model [0.3s] +✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [54.1s] +✔ | 1 11 | Nonlinear mixed-effects models [14.3s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits Reason: Fitting with saemix takes around 10 minutes when using deSolve ──────────────────────────────────────────────────────────────────────────────── ✔ | 3 | Test dataset classes mkinds and mkindsg -✔ | 10 | Special cases of mkinfit calls [0.4s] -✔ | 3 | mkinfit features [0.7s] -✔ | 8 | mkinmod model generation and printing [0.2s] +✔ | 10 | Special cases of mkinfit calls [0.8s] +✔ | 3 | mkinfit features [0.9s] +✔ | 8 | mkinmod model generation and printing [0.3s] ✔ | 3 | Model predictions with mkinpredict [0.3s] -✔ | 12 | Multistart method for saem.mmkin models [50.1s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.2s] -✔ | 9 | Nonlinear mixed-effects models with nlme [8.7s] -✔ | 15 | Plotting [10.2s] +✔ | 12 | Multistart method for saem.mmkin models [80.1s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.8s] +✔ | 9 | Nonlinear mixed-effects models with nlme [11.4s] +✔ | 15 | Plotting [12.1s] ✔ | 4 | Residuals extracted from mkinfit models -✔ | 1 36 | saemix parent models [103.8s] +✔ | 1 36 | saemix parent models [85.9s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem Reason: This still takes almost 2.5 minutes although we do not solve ODEs ──────────────────────────────────────────────────────────────────────────────── -✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.4s] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.9s] ✔ | 11 | Processing of residue series -✔ | 10 | Fitting the SFORB model [3.8s] +✔ | 10 | Fitting the SFORB model [4.6s] ✔ | 1 | Summaries of old mkinfit objects ✔ | 5 | Summary [0.2s] -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2s] -✔ | 9 | Hypothesis tests [8.1s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.9s] +✔ | 9 | Hypothesis tests [11.0s] ✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 266.0 s +Duration: 342.6 s ── Skipped tests ────────────────────────────────────────────────────────────── • Fitting this ODE model with saemix takes about 15 minutes on my system (1) • Fitting with saemix takes around 10 minutes when using deSolve (1) • This still takes almost 2.5 minutes although we do not solve ODEs (1) -[ FAIL 0 | WARN 0 | SKIP 3 | PASS 268 ] +[ FAIL 0 | WARN 0 | SKIP 3 | PASS 270 ] Error while shutting down parallel: unable to terminate some child processes diff --git a/man/mhmkin.Rd b/man/mhmkin.Rd index 4230e44f..c77f4289 100644 --- a/man/mhmkin.Rd +++ b/man/mhmkin.Rd @@ -43,11 +43,12 @@ supported} \item{no_random_effect}{Default is NULL and will be passed to \link{saem}. If a character vector is supplied, it will be passed to all calls to \link{saem}, -regardless if the corresponding parameter is in the model. Alternatively, -an object of class \link{illparms.mhmkin} can be specified. This has to have -the same dimensions as the return object of the current call. In this way, -ill-defined parameters found in corresponding simpler versions of the -degradation model can be specified.} +which will exclude random effects for all matching parameters. Alternatively, +a list of character vectors or an object of class \link{illparms.mhmkin} can be +specified. They have to have the same dimensions that the return object of +the current call will have, i.e. the number of rows must match the number +of degradation models in the mmkin object(s), and the number of columns must +match the number of error models used in the mmkin object(s).} \item{cores}{The number of cores to be used for multicore processing. This is only used when the \code{cluster} argument is \code{NULL}. On Windows @@ -74,7 +75,7 @@ be indexed using the degradation model names for the first index (row index) and the error model names for the second index (column index), with class attribute 'mhmkin'. -An object of class \code{\link{mhmkin}}. +An object inheriting from \code{\link{mhmkin}}. } \description{ The name of the methods expresses that (\strong{m}ultiple) \strong{h}ierarchichal @@ -82,6 +83,43 @@ The name of the methods expresses that (\strong{m}ultiple) \strong{h}ierarchicha fitted. Our kinetic models are nonlinear, so we can use various nonlinear mixed-effects model fitting functions. } +\examples{ +\dontrun{ +# We start with separate evaluations of all the first six datasets with two +# degradation models and two error models +f_sep_const <- mmkin(c("SFO", "FOMC"), ds_fomc[1:6], cores = 2, quiet = TRUE) +f_sep_tc <- update(f_sep_const, error_model = "tc") +# The mhmkin function sets up hierarchical degradation models aka +# nonlinear mixed-effects models for all four combinations, specifying +# uncorrelated random effects for all degradation parameters +f_saem_1 <- mhmkin(list(f_sep_const, f_sep_tc), cores = 2) +status(f_saem_1) +# The 'illparms' function shows that in all hierarchical fits, at least +# one random effect is ill-defined (the confidence interval for the +# random effect expressed as standard deviation includes zero) +illparms(f_saem_1) +# Therefore we repeat the fits, excluding the ill-defined random effects +f_saem_2 <- update(f_saem_1, no_random_effect = illparms(f_saem_1)) +status(f_saem_2) +illparms(f_saem_2) +# Model comparisons show that FOMC with two-component error is preferable, +# and confirms our reduction of the default parameter model +anova(f_saem_1) +anova(f_saem_2) +# The convergence plot for the selected model looks fine +saemix::plot(f_saem_2[["FOMC", "tc"]]$so, plot.type = "convergence") +# The plot of predictions versus data shows that we have a pretty data-rich +# situation with homogeneous distribution of residuals, because we used the +# same degradation model, error model and parameter distribution model that +# was used in the data generation. +plot(f_saem_2[["FOMC", "tc"]]) +# We can specify the same parameter model reductions manually +no_ranef <- list("parent_0", "log_beta", "parent_0", c("parent_0", "log_beta")) +dim(no_ranef) <- c(2, 2) +f_saem_2m <- update(f_saem_1, no_random_effect = no_ranef) +anova(f_saem_2m) +} +} \seealso{ \code{\link{[.mhmkin}} for subsetting \link{mhmkin} objects } diff --git a/tests/testthat/illparms_hfits_synth.txt b/tests/testthat/illparms_hfits_synth.txt index affd1318..7a69645b 100644 --- a/tests/testthat/illparms_hfits_synth.txt +++ b/tests/testthat/illparms_hfits_synth.txt @@ -1,8 +1,4 @@ error -degradation const - SFO - FOMC sd(log_alpha), sd(log_beta) - error -degradation tc - SFO sd(parent_0) - FOMC sd(parent_0), sd(log_alpha), sd(log_beta) +degradation const tc + SFO sd(parent_0) sd(parent_0) + FOMC sd(log_beta) sd(parent_0), sd(log_beta) diff --git a/tests/testthat/print_fits_synth_const.txt b/tests/testthat/print_fits_synth_const.txt index b4bbe6ca..5d076d3d 100644 --- a/tests/testthat/print_fits_synth_const.txt +++ b/tests/testthat/print_fits_synth_const.txt @@ -4,8 +4,6 @@ Status of individual fits: dataset model 1 2 3 4 5 6 SFO OK OK OK OK OK OK - FOMC C OK OK OK OK C + FOMC OK OK OK OK OK OK -C: Optimisation did not converge: -false convergence (8) OK: No warnings diff --git a/tests/testthat/summary_hfit_sfo_tc.txt b/tests/testthat/summary_hfit_sfo_tc.txt index 0a61f75f..0618c715 100644 --- a/tests/testthat/summary_hfit_sfo_tc.txt +++ b/tests/testthat/summary_hfit_sfo_tc.txt @@ -8,7 +8,7 @@ Equations: d_parent/dt = - k_parent * parent Data: -104 observations of 1 variable(s) grouped in 6 datasets +95 observations of 1 variable(s) grouped in 6 datasets Model predictions using solution type analytical @@ -19,7 +19,7 @@ Variance model: Two-component variance function Starting values for degradation parameters: parent_0 log_k_parent - 101 -3 + 94 -2 Fixed degradation parameter values: None @@ -27,7 +27,7 @@ None Starting values for random effects (square root of initial entries in omega): parent_0 log_k_parent parent_0 4 0.0 -log_k_parent 0 0.4 +log_k_parent 0 0.7 Starting values for error model parameters: a.1 b.1 @@ -37,15 +37,15 @@ Results: Likelihood computed by importance sampling AIC BIC logLik - 524 523 -257 + 542 541 -266 Optimised parameters: - est. lower upper -parent_0 100.68 99.27 102.08 -log_k_parent -3.38 -3.55 -3.21 -a.1 0.87 0.59 1.14 -b.1 0.05 0.04 0.06 -SD.log_k_parent 0.21 0.09 0.33 + est. lower upper +parent_0 92.52 89.11 95.9 +log_k_parent -1.66 -2.07 -1.3 +a.1 2.03 1.60 2.5 +b.1 0.09 0.07 0.1 +SD.log_k_parent 0.51 0.22 0.8 Correlation: pr_0 @@ -53,18 +53,18 @@ log_k_parent 0.1 Random effects: est. lower upper -SD.log_k_parent 0.2 0.09 0.3 +SD.log_k_parent 0.5 0.2 0.8 Variance model: est. lower upper -a.1 0.87 0.59 1.14 -b.1 0.05 0.04 0.06 +a.1 2.03 1.60 2.5 +b.1 0.09 0.07 0.1 Backtransformed parameters: - est. lower upper -parent_0 1e+02 99.27 1e+02 -k_parent 3e-02 0.03 4e-02 + est. lower upper +parent_0 92.5 89.1 95.9 +k_parent 0.2 0.1 0.3 Estimated disappearance times: DT50 DT90 -parent 20 68 +parent 4 12 diff --git a/tests/testthat/test_mhmkin.R b/tests/testthat/test_mhmkin.R index e2339f28..da063326 100644 --- a/tests/testthat/test_mhmkin.R +++ b/tests/testthat/test_mhmkin.R @@ -3,8 +3,11 @@ context("Batch fitting and diagnosing hierarchical kinetic models") test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", { skip_on_cran() - fits_synth_const <- suppressWarnings( - mmkin(c("SFO", "FOMC"), ds_sfo[1:6], cores = n_cores, quiet = TRUE)) + fits_synth_const <- mmkin(c("SFO", "FOMC"), ds_fomc[1:6], cores = n_cores, quiet = TRUE) + + expect_known_output( + print(fits_synth_const), + "print_fits_synth_const.txt") fits_synth_tc <- suppressWarnings( update(fits_synth_const, error_model = "tc")) @@ -19,8 +22,8 @@ test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", { print(illparms(hfits)), "illparms_hfits_synth.txt") - expect_equal(which.min(AIC(hfits)), 3) - expect_equal(which.min(BIC(hfits)), 3) + expect_equal(which.min(AIC(hfits)), 4) + expect_equal(which.min(BIC(hfits)), 4) hfit_sfo_tc <- update(hfits[["SFO", "tc"]], covariance.model = diag(c(0, 1))) @@ -38,12 +41,19 @@ test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", { expect_known_output(print(test_summary, digits = 1), "summary_hfit_sfo_tc.txt") - # It depends on the platform exactly which of the datasets fail to converge - # with FOMC, because they were generated to be SFO - skip_on_travis() - - expect_known_output( - print(fits_synth_const), - "print_fits_synth_const.txt") - + hfits_sfo_reduced <- update(hfits, + no_random_effect = illparms(hfits)) + expect_equal( + as.character(illparms(hfits_sfo_reduced)), + rep("", 4)) + + # We can also manually set up an object specifying random effects to be + # excluded. Entries in the inital list have to be by column + no_ranef <- list("parent_0", "log_beta", "parent_0", c("parent_0", "log_beta")) + dim(no_ranef) <- c(2, 2) + + hfits_sfo_reduced_2 <- update(hfits, + no_random_effect = no_ranef) + expect_equivalent(round(anova(hfits_sfo_reduced), 0), + round(anova(hfits_sfo_reduced_2), 0)) }) -- cgit v1.2.1 From 9a1136dc5550663b352239502a39a07601959644 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 2 Dec 2022 08:00:40 +0100 Subject: Update online docs --- docs/dev/news/index.html | 4 +- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/Rplot001.png | Bin 14083 -> 18113 bytes docs/dev/reference/Rplot002.png | Bin 13699 -> 38732 bytes docs/dev/reference/mhmkin-1.png | Bin 0 -> 53169 bytes docs/dev/reference/mhmkin-2.png | Bin 0 -> 113443 bytes docs/dev/reference/mhmkin.html | 103 +++++++++++++++++++++++++++++++++++----- 7 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 docs/dev/reference/mhmkin-1.png create mode 100644 docs/dev/reference/mhmkin-2.png diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index 50afb3e9..c9663964 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -89,7 +89,9 @@
    -
    +
    • ‘R/mhmkin.R’: Allow an ‘illparms.mhmkin’ object or a list with suitable dimensions as value of the argument ‘no_random_effects’, making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well.

    • +
    • ‘R/summary.saem.mmkin.R’: List all initial parameter values in the summary, including random effects and error model parameters

    • +
    • ‘{data,R}/ds_mixed.rda’: Include the test data in the package instead of generating it in ‘tests/testthat/setup_script.R’. Refactor the generating code to make it consistent and update tests.

    • diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 0669ac9c..33252d6f 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -13,7 +13,7 @@ articles: dimethenamid_2018: web_only/dimethenamid_2018.html multistart: web_only/multistart.html saem_benchmarks: web_only/saem_benchmarks.html -last_built: 2022-11-24T06:50Z +last_built: 2022-12-02T06:58Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png index ca982688..8a77fc7f 100644 Binary files a/docs/dev/reference/Rplot001.png and b/docs/dev/reference/Rplot001.png differ diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png index de2d61aa..c1621707 100644 Binary files a/docs/dev/reference/Rplot002.png and b/docs/dev/reference/Rplot002.png differ diff --git a/docs/dev/reference/mhmkin-1.png b/docs/dev/reference/mhmkin-1.png new file mode 100644 index 00000000..2ecb6759 Binary files /dev/null and b/docs/dev/reference/mhmkin-1.png differ diff --git a/docs/dev/reference/mhmkin-2.png b/docs/dev/reference/mhmkin-2.png new file mode 100644 index 00000000..9bb43d35 Binary files /dev/null and b/docs/dev/reference/mhmkin-2.png differ diff --git a/docs/dev/reference/mhmkin.html b/docs/dev/reference/mhmkin.html index e72d17f9..1328aa48 100644 --- a/docs/dev/reference/mhmkin.html +++ b/docs/dev/reference/mhmkin.html @@ -113,7 +113,6 @@ mhmkin( backend = "saemix", algorithm = "saem", no_random_effect = NULL, - auto_ranef_threshold = 3, ..., cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL @@ -150,16 +149,14 @@ supported

      no_random_effect
      -

      Default is NULL and will be passed to saem. If -you specify "auto", random effects are only included if the number -of datasets in which the parameter passed the t-test is at least 'auto_ranef_threshold'. -Beware that while this may make for convenient model reduction or even -numerical stability of the algorithm, it will likely lead to -underparameterised models.

      - - -
      auto_ranef_threshold
      -

      See 'no_random_effect.

      +

      Default is NULL and will be passed to saem. If a +character vector is supplied, it will be passed to all calls to saem, +which will exclude random effects for all matching parameters. Alternatively, +a list of character vectors or an object of class illparms.mhmkin can be +specified. They have to have the same dimensions that the return object of +the current call will have, i.e. the number of rows must match the number +of degradation models in the mmkin object(s), and the number of columns must +match the number of error models used in the mmkin object(s).

      cores
      @@ -203,7 +200,7 @@ and the error model names for the second index (column index), with class attribute 'mhmkin'.

      -

      An object of class mhmkin.

      +

      An object inheriting from mhmkin.

    See also

    @@ -214,6 +211,88 @@ attribute 'mhmkin'.

    Johannes Ranke

    +
    +

    Examples

    +
    # \dontrun{
    +# We start with separate evaluations of all the first six datasets with two
    +# degradation models and two error models
    +f_sep_const <- mmkin(c("SFO", "FOMC"), ds_fomc[1:6], cores = 2, quiet = TRUE)
    +f_sep_tc <- update(f_sep_const, error_model = "tc")
    +# The mhmkin function sets up hierarchical degradation models aka
    +# nonlinear mixed-effects models for all four combinations, specifying
    +# uncorrelated random effects for all degradation parameters
    +f_saem_1 <- mhmkin(list(f_sep_const, f_sep_tc), cores = 2)
    +status(f_saem_1)
    +#>            error
    +#> degradation const tc
    +#>        SFO  OK    OK
    +#>        FOMC OK    OK
    +#> 
    +#> OK: Fit terminated successfully
    +# The 'illparms' function shows that in all hierarchical fits, at least
    +# one random effect is ill-defined (the confidence interval for the
    +# random effect expressed as standard deviation includes zero)
    +illparms(f_saem_1)
    +#>            error
    +#> degradation const        tc                        
    +#>        SFO  sd(parent_0) sd(parent_0)              
    +#>        FOMC sd(log_beta) sd(parent_0), sd(log_beta)
    +# Therefore we repeat the fits, excluding the ill-defined random effects
    +f_saem_2 <- update(f_saem_1, no_random_effect = illparms(f_saem_1))
    +status(f_saem_2)
    +#>            error
    +#> degradation const tc
    +#>        SFO  OK    OK
    +#>        FOMC OK    OK
    +#> 
    +#> OK: Fit terminated successfully
    +illparms(f_saem_2)
    +#>            error
    +#> degradation const tc
    +#>        SFO          
    +#>        FOMC         
    +# Model comparisons show that FOMC with two-component error is preferable,
    +# and confirms our reduction of the default parameter model
    +anova(f_saem_1)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     5 574.40 573.35 -282.20
    +#> SFO tc        6 543.72 542.47 -265.86
    +#> FOMC const    7 489.67 488.22 -237.84
    +#> FOMC tc       8 406.11 404.44 -195.05
    +anova(f_saem_2)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     4 572.22 571.39 -282.11
    +#> SFO tc        5 541.63 540.59 -265.81
    +#> FOMC const    6 487.38 486.13 -237.69
    +#> FOMC tc       6 402.12 400.88 -195.06
    +# The convergence plot for the selected model looks fine
    +saemix::plot(f_saem_2[["FOMC", "tc"]]$so, plot.type = "convergence")
    +
    +# The plot of predictions versus data shows that we have a pretty data-rich
    +# situation with homogeneous distribution of residuals, because we used the
    +# same degradation model, error model and parameter distribution model that
    +# was used in the data generation.
    +plot(f_saem_2[["FOMC", "tc"]])
    +
    +# We can specify the same parameter model reductions manually
    +no_ranef <- list("parent_0", "log_beta", "parent_0", c("parent_0", "log_beta"))
    +dim(no_ranef) <- c(2, 2)
    +f_saem_2m <- update(f_saem_1, no_random_effect = no_ranef)
    +anova(f_saem_2m)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     4 572.22 571.39 -282.11
    +#> SFO tc        5 541.63 540.59 -265.81
    +#> FOMC const    6 487.38 486.13 -237.69
    +#> FOMC tc       6 402.12 400.88 -195.06
    +# }
    +
    +
    @@ -1536,17 +1529,17 @@ FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

    Since mkin version 0.9-32 (July 2014), we can use shorthand notation like "SFO" for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.

    m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
     summary(m.L1.SFO)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:35 2022 
    -## Date of summary: Wed Sep 14 22:28:35 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:45 2022 
    +## Date of summary: Tue Dec  6 09:39:45 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - k_parent * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 133 model solutions performed in 0.032 s
    +## Fitted using 133 model solutions performed in 0.033 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -1637,10 +1630,10 @@ summary(m.L1.SFO)
    ## Warning in sqrt(1/diag(V)): NaNs produced
    ## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
     ## doubtful
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:35 2022 
    -## Date of summary: Wed Sep 14 22:28:35 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:45 2022 
    +## Date of summary: Tue Dec  6 09:39:45 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
    @@ -1742,17 +1735,17 @@ plot(m.L2.FOMC, show_residuals = TRUE,
          main = "FOCUS L2 - FOMC")

    summary(m.L2.FOMC, data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:35 2022 
    -## Date of summary: Wed Sep 14 22:28:35 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:45 2022 
    +## Date of summary: Tue Dec  6 09:39:45 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 239 model solutions performed in 0.049 s
    +## Fitted using 239 model solutions performed in 0.048 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -1820,10 +1813,10 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
          main = "FOCUS L2 - DFOP")

    summary(m.L2.DFOP, data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:36 2022 
    -## Date of summary: Wed Sep 14 22:28:36 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:46 2022 
    +## Date of summary: Tue Dec  6 09:39:46 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    @@ -1832,7 +1825,7 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 581 model solutions performed in 0.135 s
    +## Fitted using 581 model solutions performed in 0.131 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -1920,10 +1913,10 @@ plot(mm.L3)

    The objects returned by mmkin are arranged like a matrix, with models as a row index and datasets as a column index.

    We can extract the summary and plot for e.g. the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.

    summary(mm.L3[["DFOP", 1]])
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:36 2022 
    -## Date of summary: Wed Sep 14 22:28:36 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:46 2022 
    +## Date of summary: Tue Dec  6 09:39:46 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    @@ -1932,7 +1925,7 @@ plot(mm.L3)
    ## ## Model predictions using solution type analytical ## -## Fitted using 376 model solutions performed in 0.081 s +## Fitted using 376 model solutions performed in 0.078 s ## ## Error model: Constant variance ## @@ -2028,17 +2021,17 @@ plot(mm.L4)

    The χ2 error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the χ2 test passes is slightly lower for the FOMC model. However, the difference appears negligible.

    summary(mm.L4[["SFO", 1]], data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:36 2022 
    -## Date of summary: Wed Sep 14 22:28:37 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:47 2022 
    +## Date of summary: Tue Dec  6 09:39:47 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - k_parent * parent
     ## 
     ## Model predictions using solution type analytical 
     ## 
    -## Fitted using 142 model solutions performed in 0.034 s
    +## Fitted using 142 model solutions performed in 0.03 s
     ## 
     ## Error model: Constant variance 
     ## 
    @@ -2092,10 +2085,10 @@ plot(mm.L4)
    ## DT50 DT90 ## parent 106 352
    summary(mm.L4[["FOMC", 1]], data = FALSE)
    -
    ## mkin version used for fitting:    1.1.2 
    -## R version used for fitting:       4.2.1 
    -## Date of fit:     Wed Sep 14 22:28:37 2022 
    -## Date of summary: Wed Sep 14 22:28:37 2022 
    +
    ## mkin version used for fitting:    1.2.2 
    +## R version used for fitting:       4.2.2 
    +## Date of fit:     Tue Dec  6 09:39:47 2022 
    +## Date of summary: Tue Dec  6 09:39:47 2022 
     ## 
     ## Equations:
     ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
    -- 
    cgit v1.2.1
    
    
    From 97f71fc3d086bd447ab3e4d19abf32bb3114085b Mon Sep 17 00:00:00 2001
    From: Johannes Ranke 
    Date: Wed, 7 Dec 2022 14:41:52 +0100
    Subject: Check slopes in saemix covariate models
    
    ---
     NEWS.md         |  2 ++
     R/illparms.R    | 14 +++++++++++++-
     log/test.log    | 41 ++++++++++++++++-------------------------
     man/illparms.Rd | 13 ++++++++++++-
     4 files changed, 43 insertions(+), 27 deletions(-)
    
    diff --git a/NEWS.md b/NEWS.md
    index c7929fbe..1931142c 100644
    --- a/NEWS.md
    +++ b/NEWS.md
    @@ -6,6 +6,8 @@
     
     - 'R/parplot.R': Possibility to select the top 'llquant' fraction of the fits for the parameter plots, and improved legend text.
     
    +- 'R/illparms.R': Also check if confidence intervals for slope parameters in covariate models include zero. Only implemented for fits obtained with the saemix backend.
    +
     # mkin 1.2.1 (2022-11-19)
     
     - '{data,R}/ds_mixed.rda': Include the test data in the package instead of generating it in 'tests/testthat/setup_script.R'. Refactor the generating code to make it consistent and update tests.
    diff --git a/R/illparms.R b/R/illparms.R
    index 01e75cf1..eef4bd33 100644
    --- a/R/illparms.R
    +++ b/R/illparms.R
    @@ -20,6 +20,9 @@
     #' @param random For hierarchical fits, should random effects be tested?
     #' @param errmod For hierarchical fits, should error model parameters be
     #' tested?
    +#' @param slopes For hierarchical [saem] fits using saemix as backend,
    +#' should slope parameters in the covariate model(starting with 'beta_') be
    +#' tested?
     #' @return For [mkinfit] or [saem] objects, a character vector of parameter
     #' names. For [mmkin] or [mhmkin] objects, a matrix like object of class
     #' 'illparms.mmkin' or 'illparms.mhmkin'.
    @@ -92,7 +95,7 @@ print.illparms.mmkin <- function(x, ...) {
     
     #' @rdname illparms
     #' @export
    -illparms.saem.mmkin <- function(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...) {
    +illparms.saem.mmkin <- function(object, conf.level = 0.95, random = TRUE, errmod = TRUE, slopes = TRUE, ...) {
       if (inherits(object$so, "try-error")) {
         ill_parms <- NA
       } else {
    @@ -106,6 +109,15 @@ illparms.saem.mmkin <- function(object, conf.level = 0.95, random = TRUE, errmod
           ill_parms_errmod <- ints$errmod[, "lower"] < 0 & ints$errmod[, "est."] > 0
           ill_parms <- c(ill_parms, names(which(ill_parms_errmod)))
         }
    +    if (slopes) {
    +      if (is.null(object$so)) stop("Slope testing is only implemented for the saemix backend")
    +      slope_names <- grep("^beta_", object$so@model@name.fixed, value = TRUE)
    +      ci <- object$so@results@conf.int
    +      rownames(ci) <- ci$name
    +      slope_ci <- ci[slope_names, ]
    +      ill_parms_slopes <- slope_ci[, "lower"] < 0 & slope_ci[, "estimate"] > 0
    +      ill_parms <- c(ill_parms, slope_names[ill_parms_slopes])
    +    }
       }
       class(ill_parms) <- "illparms.saem.mmkin"
       return(ill_parms)
    diff --git a/log/test.log b/log/test.log
    index 7614b136..af2ffc41 100644
    --- a/log/test.log
    +++ b/log/test.log
    @@ -1,23 +1,23 @@
     ℹ Testing mkin
     ✔ | F W S  OK | Context
     ✔ |         5 | AIC calculation
    -✔ |         5 | Analytical solutions for coupled models [3.2s]
    +✔ |         5 | Analytical solutions for coupled models [3.4s]
     ✔ |         5 | Calculation of Akaike weights
     ✔ |         3 | Export dataset for reading into CAKE
     ✔ |        12 | Confidence intervals and p-values [1.1s]
    -✔ |     1  12 | Dimethenamid data from 2018 [32.0s]
    +✔ |     1  12 | Dimethenamid data from 2018 [32.7s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data
     Reason: Fitting this ODE model with saemix takes about 15 minutes on my system
     ────────────────────────────────────────────────────────────────────────────────
    -✔ |        14 | Error model fitting [4.8s]
    +✔ |        14 | Error model fitting [5.0s]
     ✔ |         5 | Time step normalisation
     ✔ |         4 | Calculation of FOCUS chi2 error levels [0.6s]
     ✔ |        14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s]
    -✔ |         4 | Test fitting the decline of metabolites from their maximum [0.3s]
    +✔ |         4 | Test fitting the decline of metabolites from their maximum [0.4s]
     ✔ |         1 | Fitting the logistic model [0.2s]
    -✔ |        10 | Batch fitting and diagnosing hierarchical kinetic models [42.2s]
    -✔ |     1  11 | Nonlinear mixed-effects models [13.3s]
    +✔ |        10 | Batch fitting and diagnosing hierarchical kinetic models [43.4s]
    +✔ |     1  11 | Nonlinear mixed-effects models [13.5s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits
     Reason: Fitting with saemix takes around 10 minutes when using deSolve
    @@ -27,40 +27,31 @@ Reason: Fitting with saemix takes around 10 minutes when using deSolve
     ✔ |         3 | mkinfit features [0.7s]
     ✔ |         8 | mkinmod model generation and printing [0.2s]
     ✔ |         3 | Model predictions with mkinpredict [0.4s]
    -✖ | 1      11 | Multistart method for saem.mmkin models [46.7s]
    -────────────────────────────────────────────────────────────────────────────────
    -Failure ('test_multistart.R:56'): multistart works for saem.mmkin models
    -Snapshot of `testcase` to 'multistart/parplot-for-dfop-sfo-fit.svg' has changed
    -Run `testthat::snapshot_review('multistart/')` to review changes
    -Backtrace:
    - 1. vdiffr::expect_doppelganger("parplot for dfop sfo fit", parplot_dfop_sfo)
    -      at test_multistart.R:56:2
    - 3. testthat::expect_snapshot_file(...)
    -────────────────────────────────────────────────────────────────────────────────
    +✔ |        12 | Multistart method for saem.mmkin models [50.1s]
     ✔ |        16 | Evaluations according to 2015 NAFTA guidance [2.2s]
    -✔ |         9 | Nonlinear mixed-effects models with nlme [9.4s]
    -✔ |        15 | Plotting [10.1s]
    +✔ |         9 | Nonlinear mixed-effects models with nlme [9.8s]
    +✔ |        15 | Plotting [10.5s]
     ✔ |         4 | Residuals extracted from mkinfit models
    -✔ |     1  36 | saemix parent models [73.6s]
    +✔ |     1  36 | saemix parent models [85.7s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem
     Reason: This still takes almost 2.5 minutes although we do not solve ODEs
     ────────────────────────────────────────────────────────────────────────────────
    -✔ |         2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.4s]
    +✔ |         2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5s]
     ✔ |        11 | Processing of residue series
    -✔ |        10 | Fitting the SFORB model [3.7s]
    +✔ |        10 | Fitting the SFORB model [3.9s]
     ✔ |         1 | Summaries of old mkinfit objects
     ✔ |         5 | Summary [0.2s]
    -✔ |         4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.3s]
    -✔ |         9 | Hypothesis tests [8.1s]
    +✔ |         4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2s]
    +✔ |         9 | Hypothesis tests [8.2s]
     ✔ |         4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s]
     
     ══ Results ═════════════════════════════════════════════════════════════════════
    -Duration: 260.9 s
    +Duration: 280.1 s
     
     ── Skipped tests  ──────────────────────────────────────────────────────────────
     • Fitting this ODE model with saemix takes about 15 minutes on my system (1)
     • Fitting with saemix takes around 10 minutes when using deSolve (1)
     • This still takes almost 2.5 minutes although we do not solve ODEs (1)
     
    -[ FAIL 1 | WARN 0 | SKIP 3 | PASS 269 ]
    +[ FAIL 0 | WARN 0 | SKIP 3 | PASS 270 ]
    diff --git a/man/illparms.Rd b/man/illparms.Rd
    index 14be9c35..75eb18f0 100644
    --- a/man/illparms.Rd
    +++ b/man/illparms.Rd
    @@ -22,7 +22,14 @@ illparms(object, ...)
     
     \method{print}{illparms.mmkin}(x, ...)
     
    -\method{illparms}{saem.mmkin}(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...)
    +\method{illparms}{saem.mmkin}(
    +  object,
    +  conf.level = 0.95,
    +  random = TRUE,
    +  errmod = TRUE,
    +  slopes = TRUE,
    +  ...
    +)
     
     \method{print}{illparms.saem.mmkin}(x, ...)
     
    @@ -43,6 +50,10 @@ illparms(object, ...)
     
     \item{errmod}{For hierarchical fits, should error model parameters be
     tested?}
    +
    +\item{slopes}{For hierarchical \link{saem} fits using saemix as backend,
    +should slope parameters in the covariate model(starting with 'beta_') be
    +tested?}
     }
     \value{
     For \link{mkinfit} or \link{saem} objects, a character vector of parameter
    -- 
    cgit v1.2.1
    
    
    From 904ba9668eb76eaae4960e2188134e8c88da07ee Mon Sep 17 00:00:00 2001
    From: Johannes Ranke 
    Date: Wed, 7 Dec 2022 16:19:54 +0100
    Subject: Fix parplot for the case of failed multistart runs
    
    ---
     NEWS.md     | 2 ++
     R/parms.R   | 2 +-
     R/parplot.R | 2 +-
     3 files changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/NEWS.md b/NEWS.md
    index 1931142c..4540b517 100644
    --- a/NEWS.md
    +++ b/NEWS.md
    @@ -8,6 +8,8 @@
     
     - 'R/illparms.R': Also check if confidence intervals for slope parameters in covariate models include zero. Only implemented for fits obtained with the saemix backend.
     
    +- 'R/parplot.R': Make the function work also in the case that some of the multistart runs failed.
    +
     # mkin 1.2.1 (2022-11-19)
     
     - '{data,R}/ds_mixed.rda': Include the test data in the package instead of generating it in 'tests/testthat/setup_script.R'. Refactor the generating code to make it consistent and update tests.
    diff --git a/R/parms.R b/R/parms.R
    index bd4e479b..bb04a570 100644
    --- a/R/parms.R
    +++ b/R/parms.R
    @@ -77,6 +77,6 @@ parms.multistart <- function(object, exclude_failed = TRUE, ...) {
       successful <- which(!is.na(res[, 1]))
       first_success <- successful[1]
       colnames(res) <- names(parms(object[[first_success]]))
    -  if (exclude_failed) res <- res[successful, ]
    +  if (exclude_failed[1]) res <- res[successful, ]
       return(res)
     }
    diff --git a/R/parplot.R b/R/parplot.R
    index 63306ac2..e9c18947 100644
    --- a/R/parplot.R
    +++ b/R/parplot.R
    @@ -41,7 +41,7 @@ parplot.multistart.saem.mmkin <- function(object, llmin = -Inf, llquant = NA,
       orig <- attr(object, "orig")
       orig_parms <- parms(orig)
       start_degparms <- orig$mean_dp_start
    -  all_parms <- parms(object)
    +  all_parms <- parms(object, exclude_failed = FALSE)
     
       if (inherits(object, "multistart.saem.mmkin")) {
         llfunc <- function(object) {
    -- 
    cgit v1.2.1
    
    
    From 7c8b3db180be371cb03b9518f14117060fbc4239 Mon Sep 17 00:00:00 2001
    From: Johannes Ranke 
    Date: Mon, 12 Dec 2022 12:20:50 +0100
    Subject: Run tests with new CPU and RAM
    
    ---
     log/test.log | 52 ++++++++++++++++++++++++++--------------------------
     1 file changed, 26 insertions(+), 26 deletions(-)
    
    diff --git a/log/test.log b/log/test.log
    index af2ffc41..89265100 100644
    --- a/log/test.log
    +++ b/log/test.log
    @@ -1,53 +1,53 @@
     ℹ Testing mkin
     ✔ | F W S  OK | Context
     ✔ |         5 | AIC calculation
    -✔ |         5 | Analytical solutions for coupled models [3.4s]
    +✔ |         5 | Analytical solutions for coupled models [1.5s]
     ✔ |         5 | Calculation of Akaike weights
     ✔ |         3 | Export dataset for reading into CAKE
    -✔ |        12 | Confidence intervals and p-values [1.1s]
    -✔ |     1  12 | Dimethenamid data from 2018 [32.7s]
    +✔ |        12 | Confidence intervals and p-values [0.4s]
    +✔ |     1  12 | Dimethenamid data from 2018 [12.3s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data
     Reason: Fitting this ODE model with saemix takes about 15 minutes on my system
     ────────────────────────────────────────────────────────────────────────────────
    -✔ |        14 | Error model fitting [5.0s]
    +✔ |        14 | Error model fitting [2.3s]
     ✔ |         5 | Time step normalisation
    -✔ |         4 | Calculation of FOCUS chi2 error levels [0.6s]
    -✔ |        14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s]
    -✔ |         4 | Test fitting the decline of metabolites from their maximum [0.4s]
    -✔ |         1 | Fitting the logistic model [0.2s]
    -✔ |        10 | Batch fitting and diagnosing hierarchical kinetic models [43.4s]
    -✔ |     1  11 | Nonlinear mixed-effects models [13.5s]
    +✔ |         4 | Calculation of FOCUS chi2 error levels [0.3s]
    +✔ |        14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.4s]
    +✔ |         4 | Test fitting the decline of metabolites from their maximum [0.2s]
    +✔ |         1 | Fitting the logistic model [0.1s]
    +✔ |        10 | Batch fitting and diagnosing hierarchical kinetic models [18.2s]
    +✔ |     1  11 | Nonlinear mixed-effects models [5.8s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits
     Reason: Fitting with saemix takes around 10 minutes when using deSolve
     ────────────────────────────────────────────────────────────────────────────────
     ✔ |         3 | Test dataset classes mkinds and mkindsg
    -✔ |        10 | Special cases of mkinfit calls [0.6s]
    -✔ |         3 | mkinfit features [0.7s]
    -✔ |         8 | mkinmod model generation and printing [0.2s]
    -✔ |         3 | Model predictions with mkinpredict [0.4s]
    -✔ |        12 | Multistart method for saem.mmkin models [50.1s]
    -✔ |        16 | Evaluations according to 2015 NAFTA guidance [2.2s]
    -✔ |         9 | Nonlinear mixed-effects models with nlme [9.8s]
    -✔ |        15 | Plotting [10.5s]
    +✔ |        10 | Special cases of mkinfit calls [0.4s]
    +✔ |         3 | mkinfit features [0.4s]
    +✔ |         8 | mkinmod model generation and printing
    +✔ |         3 | Model predictions with mkinpredict [0.1s]
    +✔ |        12 | Multistart method for saem.mmkin models [20.6s]
    +✔ |        16 | Evaluations according to 2015 NAFTA guidance [1.4s]
    +✔ |         9 | Nonlinear mixed-effects models with nlme [3.7s]
    +✔ |        15 | Plotting [4.7s]
     ✔ |         4 | Residuals extracted from mkinfit models
    -✔ |     1  36 | saemix parent models [85.7s]
    +✔ |     1  36 | saemix parent models [30.6s]
     ────────────────────────────────────────────────────────────────────────────────
     Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem
     Reason: This still takes almost 2.5 minutes although we do not solve ODEs
     ────────────────────────────────────────────────────────────────────────────────
    -✔ |         2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5s]
    +✔ |         2 | Complex test case from Schaefer et al. (2007) Piacenza paper [0.6s]
     ✔ |        11 | Processing of residue series
    -✔ |        10 | Fitting the SFORB model [3.9s]
    +✔ |        10 | Fitting the SFORB model [1.7s]
     ✔ |         1 | Summaries of old mkinfit objects
    -✔ |         5 | Summary [0.2s]
    -✔ |         4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2s]
    -✔ |         9 | Hypothesis tests [8.2s]
    -✔ |         4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s]
    +✔ |         5 | Summary
    +✔ |         4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [0.9s]
    +✔ |         9 | Hypothesis tests [3.3s]
    +✔ |         4 | Calculation of maximum time weighted average concentrations (TWAs) [0.7s]
     
     ══ Results ═════════════════════════════════════════════════════════════════════
    -Duration: 280.1 s
    +Duration: 111.2 s
     
     ── Skipped tests  ──────────────────────────────────────────────────────────────
     • Fitting this ODE model with saemix takes about 15 minutes on my system (1)
    -- 
    cgit v1.2.1
    
    
    From a54bd290bc3884d0000c52c1b29bc557825d9eae Mon Sep 17 00:00:00 2001
    From: Johannes Ranke 
    Date: Thu, 15 Dec 2022 14:50:28 +0100
    Subject: List random effects correlations in output if any
    
    Update docs
    ---
     NEWS.md                                    |   4 +-
     R/intervals.R                              |   8 +-
     R/summary.saem.mmkin.R                     |  16 +-
     docs/dev/index.html                        |  21 +-
     docs/dev/news/index.html                   |  57 +++-
     docs/dev/pkgdown.yml                       |   4 +-
     docs/dev/reference/Rplot001.png            | Bin 18113 -> 1011 bytes
     docs/dev/reference/Rplot002.png            | Bin 38732 -> 16953 bytes
     docs/dev/reference/illparms.html           |  15 +-
     docs/dev/reference/parplot.html            |   9 +-
     docs/dev/reference/saem.html               |  21 +-
     docs/dev/reference/summary.saem.mmkin.html | 508 ++++++++++++++++-------------
     log/test.log                               |  20 +-
     man/summary.saem.mmkin.Rd                  |  13 +-
     14 files changed, 422 insertions(+), 274 deletions(-)
    
    diff --git a/NEWS.md b/NEWS.md
    index 4540b517..7e65204f 100644
    --- a/NEWS.md
    +++ b/NEWS.md
    @@ -2,7 +2,7 @@
     
     - 'R/mhmkin.R': Allow an 'illparms.mhmkin' object or a list with suitable dimensions as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well.
     
    -- 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted.
    +- 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted. List correlations of random effects if specified by the user in the covariance model.
     
     - 'R/parplot.R': Possibility to select the top 'llquant' fraction of the fits for the parameter plots, and improved legend text.
     
    @@ -10,6 +10,8 @@
     
     - 'R/parplot.R': Make the function work also in the case that some of the multistart runs failed.
     
    +- 'R/intervals.R': Include correlations of random effects in the model in case there are any.
    +
     # mkin 1.2.1 (2022-11-19)
     
     - '{data,R}/ds_mixed.rda': Include the test data in the package instead of generating it in 'tests/testthat/setup_script.R'. Refactor the generating code to make it consistent and update tests.
    diff --git a/R/intervals.R b/R/intervals.R
    index 705ef6eb..fcdbaea9 100644
    --- a/R/intervals.R
    +++ b/R/intervals.R
    @@ -78,8 +78,12 @@ intervals.saem.mmkin <- function(object, level = 0.95, backtransform = TRUE, ...
     
       # Random effects
       sdnames <- intersect(rownames(conf.int), paste("SD", pnames, sep = "."))
    -  ranef_ret <- as.matrix(conf.int[sdnames, c("lower", "est.", "upper")])
    -  rownames(ranef_ret) <- paste0(gsub("SD\\.", "sd(", sdnames), ")")
    +  corrnames <- grep("^Corr.", rownames(conf.int), value = TRUE)
    +  ranef_ret <- as.matrix(conf.int[c(sdnames, corrnames), c("lower", "est.", "upper")])
    +  sdnames_ret <- paste0(gsub("SD\\.", "sd(", sdnames), ")")
    +  corrnames_ret <- gsub("Corr\\.(.*)\\.(.*)", "corr(\\1,\\2)", corrnames)
    +  rownames(ranef_ret) <- c(sdnames_ret, corrnames_ret)
    +
       attr(ranef_ret, "label") <- "Random effects:"
     
     
    diff --git a/R/summary.saem.mmkin.R b/R/summary.saem.mmkin.R
    index 46ab548b..49b02a50 100644
    --- a/R/summary.saem.mmkin.R
    +++ b/R/summary.saem.mmkin.R
    @@ -75,10 +75,21 @@
     #' f_saem_dfop_sfo <- saem(f_mmkin_dfop_sfo)
     #' print(f_saem_dfop_sfo)
     #' illparms(f_saem_dfop_sfo)
    -#' f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, covariance.model = diag(c(0, 0, 1, 1, 1, 0)))
    +#' f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo,
    +#'   no_random_effect = c("parent_0", "log_k_m1"))
     #' illparms(f_saem_dfop_sfo_2)
     #' intervals(f_saem_dfop_sfo_2)
     #' summary(f_saem_dfop_sfo_2, data = TRUE)
    +#' # Add a correlation between random effects of g and k2
    +#' cov_model_3 <- f_saem_dfop_sfo_2$so@model@covariance.model
    +#' cov_model_3["log_k2", "g_qlogis"] <- 1
    +#' cov_model_3["g_qlogis", "log_k2"] <- 1
    +#' f_saem_dfop_sfo_3 <- update(f_saem_dfop_sfo,
    +#'   covariance.model = cov_model_3)
    +#' intervals(f_saem_dfop_sfo_3)
    +#' # The correlation does not improve the fit judged by AIC and BIC, although
    +#' # the likelihood is higher with the additional parameter
    +#' anova(f_saem_dfop_sfo, f_saem_dfop_sfo_2, f_saem_dfop_sfo_3)
     #' }
     #'
     #' @export
    @@ -150,7 +161,8 @@ summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes =
     
       # Random effects
       sdnames <- intersect(rownames(conf.int), paste0("SD.", pnames))
    -  confint_ranef <- as.matrix(conf.int[sdnames, c("estimate", "lower", "upper")])
    +  corrnames <- grep("^Corr.", rownames(conf.int), value = TRUE)
    +  confint_ranef <- as.matrix(conf.int[c(sdnames, corrnames), c("estimate", "lower", "upper")])
       colnames(confint_ranef)[1] <- "est."
     
       # Error model
    diff --git a/docs/dev/index.html b/docs/dev/index.html
    index 2615d389..4723879e 100644
    --- a/docs/dev/index.html
    +++ b/docs/dev/index.html
    @@ -222,12 +222,21 @@
     

    References

    - - - + + + + + + + + +
    Ranke J, Wöltjen J, Schmidt J, and Comets E (2021) Taking kinetic evaluations of degradation data to the next level with nonlinear mixed-effects models. Environments 8 (8) 71 doi:10.3390/environments8080071 -
    Ranke J, Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical Degradation Data Environments 6 (12) 124 doi:10.3390/environments6120124 -
    Ranke J, Wöltjen J, Meinecke S (2018) Comparison of software tools for kinetic evaluation of chemical degradation data Environmental Sciences Europe 30 17 doi:10.1186/s12302-018-0145-1 -
    +Ranke J, Wöltjen J, Schmidt J, and Comets E (2021) Taking kinetic evaluations of degradation data to the next level with nonlinear mixed-effects models. Environments 8 (8) 71 doi:10.3390/environments8080071 +
    +Ranke J, Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical Degradation Data Environments 6 (12) 124 doi:10.3390/environments6120124 +
    +Ranke J, Wöltjen J, Meinecke S (2018) Comparison of software tools for kinetic evaluation of chemical degradation data Environmental Sciences Europe 30 17 doi:10.1186/s12302-018-0145-1 +
    diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index e2b44bf5..6127ebc6 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -90,7 +90,11 @@
    • ‘R/mhmkin.R’: Allow an ‘illparms.mhmkin’ object or a list with suitable dimensions as value of the argument ‘no_random_effects’, making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well.

    • -
    • ‘R/summary.saem.mmkin.R’: List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted.

    • +
    • ‘R/summary.saem.mmkin.R’: List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted. List correlations of random effects if specified by the user in the covariance model.

    • +
    • ‘R/parplot.R’: Possibility to select the top ‘llquant’ fraction of the fits for the parameter plots, and improved legend text.

    • +
    • ‘R/illparms.R’: Also check if confidence intervals for slope parameters in covariate models include zero. Only implemented for fits obtained with the saemix backend.

    • +
    • ‘R/parplot.R’: Make the function work also in the case that some of the multistart runs failed.

    • +
    • ‘R/intervals.R’: Include correlations of random effects in the model in case there are any.

    @@ -140,7 +144,8 @@
    -
    • ‘dimethenamid_2018’: Correct the data for the Borstel soil. The five observations from Staudenmaier (2013) that were previously stored as “Borstel 2” are actually just a subset of the 16 observations in “Borstel 1” which is now simply “Borstel”
    +
    • ‘dimethenamid_2018’: Correct the data for the Borstel soil. The five observations from Staudenmaier (2013) that were previously stored as “Borstel 2” are actually just a subset of the 16 observations in “Borstel 1” which is now simply “Borstel”
    • +
    • All plotting functions setting graphical parameters: Use on.exit() for resetting graphical parameters

    • @@ -149,10 +154,12 @@
    -
    • Review and update README, the ‘Introduction to mkin’ vignette and some of the help pages
    +
    • Review and update README, the ‘Introduction to mkin’ vignette and some of the help pages
    • +
    -
    • ‘mkinfit’: Keep model names stored in ‘mkinmod’ objects, avoiding their loss in ‘gmkin’
    +
    • ‘mkinfit’: Keep model names stored in ‘mkinmod’ objects, avoiding their loss in ‘gmkin’
    • +
    • ‘confint.mmkin’, ‘nlme.mmkin’, ‘transform_odeparms’: Fix example code in dontrun sections that failed with current defaults

    • @@ -207,7 +214,8 @@
    -
    • Increase a test tolerance to make it pass on all CRAN check machines
    +
    • Increase a test tolerance to make it pass on all CRAN check machines
    • +
    • ‘nlme.mmkin’: An nlme method for mmkin row objects and an associated S3 class with print, plot, anova and endpoint methods

    • @@ -322,7 +330,8 @@
    -
    • Remove test_FOMC_ill-defined.R as it is too platform dependent
    +
    • Remove test_FOMC_ill-defined.R as it is too platform dependent
    • +
    • Rename twa to max_twa_parent to avoid conflict with twa from my pfm package

    • @@ -334,7 +343,8 @@

      New features

      -
      • A twa function, calculating maximum time weighted average concentrations for the parent (SFO, FOMC and DFOP).
      +
      • A twa function, calculating maximum time weighted average concentrations for the parent (SFO, FOMC and DFOP).
      • +
    @@ -349,7 +359,8 @@

    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
    • +
    @@ -383,7 +394,8 @@

    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

    • Add plots to compiled_models vignette

    • @@ -403,18 +415,21 @@

      Bug fixes

      • -print.summary.mkinfit(): Avoid an error that occurred when printing summaries generated with mkin versions before 0.9-36
      +print.summary.mkinfit(): Avoid an error that occurred when printing summaries generated with mkin versions before 0.9-36 +

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

    • -DESCRIPTION, NAMESPACE, R/*.R: Import (from) stats, graphics and methods packages, and qualify some function calls for non-base packages installed with R to avoid NOTES made by R CMD check –as-cran with upcoming R versions.
    +DESCRIPTION, NAMESPACE, R/*.R: Import (from) stats, graphics and methods packages, and qualify some function calls for non-base packages installed with R to avoid NOTES made by R CMD check –as-cran with upcoming R versions. +
    @@ -426,7 +441,8 @@

    Bug fixes

    • -mkinparplot(): Fix the x axis scaling for rate constants and formation fractions that got confused by the introduction of the t-values of transformed parameters.
    +mkinparplot(): Fix the x axis scaling for rate constants and formation fractions that got confused by the introduction of the t-values of transformed parameters. +
    @@ -438,7 +454,8 @@

    Bug fixes

    • -mkinmod(): When generating the C code for the derivatives, only declare the time variable when it is needed and remove the ‘-W-no-unused-variable’ compiler flag as the C compiler used in the CRAN checks on Solaris does not know it.
    +mkinmod(): When generating the C code for the derivatives, only declare the time variable when it is needed and remove the ‘-W-no-unused-variable’ compiler flag as the C compiler used in the CRAN checks on Solaris does not know it. +
    @@ -451,13 +468,15 @@

    Minor changes

    -
    • Added a simple showcase vignette with an evaluation of FOCUS example dataset D
    +
    • Added a simple showcase vignette with an evaluation of FOCUS example dataset D
    • +

    Major changes

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

    Bug fixes

    • mkinparplot(): Avoid warnings that occurred when not all confidence intervals were available in the summary of the fit

    • @@ -539,13 +558,15 @@

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

    New features

    -
    • It is now possible to use formation fractions in combination with turning off the sink in mkinmod().
    +
    • 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.

    • diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 858f6c59..642efcde 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.9.2.1 +pandoc: 2.17.1.1 pkgdown: 2.0.6 pkgdown_sha: ~ articles: @@ -13,7 +13,7 @@ articles: dimethenamid_2018: web_only/dimethenamid_2018.html multistart: web_only/multistart.html saem_benchmarks: web_only/saem_benchmarks.html -last_built: 2022-12-02T13:08Z +last_built: 2022-12-15T13:46Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png index 8a77fc7f..17a35806 100644 Binary files a/docs/dev/reference/Rplot001.png and b/docs/dev/reference/Rplot001.png differ diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png index c1621707..27feab09 100644 Binary files a/docs/dev/reference/Rplot002.png and b/docs/dev/reference/Rplot002.png differ diff --git a/docs/dev/reference/illparms.html b/docs/dev/reference/illparms.html index 8fe71568..9c498e1c 100644 --- a/docs/dev/reference/illparms.html +++ b/docs/dev/reference/illparms.html @@ -116,7 +116,14 @@ without parameter transformations is used.

      print(x, ...) # S3 method for saem.mmkin -illparms(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...) +illparms( + object, + conf.level = 0.95, + random = TRUE, + errmod = TRUE, + slopes = TRUE, + ... +) # S3 method for illparms.saem.mmkin print(x, ...) @@ -154,6 +161,12 @@ without parameter transformations is used.

      For hierarchical fits, should error model parameters be tested?

      + +
      slopes
      +

      For hierarchical saem fits using saemix as backend, +should slope parameters in the covariate model(starting with 'beta_') be +tested?

      +

    Value

    diff --git a/docs/dev/reference/parplot.html b/docs/dev/reference/parplot.html index 9852b694..720c0b2a 100644 --- a/docs/dev/reference/parplot.html +++ b/docs/dev/reference/parplot.html @@ -103,6 +103,7 @@ or by their medians as proposed in the paper by Duchesne et al. (2021).

    parplot( object, llmin = -Inf, + llquant = NA, scale = c("best", "median"), lpos = "bottomleft", main = "", @@ -124,8 +125,14 @@ or by their medians as proposed in the paper by Duchesne et al. (2021).

    The minimum likelihood of objects to be shown

    +
    llquant
    +

    Fractional value for selecting only the fits with higher +likelihoods. Overrides 'llmin'.

    + +
    scale
    -

    By default, scale parameters using the best available fit. +

    By default, scale parameters using the best +available fit. If 'median', parameters are scaled using the median parameters from all fits.

    diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html index d18cb848..131b168b 100644 --- a/docs/dev/reference/saem.html +++ b/docs/dev/reference/saem.html @@ -432,8 +432,8 @@ using mmkin.

    #> saemix version used for fitting: 3.2 #> mkin version used for pre-fitting: 1.2.2 #> R version used for fitting: 4.2.2 -#> Date of fit: Thu Nov 24 08:11:00 2022 -#> Date of summary: Thu Nov 24 08:11:01 2022 +#> Date of fit: Wed Dec 7 16:22:26 2022 +#> Date of summary: Wed Dec 7 16:22:26 2022 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -448,12 +448,12 @@ using mmkin.

    #> #> Model predictions using solution type analytical #> -#> Fitted in 8.778 s +#> Fitted in 8.508 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Constant variance #> -#> Mean of starting values for individual parameters: +#> Starting values for degradation parameters: #> parent_0 log_k_A1 f_parent_qlogis log_k1 log_k2 #> 93.8102 -5.3734 -0.9711 -1.8799 -4.2708 #> g_qlogis @@ -462,6 +462,19 @@ using mmkin.

    #> Fixed degradation parameter values: #> None #> +#> Starting values for random effects (square root of initial entries in omega): +#> parent_0 log_k_A1 f_parent_qlogis log_k1 log_k2 g_qlogis +#> parent_0 4.941 0.000 0.0000 0.000 0.000 0.0000 +#> log_k_A1 0.000 2.551 0.0000 0.000 0.000 0.0000 +#> f_parent_qlogis 0.000 0.000 0.7251 0.000 0.000 0.0000 +#> log_k1 0.000 0.000 0.0000 1.449 0.000 0.0000 +#> log_k2 0.000 0.000 0.0000 0.000 2.228 0.0000 +#> g_qlogis 0.000 0.000 0.0000 0.000 0.000 0.7814 +#> +#> Starting values for error model parameters: +#> a.1 +#> 1 +#> #> Results: #> #> Likelihood computed by importance sampling diff --git a/docs/dev/reference/summary.saem.mmkin.html b/docs/dev/reference/summary.saem.mmkin.html index a4150959..3b5869f1 100644 --- a/docs/dev/reference/summary.saem.mmkin.html +++ b/docs/dev/reference/summary.saem.mmkin.html @@ -102,7 +102,7 @@ endpoints such as formation fractions and DT50 values. Optionally
    # S3 method for saem.mmkin
    -summary(object, data = FALSE, verbose = FALSE, distimes = TRUE, ...)
    +summary(object, data = FALSE, verbose = FALSE, distimes = TRUE, ...)
     
     # S3 method for summary.saem.mmkin
     print(x, digits = max(3, getOption("digits") - 3), verbose = x$verbose, ...)
    @@ -266,36 +266,38 @@ saemix authors for the parts inherited from saemix.

    #> SD.g_qlogis 0.37478 0.04490 0.70467 illparms(f_saem_dfop_sfo) #> [1] "sd(parent_0)" "sd(log_k_m1)" -f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, covariance.model = diag(c(0, 0, 1, 1, 1, 0))) +f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, + no_random_effect = c("parent_0", "log_k_m1")) illparms(f_saem_dfop_sfo_2) intervals(f_saem_dfop_sfo_2) #> Approximate 95% confidence intervals #> #> Fixed effects: #> lower est. upper -#> parent_0 97.57609542 100.73343868 103.89078195 -#> k_m1 0.01549292 0.01714893 0.01898194 -#> f_parent_to_m1 0.20720315 0.28358738 0.37481744 -#> k1 0.06149334 0.08733164 0.12402670 -#> k2 0.01448390 0.01699942 0.01995184 -#> g 0.45084762 0.51075839 0.57036168 +#> parent_0 98.36731429 101.42508066 104.48284703 +#> k_m1 0.01513234 0.01670094 0.01843214 +#> f_parent_to_m1 0.20221431 0.27608850 0.36461630 +#> k1 0.06915073 0.09759718 0.13774560 +#> k2 0.01487068 0.01740389 0.02036863 +#> g 0.37365671 0.48384821 0.59563299 #> #> Random effects: #> lower est. upper -#> sd(f_parent_qlogis) 0.16606767 0.4479731 0.7298784 -#> sd(log_k1) 0.12284609 0.3588446 0.5948430 -#> sd(log_k2) 0.05379723 0.1548780 0.2559588 +#> sd(f_parent_qlogis) 0.16439770 0.4427585 0.7211193 +#> sd(log_k1) 0.08304243 0.3345213 0.5860002 +#> sd(log_k2) 0.03146410 0.1490210 0.2665779 +#> sd(g_qlogis) 0.06216385 0.4023430 0.7425221 #> #> -#> lower est. upper -#> a.1 0.6811490 0.88503409 1.08891921 -#> b.1 0.0676515 0.08336272 0.09907394 -summary(f_saem_dfop_sfo_2, data = TRUE) +#> lower est. upper +#> a.1 0.67696663 0.87777355 1.07858048 +#> b.1 0.06363957 0.07878001 0.09392044 +summary(f_saem_dfop_sfo_2, data = TRUE) #> saemix version used for fitting: 3.2 #> mkin version used for pre-fitting: 1.2.2 #> R version used for fitting: 4.2.2 -#> Date of fit: Thu Nov 24 08:11:52 2022 -#> Date of summary: Thu Nov 24 08:11:52 2022 +#> Date of fit: Thu Dec 15 14:47:14 2022 +#> Date of summary: Thu Dec 15 14:47:14 2022 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -310,12 +312,12 @@ saemix authors for the parts inherited from saemix.

    #> #> Model predictions using solution type analytical #> -#> Fitted in 26.242 s +#> Fitted in 9.623 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Two-component variance function #> -#> Mean of starting values for individual parameters: +#> Starting values for degradation parameters: #> parent_0 log_k_m1 f_parent_qlogis log_k1 log_k2 #> 101.65645 -4.05368 -0.94311 -2.35943 -4.07006 #> g_qlogis @@ -324,237 +326,291 @@ saemix authors for the parts inherited from saemix.

    #> Fixed degradation parameter values: #> None #> +#> Starting values for random effects (square root of initial entries in omega): +#> parent_0 log_k_m1 f_parent_qlogis log_k1 log_k2 g_qlogis +#> parent_0 6.742 0.0000 0.0000 0.0000 0.0000 0.000 +#> log_k_m1 0.000 0.2236 0.0000 0.0000 0.0000 0.000 +#> f_parent_qlogis 0.000 0.0000 0.5572 0.0000 0.0000 0.000 +#> log_k1 0.000 0.0000 0.0000 0.8031 0.0000 0.000 +#> log_k2 0.000 0.0000 0.0000 0.0000 0.2931 0.000 +#> g_qlogis 0.000 0.0000 0.0000 0.0000 0.0000 0.807 +#> +#> Starting values for error model parameters: +#> a.1 b.1 +#> 1 1 +#> #> Results: #> #> Likelihood computed by importance sampling -#> AIC BIC logLik -#> 809.5 805.2 -393.7 +#> AIC BIC logLik +#> 807 802.3 -391.5 #> #> Optimised parameters: #> est. lower upper -#> parent_0 100.73344 97.57610 103.89078 -#> log_k_m1 -4.06582 -4.16737 -3.96427 -#> f_parent_qlogis -0.92674 -1.34187 -0.51160 -#> log_k1 -2.43804 -2.78883 -2.08726 -#> log_k2 -4.07458 -4.23472 -3.91443 -#> g_qlogis 0.04304 -0.19725 0.28333 -#> a.1 0.88503 0.68115 1.08892 -#> b.1 0.08336 0.06765 0.09907 -#> SD.f_parent_qlogis 0.44797 0.16607 0.72988 -#> SD.log_k1 0.35884 0.12285 0.59484 -#> SD.log_k2 0.15488 0.05380 0.25596 +#> parent_0 101.42508 98.36731 104.48285 +#> log_k_m1 -4.09229 -4.19092 -3.99366 +#> f_parent_qlogis -0.96395 -1.37251 -0.55538 +#> log_k1 -2.32691 -2.67147 -1.98235 +#> log_k2 -4.05106 -4.20836 -3.89376 +#> g_qlogis -0.06463 -0.51656 0.38730 +#> a.1 0.87777 0.67697 1.07858 +#> b.1 0.07878 0.06364 0.09392 +#> SD.f_parent_qlogis 0.44276 0.16440 0.72112 +#> SD.log_k1 0.33452 0.08304 0.58600 +#> SD.log_k2 0.14902 0.03146 0.26658 +#> SD.g_qlogis 0.40234 0.06216 0.74252 #> #> Correlation: #> parnt_0 lg_k_m1 f_prnt_ log_k1 log_k2 -#> log_k_m1 -0.4698 -#> f_parent_qlogis -0.2461 0.2709 -#> log_k1 0.1572 -0.1517 -0.0648 -#> log_k2 -0.0023 0.0835 0.0125 0.1420 -#> g_qlogis 0.2314 -0.2337 -0.0755 -0.2762 -0.4797 +#> log_k_m1 -0.4693 +#> f_parent_qlogis -0.2378 0.2595 +#> log_k1 0.1720 -0.1593 -0.0669 +#> log_k2 0.0179 0.0594 0.0035 0.1995 +#> g_qlogis 0.1073 -0.1060 -0.0322 -0.2299 -0.3168 #> #> Random effects: -#> est. lower upper -#> SD.f_parent_qlogis 0.4480 0.1661 0.7299 -#> SD.log_k1 0.3588 0.1228 0.5948 -#> SD.log_k2 0.1549 0.0538 0.2560 +#> est. lower upper +#> SD.f_parent_qlogis 0.4428 0.16440 0.7211 +#> SD.log_k1 0.3345 0.08304 0.5860 +#> SD.log_k2 0.1490 0.03146 0.2666 +#> SD.g_qlogis 0.4023 0.06216 0.7425 #> #> Variance model: #> est. lower upper -#> a.1 0.88503 0.68115 1.08892 -#> b.1 0.08336 0.06765 0.09907 +#> a.1 0.87777 0.67697 1.07858 +#> b.1 0.07878 0.06364 0.09392 #> #> Backtransformed parameters: -#> est. lower upper -#> parent_0 100.73344 97.57610 103.89078 -#> k_m1 0.01715 0.01549 0.01898 -#> f_parent_to_m1 0.28359 0.20720 0.37482 -#> k1 0.08733 0.06149 0.12403 -#> k2 0.01700 0.01448 0.01995 -#> g 0.51076 0.45085 0.57036 +#> est. lower upper +#> parent_0 101.4251 98.36731 104.48285 +#> k_m1 0.0167 0.01513 0.01843 +#> f_parent_to_m1 0.2761 0.20221 0.36462 +#> k1 0.0976 0.06915 0.13775 +#> k2 0.0174 0.01487 0.02037 +#> g 0.4838 0.37366 0.59563 #> #> Resulting formation fractions: #> ff -#> parent_m1 0.2836 -#> parent_sink 0.7164 +#> parent_m1 0.2761 +#> parent_sink 0.7239 #> #> Estimated disappearance times: #> DT50 DT90 DT50back DT50_k1 DT50_k2 -#> parent 15.94 93.48 28.14 7.937 40.77 -#> m1 40.42 134.27 NA NA NA +#> parent 15.54 94.33 28.4 7.102 39.83 +#> m1 41.50 137.87 NA NA NA #> #> Data: -#> ds name time observed predicted residual std standardized -#> ds 1 parent 0 89.8 1.007e+02 -10.93344 8.4439 -1.29483 -#> ds 1 parent 0 104.1 1.007e+02 3.36656 8.4439 0.39870 -#> ds 1 parent 1 88.7 9.591e+01 -7.20789 8.0440 -0.89606 -#> ds 1 parent 1 95.5 9.591e+01 -0.40789 8.0440 -0.05071 -#> ds 1 parent 3 81.8 8.712e+01 -5.31561 7.3159 -0.72658 -#> ds 1 parent 3 94.5 8.712e+01 7.38439 7.3159 1.00936 -#> ds 1 parent 7 71.5 7.246e+01 -0.95675 6.1047 -0.15672 -#> ds 1 parent 7 70.3 7.246e+01 -2.15675 6.1047 -0.35329 -#> ds 1 parent 14 54.2 5.382e+01 0.38143 4.5729 0.08341 -#> ds 1 parent 14 49.6 5.382e+01 -4.21857 4.5729 -0.92251 -#> ds 1 parent 28 31.5 3.230e+01 -0.80120 2.8344 -0.28267 -#> ds 1 parent 28 28.8 3.230e+01 -3.50120 2.8344 -1.23524 -#> ds 1 parent 60 12.1 1.307e+01 -0.97165 1.4038 -0.69215 -#> ds 1 parent 60 13.6 1.307e+01 0.52835 1.4038 0.37637 -#> ds 1 parent 90 6.2 6.353e+00 -0.15285 1.0314 -0.14820 -#> ds 1 parent 90 8.3 6.353e+00 1.94715 1.0314 1.88790 -#> ds 1 parent 120 2.2 3.175e+00 -0.97462 0.9238 -1.05506 -#> ds 1 parent 120 2.4 3.175e+00 -0.77462 0.9238 -0.83855 -#> ds 1 m1 1 0.3 1.183e+00 -0.88350 0.8905 -0.99212 -#> ds 1 m1 1 0.2 1.183e+00 -0.98350 0.8905 -1.10441 -#> ds 1 m1 3 2.2 3.281e+00 -1.08106 0.9263 -1.16703 -#> ds 1 m1 3 3.0 3.281e+00 -0.28106 0.9263 -0.30341 -#> ds 1 m1 7 6.5 6.564e+00 -0.06353 1.0405 -0.06106 -#> ds 1 m1 7 5.0 6.564e+00 -1.56353 1.0405 -1.50266 -#> ds 1 m1 14 10.2 1.015e+01 0.05147 1.2243 0.04204 -#> ds 1 m1 14 9.5 1.015e+01 -0.64853 1.2243 -0.52970 -#> ds 1 m1 28 12.2 1.265e+01 -0.44824 1.3766 -0.32561 -#> ds 1 m1 28 13.4 1.265e+01 0.75176 1.3766 0.54610 -#> ds 1 m1 60 11.8 1.078e+01 1.02355 1.2611 0.81165 -#> ds 1 m1 60 13.2 1.078e+01 2.42355 1.2611 1.92181 -#> ds 1 m1 90 6.6 7.698e+00 -1.09840 1.0932 -1.00474 -#> ds 1 m1 90 9.3 7.698e+00 1.60160 1.0932 1.46502 -#> ds 1 m1 120 3.5 5.199e+00 -1.69853 0.9854 -1.72363 -#> ds 1 m1 120 5.4 5.199e+00 0.20147 0.9854 0.20445 -#> ds 2 parent 0 118.0 1.007e+02 17.26656 8.4439 2.04485 -#> ds 2 parent 0 99.8 1.007e+02 -0.93344 8.4439 -0.11055 -#> ds 2 parent 1 90.2 9.584e+01 -5.63852 8.0382 -0.70146 -#> ds 2 parent 1 94.6 9.584e+01 -1.23852 8.0382 -0.15408 -#> ds 2 parent 3 96.1 8.706e+01 9.04068 7.3113 1.23654 -#> ds 2 parent 3 78.4 8.706e+01 -8.65932 7.3113 -1.18438 -#> ds 2 parent 7 77.9 7.286e+01 5.04438 6.1376 0.82188 -#> ds 2 parent 7 77.7 7.286e+01 4.84438 6.1376 0.78930 -#> ds 2 parent 14 56.0 5.567e+01 0.33336 4.7242 0.07057 -#> ds 2 parent 14 54.7 5.567e+01 -0.96664 4.7242 -0.20462 -#> ds 2 parent 28 36.6 3.705e+01 -0.44800 3.2127 -0.13944 -#> ds 2 parent 28 36.8 3.705e+01 -0.24800 3.2127 -0.07719 -#> ds 2 parent 60 22.1 2.008e+01 2.01984 1.8935 1.06672 -#> ds 2 parent 60 24.7 2.008e+01 4.61984 1.8935 2.43984 -#> ds 2 parent 90 12.4 1.253e+01 -0.12814 1.3689 -0.09360 -#> ds 2 parent 90 10.8 1.253e+01 -1.72814 1.3689 -1.26238 -#> ds 2 parent 120 6.8 7.916e+00 -1.11595 1.1040 -1.01085 -#> ds 2 parent 120 7.9 7.916e+00 -0.01595 1.1040 -0.01445 -#> ds 2 m1 1 1.3 1.317e+00 -0.01669 0.8918 -0.01871 -#> ds 2 m1 3 3.7 3.613e+00 0.08699 0.9349 0.09305 -#> ds 2 m1 3 4.7 3.613e+00 1.08699 0.9349 1.16270 -#> ds 2 m1 7 8.1 7.092e+00 1.00781 1.0643 0.94688 -#> ds 2 m1 7 7.9 7.092e+00 0.80781 1.0643 0.75897 -#> ds 2 m1 14 10.1 1.066e+01 -0.56458 1.2545 -0.45006 -#> ds 2 m1 14 10.3 1.066e+01 -0.36458 1.2545 -0.29063 -#> ds 2 m1 28 10.7 1.281e+01 -2.11106 1.3870 -1.52201 -#> ds 2 m1 28 12.2 1.281e+01 -0.61106 1.3870 -0.44055 -#> ds 2 m1 60 10.7 1.078e+01 -0.08464 1.2616 -0.06709 -#> ds 2 m1 60 12.5 1.078e+01 1.71536 1.2616 1.35970 -#> ds 2 m1 90 9.1 8.013e+00 1.08684 1.1088 0.98016 -#> ds 2 m1 90 7.4 8.013e+00 -0.61316 1.1088 -0.55298 -#> ds 2 m1 120 6.1 5.749e+00 0.35063 1.0065 0.34838 -#> ds 2 m1 120 4.5 5.749e+00 -1.24937 1.0065 -1.24133 -#> ds 3 parent 0 106.2 1.007e+02 5.46656 8.4439 0.64740 -#> ds 3 parent 0 106.9 1.007e+02 6.16656 8.4439 0.73030 -#> ds 3 parent 1 107.4 9.369e+01 13.70530 7.8606 1.74354 -#> ds 3 parent 1 96.1 9.369e+01 2.40530 7.8606 0.30599 -#> ds 3 parent 3 79.4 8.185e+01 -2.45363 6.8807 -0.35660 -#> ds 3 parent 3 82.6 8.185e+01 0.74637 6.8807 0.10847 -#> ds 3 parent 7 63.9 6.487e+01 -0.97153 5.4798 -0.17729 -#> ds 3 parent 7 62.4 6.487e+01 -2.47153 5.4798 -0.45103 -#> ds 3 parent 14 51.0 4.791e+01 3.09024 4.0908 0.75542 -#> ds 3 parent 14 47.1 4.791e+01 -0.80976 4.0908 -0.19795 -#> ds 3 parent 28 36.1 3.313e+01 2.97112 2.9001 1.02450 -#> ds 3 parent 28 36.6 3.313e+01 3.47112 2.9001 1.19691 -#> ds 3 parent 60 20.1 1.927e+01 0.83265 1.8339 0.45404 -#> ds 3 parent 60 19.8 1.927e+01 0.53265 1.8339 0.29045 -#> ds 3 parent 90 11.3 1.203e+01 -0.72783 1.3374 -0.54421 -#> ds 3 parent 90 10.7 1.203e+01 -1.32783 1.3374 -0.99284 -#> ds 3 parent 120 8.2 7.516e+00 0.68382 1.0844 0.63061 -#> ds 3 parent 120 7.3 7.516e+00 -0.21618 1.0844 -0.19936 -#> ds 3 m1 0 0.8 -9.948e-14 0.80000 0.8850 0.90392 -#> ds 3 m1 1 1.8 1.682e+00 0.11759 0.8961 0.13123 -#> ds 3 m1 1 2.3 1.682e+00 0.61759 0.8961 0.68921 -#> ds 3 m1 3 4.2 4.431e+00 -0.23052 0.9590 -0.24037 -#> ds 3 m1 3 4.1 4.431e+00 -0.33052 0.9590 -0.34465 -#> ds 3 m1 7 6.8 8.084e+00 -1.28422 1.1124 -1.15445 -#> ds 3 m1 7 10.1 8.084e+00 2.01578 1.1124 1.81208 -#> ds 3 m1 14 11.4 1.100e+01 0.40274 1.2743 0.31606 -#> ds 3 m1 14 12.8 1.100e+01 1.80274 1.2743 1.41474 -#> ds 3 m1 28 11.5 1.176e+01 -0.25977 1.3207 -0.19669 -#> ds 3 m1 28 10.6 1.176e+01 -1.15977 1.3207 -0.87813 -#> ds 3 m1 60 7.5 9.277e+00 -1.77696 1.1753 -1.51190 -#> ds 3 m1 60 8.6 9.277e+00 -0.67696 1.1753 -0.57598 -#> ds 3 m1 90 7.3 6.883e+00 0.41708 1.0548 0.39542 -#> ds 3 m1 90 8.1 6.883e+00 1.21708 1.0548 1.15389 -#> ds 3 m1 120 5.3 4.948e+00 0.35179 0.9764 0.36028 -#> ds 3 m1 120 3.8 4.948e+00 -1.14821 0.9764 -1.17591 -#> ds 4 parent 0 104.7 1.007e+02 3.96656 8.4439 0.46975 -#> ds 4 parent 0 88.3 1.007e+02 -12.43344 8.4439 -1.47247 -#> ds 4 parent 1 94.2 9.738e+01 -3.18358 8.1663 -0.38985 -#> ds 4 parent 1 94.6 9.738e+01 -2.78358 8.1663 -0.34086 -#> ds 4 parent 3 78.1 9.110e+01 -12.99595 7.6454 -1.69984 -#> ds 4 parent 3 96.5 9.110e+01 5.40405 7.6454 0.70684 -#> ds 4 parent 7 76.2 8.000e+01 -3.79797 6.7273 -0.56456 -#> ds 4 parent 7 77.8 8.000e+01 -2.19797 6.7273 -0.32672 -#> ds 4 parent 14 70.8 6.446e+01 6.34396 5.4456 1.16496 -#> ds 4 parent 14 67.3 6.446e+01 2.84396 5.4456 0.52225 -#> ds 4 parent 28 43.1 4.359e+01 -0.48960 3.7400 -0.13091 -#> ds 4 parent 28 45.1 4.359e+01 1.51040 3.7400 0.40385 -#> ds 4 parent 60 21.3 2.095e+01 0.35282 1.9577 0.18022 -#> ds 4 parent 60 23.5 2.095e+01 2.55282 1.9577 1.30400 -#> ds 4 parent 90 11.8 1.188e+01 -0.07874 1.3281 -0.05929 -#> ds 4 parent 90 12.1 1.188e+01 0.22126 1.3281 0.16660 -#> ds 4 parent 120 7.0 7.072e+00 -0.07245 1.0634 -0.06813 -#> ds 4 parent 120 6.2 7.072e+00 -0.87245 1.0634 -0.82041 -#> ds 4 m1 0 1.6 5.684e-14 1.60000 0.8850 1.80784 -#> ds 4 m1 1 0.9 6.960e-01 0.20399 0.8869 0.23000 -#> ds 4 m1 3 3.7 1.968e+00 1.73240 0.9001 1.92466 -#> ds 4 m1 3 2.0 1.968e+00 0.03240 0.9001 0.03599 -#> ds 4 m1 7 3.6 4.083e+00 -0.48287 0.9482 -0.50924 -#> ds 4 m1 7 3.8 4.083e+00 -0.28287 0.9482 -0.29832 -#> ds 4 m1 14 7.1 6.682e+00 0.41836 1.0457 0.40007 -#> ds 4 m1 14 6.6 6.682e+00 -0.08164 1.0457 -0.07807 -#> ds 4 m1 28 9.5 9.103e+00 0.39733 1.1658 0.34082 -#> ds 4 m1 28 9.3 9.103e+00 0.19733 1.1658 0.16926 -#> ds 4 m1 60 8.3 8.750e+00 -0.44979 1.1469 -0.39218 -#> ds 4 m1 60 9.0 8.750e+00 0.25021 1.1469 0.21817 -#> ds 4 m1 90 6.6 6.673e+00 -0.07285 1.0453 -0.06969 -#> ds 4 m1 90 7.7 6.673e+00 1.02715 1.0453 0.98261 -#> ds 4 m1 120 3.7 4.757e+00 -1.05747 0.9698 -1.09036 -#> ds 4 m1 120 3.5 4.757e+00 -1.25747 0.9698 -1.29658 -#> ds 5 parent 0 110.4 1.007e+02 9.66656 8.4439 1.14480 -#> ds 5 parent 0 112.1 1.007e+02 11.36656 8.4439 1.34612 -#> ds 5 parent 1 93.5 9.395e+01 -0.45394 7.8821 -0.05759 -#> ds 5 parent 1 91.0 9.395e+01 -2.95394 7.8821 -0.37477 -#> ds 5 parent 3 71.0 8.245e+01 -11.44783 6.9298 -1.65197 -#> ds 5 parent 3 89.7 8.245e+01 7.25217 6.9298 1.04652 -#> ds 5 parent 7 60.4 6.567e+01 -5.27002 5.5455 -0.95032 -#> ds 5 parent 7 59.1 6.567e+01 -6.57002 5.5455 -1.18475 -#> ds 5 parent 14 56.5 4.847e+01 8.03029 4.1364 1.94139 -#> ds 5 parent 14 47.0 4.847e+01 -1.46971 4.1364 -0.35532 -#> ds 5 parent 28 30.2 3.309e+01 -2.89206 2.8971 -0.99825 -#> ds 5 parent 28 23.9 3.309e+01 -9.19206 2.8971 -3.17281 -#> ds 5 parent 60 17.0 1.891e+01 -1.90623 1.8076 -1.05458 -#> ds 5 parent 60 18.7 1.891e+01 -0.20623 1.8076 -0.11409 -#> ds 5 parent 90 11.3 1.168e+01 -0.38263 1.3160 -0.29076 -#> ds 5 parent 90 11.9 1.168e+01 0.21737 1.3160 0.16518 -#> ds 5 parent 120 9.0 7.230e+00 1.77031 1.0708 1.65333 -#> ds 5 parent 120 8.1 7.230e+00 0.87031 1.0708 0.81280 -#> ds 5 m1 0 0.7 -5.116e-13 0.70000 0.8850 0.79093 -#> ds 5 m1 1 3.0 3.244e+00 -0.24430 0.9254 -0.26398 -#> ds 5 m1 1 2.6 3.244e+00 -0.64430 0.9254 -0.69621 -#> ds 5 m1 3 5.1 8.592e+00 -3.49175 1.1385 -3.06686 -#> ds 5 m1 3 7.5 8.592e+00 -1.09175 1.1385 -0.95890 -#> ds 5 m1 7 16.5 1.583e+01 0.66887 1.5890 0.42093 -#> ds 5 m1 7 19.0 1.583e+01 3.16887 1.5890 1.99424 -#> ds 5 m1 14 22.9 2.181e+01 1.08658 2.0224 0.53728 -#> ds 5 m1 14 23.2 2.181e+01 1.38658 2.0224 0.68562 -#> ds 5 m1 28 22.2 2.364e+01 -1.43659 2.1600 -0.66508 -#> ds 5 m1 28 24.4 2.364e+01 0.76341 2.1600 0.35342 -#> ds 5 m1 60 15.5 1.873e+01 -3.23377 1.7950 -1.80150 -#> ds 5 m1 60 19.8 1.873e+01 1.06623 1.7950 0.59398 -#> ds 5 m1 90 14.9 1.387e+01 1.03117 1.4560 0.70822 -#> ds 5 m1 90 14.2 1.387e+01 0.33117 1.4560 0.22745 -#> ds 5 m1 120 10.9 9.937e+00 0.96270 1.2122 0.79415 -#> ds 5 m1 120 10.4 9.937e+00 0.46270 1.2122 0.38169 +#> ds name time observed predicted residual std standardized +#> ds 1 parent 0 89.8 1.014e+02 -11.62508 8.0383 -1.44620 +#> ds 1 parent 0 104.1 1.014e+02 2.67492 8.0383 0.33277 +#> ds 1 parent 1 88.7 9.650e+01 -7.80311 7.6530 -1.01961 +#> ds 1 parent 1 95.5 9.650e+01 -1.00311 7.6530 -0.13107 +#> ds 1 parent 3 81.8 8.753e+01 -5.72638 6.9510 -0.82382 +#> ds 1 parent 3 94.5 8.753e+01 6.97362 6.9510 1.00326 +#> ds 1 parent 7 71.5 7.254e+01 -1.04133 5.7818 -0.18010 +#> ds 1 parent 7 70.3 7.254e+01 -2.24133 5.7818 -0.38765 +#> ds 1 parent 14 54.2 5.349e+01 0.71029 4.3044 0.16502 +#> ds 1 parent 14 49.6 5.349e+01 -3.88971 4.3044 -0.90366 +#> ds 1 parent 28 31.5 3.167e+01 -0.16616 2.6446 -0.06283 +#> ds 1 parent 28 28.8 3.167e+01 -2.86616 2.6446 -1.08379 +#> ds 1 parent 60 12.1 1.279e+01 -0.69287 1.3365 -0.51843 +#> ds 1 parent 60 13.6 1.279e+01 0.80713 1.3365 0.60392 +#> ds 1 parent 90 6.2 6.397e+00 -0.19718 1.0122 -0.19481 +#> ds 1 parent 90 8.3 6.397e+00 1.90282 1.0122 1.87996 +#> ds 1 parent 120 2.2 3.323e+00 -1.12320 0.9160 -1.22623 +#> ds 1 parent 120 2.4 3.323e+00 -0.92320 0.9160 -1.00788 +#> ds 1 m1 1 0.3 1.179e+00 -0.87919 0.8827 -0.99605 +#> ds 1 m1 1 0.2 1.179e+00 -0.97919 0.8827 -1.10935 +#> ds 1 m1 3 2.2 3.273e+00 -1.07272 0.9149 -1.17256 +#> ds 1 m1 3 3.0 3.273e+00 -0.27272 0.9149 -0.29811 +#> ds 1 m1 7 6.5 6.559e+00 -0.05872 1.0186 -0.05765 +#> ds 1 m1 7 5.0 6.559e+00 -1.55872 1.0186 -1.53032 +#> ds 1 m1 14 10.2 1.016e+01 0.03787 1.1880 0.03188 +#> ds 1 m1 14 9.5 1.016e+01 -0.66213 1.1880 -0.55734 +#> ds 1 m1 28 12.2 1.268e+01 -0.47913 1.3297 -0.36032 +#> ds 1 m1 28 13.4 1.268e+01 0.72087 1.3297 0.54211 +#> ds 1 m1 60 11.8 1.078e+01 1.02493 1.2211 0.83936 +#> ds 1 m1 60 13.2 1.078e+01 2.42493 1.2211 1.98588 +#> ds 1 m1 90 6.6 7.705e+00 -1.10464 1.0672 -1.03509 +#> ds 1 m1 90 9.3 7.705e+00 1.59536 1.0672 1.49491 +#> ds 1 m1 120 3.5 5.236e+00 -1.73617 0.9699 -1.79010 +#> ds 1 m1 120 5.4 5.236e+00 0.16383 0.9699 0.16892 +#> ds 2 parent 0 118.0 1.014e+02 16.57492 8.0383 2.06198 +#> ds 2 parent 0 99.8 1.014e+02 -1.62508 8.0383 -0.20217 +#> ds 2 parent 1 90.2 9.599e+01 -5.79045 7.6129 -0.76061 +#> ds 2 parent 1 94.6 9.599e+01 -1.39045 7.6129 -0.18264 +#> ds 2 parent 3 96.1 8.652e+01 9.57931 6.8724 1.39388 +#> ds 2 parent 3 78.4 8.652e+01 -8.12069 6.8724 -1.18164 +#> ds 2 parent 7 77.9 7.197e+01 5.93429 5.7370 1.03439 +#> ds 2 parent 7 77.7 7.197e+01 5.73429 5.7370 0.99953 +#> ds 2 parent 14 56.0 5.555e+01 0.44657 4.4637 0.10005 +#> ds 2 parent 14 54.7 5.555e+01 -0.85343 4.4637 -0.19120 +#> ds 2 parent 28 36.6 3.853e+01 -1.93170 3.1599 -0.61132 +#> ds 2 parent 28 36.8 3.853e+01 -1.73170 3.1599 -0.54803 +#> ds 2 parent 60 22.1 2.110e+01 1.00360 1.8795 0.53396 +#> ds 2 parent 60 24.7 2.110e+01 3.60360 1.8795 1.91728 +#> ds 2 parent 90 12.4 1.250e+01 -0.09712 1.3190 -0.07363 +#> ds 2 parent 90 10.8 1.250e+01 -1.69712 1.3190 -1.28667 +#> ds 2 parent 120 6.8 7.419e+00 -0.61913 1.0546 -0.58709 +#> ds 2 parent 120 7.9 7.419e+00 0.48087 1.0546 0.45599 +#> ds 2 m1 1 1.3 1.422e+00 -0.12194 0.8849 -0.13781 +#> ds 2 m1 3 3.7 3.831e+00 -0.13149 0.9282 -0.14166 +#> ds 2 m1 3 4.7 3.831e+00 0.86851 0.9282 0.93567 +#> ds 2 m1 7 8.1 7.292e+00 0.80812 1.0490 0.77034 +#> ds 2 m1 7 7.9 7.292e+00 0.60812 1.0490 0.57969 +#> ds 2 m1 14 10.1 1.055e+01 -0.45332 1.2090 -0.37495 +#> ds 2 m1 14 10.3 1.055e+01 -0.25332 1.2090 -0.20953 +#> ds 2 m1 28 10.7 1.230e+01 -1.59960 1.3074 -1.22347 +#> ds 2 m1 28 12.2 1.230e+01 -0.09960 1.3074 -0.07618 +#> ds 2 m1 60 10.7 1.065e+01 0.05342 1.2141 0.04400 +#> ds 2 m1 60 12.5 1.065e+01 1.85342 1.2141 1.52661 +#> ds 2 m1 90 9.1 8.196e+00 0.90368 1.0897 0.82930 +#> ds 2 m1 90 7.4 8.196e+00 -0.79632 1.0897 -0.73078 +#> ds 2 m1 120 6.1 5.997e+00 0.10252 0.9969 0.10284 +#> ds 2 m1 120 4.5 5.997e+00 -1.49748 0.9969 -1.50220 +#> ds 3 parent 0 106.2 1.014e+02 4.77492 8.0383 0.59402 +#> ds 3 parent 0 106.9 1.014e+02 5.47492 8.0383 0.68110 +#> ds 3 parent 1 107.4 9.390e+01 13.49935 7.4494 1.81214 +#> ds 3 parent 1 96.1 9.390e+01 2.19935 7.4494 0.29524 +#> ds 3 parent 3 79.4 8.152e+01 -2.12307 6.4821 -0.32753 +#> ds 3 parent 3 82.6 8.152e+01 1.07693 6.4821 0.16614 +#> ds 3 parent 7 63.9 6.446e+01 -0.55834 5.1533 -0.10834 +#> ds 3 parent 7 62.4 6.446e+01 -2.05834 5.1533 -0.39942 +#> ds 3 parent 14 51.0 4.826e+01 2.74073 3.9019 0.70241 +#> ds 3 parent 14 47.1 4.826e+01 -1.15927 3.9019 -0.29711 +#> ds 3 parent 28 36.1 3.424e+01 1.86399 2.8364 0.65718 +#> ds 3 parent 28 36.6 3.424e+01 2.36399 2.8364 0.83346 +#> ds 3 parent 60 20.1 1.968e+01 0.42172 1.7815 0.23672 +#> ds 3 parent 60 19.8 1.968e+01 0.12172 1.7815 0.06833 +#> ds 3 parent 90 11.3 1.195e+01 -0.64633 1.2869 -0.50222 +#> ds 3 parent 90 10.7 1.195e+01 -1.24633 1.2869 -0.96844 +#> ds 3 parent 120 8.2 7.255e+00 0.94532 1.0474 0.90251 +#> ds 3 parent 120 7.3 7.255e+00 0.04532 1.0474 0.04327 +#> ds 3 m1 0 0.8 2.956e-11 0.80000 0.8778 0.91140 +#> ds 3 m1 1 1.8 1.758e+00 0.04187 0.8886 0.04712 +#> ds 3 m1 1 2.3 1.758e+00 0.54187 0.8886 0.60978 +#> ds 3 m1 3 4.2 4.567e+00 -0.36697 0.9486 -0.38683 +#> ds 3 m1 3 4.1 4.567e+00 -0.46697 0.9486 -0.49224 +#> ds 3 m1 7 6.8 8.151e+00 -1.35124 1.0876 -1.24242 +#> ds 3 m1 7 10.1 8.151e+00 1.94876 1.0876 1.79182 +#> ds 3 m1 14 11.4 1.083e+01 0.57098 1.2240 0.46647 +#> ds 3 m1 14 12.8 1.083e+01 1.97098 1.2240 1.61022 +#> ds 3 m1 28 11.5 1.147e+01 0.03175 1.2597 0.02520 +#> ds 3 m1 28 10.6 1.147e+01 -0.86825 1.2597 -0.68928 +#> ds 3 m1 60 7.5 9.298e+00 -1.79834 1.1433 -1.57298 +#> ds 3 m1 60 8.6 9.298e+00 -0.69834 1.1433 -0.61083 +#> ds 3 m1 90 7.3 7.038e+00 0.26249 1.0382 0.25283 +#> ds 3 m1 90 8.1 7.038e+00 1.06249 1.0382 1.02340 +#> ds 3 m1 120 5.3 5.116e+00 0.18417 0.9659 0.19068 +#> ds 3 m1 120 3.8 5.116e+00 -1.31583 0.9659 -1.36232 +#> ds 4 parent 0 104.7 1.014e+02 3.27492 8.0383 0.40741 +#> ds 4 parent 0 88.3 1.014e+02 -13.12508 8.0383 -1.63281 +#> ds 4 parent 1 94.2 9.781e+01 -3.61183 7.7555 -0.46572 +#> ds 4 parent 1 94.6 9.781e+01 -3.21183 7.7555 -0.41414 +#> ds 4 parent 3 78.1 9.110e+01 -13.00467 7.2307 -1.79853 +#> ds 4 parent 3 96.5 9.110e+01 5.39533 7.2307 0.74617 +#> ds 4 parent 7 76.2 7.951e+01 -3.30511 6.3246 -0.52258 +#> ds 4 parent 7 77.8 7.951e+01 -1.70511 6.3246 -0.26960 +#> ds 4 parent 14 70.8 6.376e+01 7.03783 5.0993 1.38016 +#> ds 4 parent 14 67.3 6.376e+01 3.53783 5.0993 0.69379 +#> ds 4 parent 28 43.1 4.340e+01 -0.30456 3.5303 -0.08627 +#> ds 4 parent 28 45.1 4.340e+01 1.69544 3.5303 0.48026 +#> ds 4 parent 60 21.3 2.142e+01 -0.12077 1.9022 -0.06349 +#> ds 4 parent 60 23.5 2.142e+01 2.07923 1.9022 1.09308 +#> ds 4 parent 90 11.8 1.207e+01 -0.26813 1.2940 -0.20721 +#> ds 4 parent 90 12.1 1.207e+01 0.03187 1.2940 0.02463 +#> ds 4 parent 120 7.0 6.954e+00 0.04554 1.0347 0.04402 +#> ds 4 parent 120 6.2 6.954e+00 -0.75446 1.0347 -0.72914 +#> ds 4 m1 0 1.6 1.990e-13 1.60000 0.8778 1.82279 +#> ds 4 m1 1 0.9 7.305e-01 0.16949 0.8797 0.19267 +#> ds 4 m1 3 3.7 2.051e+00 1.64896 0.8925 1.84753 +#> ds 4 m1 3 2.0 2.051e+00 -0.05104 0.8925 -0.05719 +#> ds 4 m1 7 3.6 4.204e+00 -0.60375 0.9382 -0.64354 +#> ds 4 m1 7 3.8 4.204e+00 -0.40375 0.9382 -0.43036 +#> ds 4 m1 14 7.1 6.760e+00 0.34021 1.0267 0.33137 +#> ds 4 m1 14 6.6 6.760e+00 -0.15979 1.0267 -0.15563 +#> ds 4 m1 28 9.5 9.011e+00 0.48856 1.1289 0.43277 +#> ds 4 m1 28 9.3 9.011e+00 0.28856 1.1289 0.25561 +#> ds 4 m1 60 8.3 8.611e+00 -0.31077 1.1093 -0.28014 +#> ds 4 m1 60 9.0 8.611e+00 0.38923 1.1093 0.35086 +#> ds 4 m1 90 6.6 6.678e+00 -0.07753 1.0233 -0.07576 +#> ds 4 m1 90 7.7 6.678e+00 1.02247 1.0233 0.99915 +#> ds 4 m1 120 3.7 4.847e+00 -1.14679 0.9572 -1.19804 +#> ds 4 m1 120 3.5 4.847e+00 -1.34679 0.9572 -1.40698 +#> ds 5 parent 0 110.4 1.014e+02 8.97492 8.0383 1.11651 +#> ds 5 parent 0 112.1 1.014e+02 10.67492 8.0383 1.32800 +#> ds 5 parent 1 93.5 9.466e+01 -1.16118 7.5089 -0.15464 +#> ds 5 parent 1 91.0 9.466e+01 -3.66118 7.5089 -0.48758 +#> ds 5 parent 3 71.0 8.302e+01 -12.01844 6.5988 -1.82130 +#> ds 5 parent 3 89.7 8.302e+01 6.68156 6.5988 1.01254 +#> ds 5 parent 7 60.4 6.563e+01 -5.22574 5.2440 -0.99652 +#> ds 5 parent 7 59.1 6.563e+01 -6.52574 5.2440 -1.24442 +#> ds 5 parent 14 56.5 4.727e+01 9.22621 3.8263 2.41128 +#> ds 5 parent 14 47.0 4.727e+01 -0.27379 3.8263 -0.07156 +#> ds 5 parent 28 30.2 3.103e+01 -0.83405 2.5977 -0.32108 +#> ds 5 parent 28 23.9 3.103e+01 -7.13405 2.5977 -2.74634 +#> ds 5 parent 60 17.0 1.800e+01 -0.99696 1.6675 -0.59787 +#> ds 5 parent 60 18.7 1.800e+01 0.70304 1.6675 0.42161 +#> ds 5 parent 90 11.3 1.167e+01 -0.36809 1.2710 -0.28961 +#> ds 5 parent 90 11.9 1.167e+01 0.23191 1.2710 0.18246 +#> ds 5 parent 120 9.0 7.595e+00 1.40496 1.0623 1.32256 +#> ds 5 parent 120 8.1 7.595e+00 0.50496 1.0623 0.47535 +#> ds 5 m1 0 0.7 0.000e+00 0.70000 0.8778 0.79747 +#> ds 5 m1 1 3.0 3.158e+00 -0.15799 0.9123 -0.17317 +#> ds 5 m1 1 2.6 3.158e+00 -0.55799 0.9123 -0.61160 +#> ds 5 m1 3 5.1 8.443e+00 -3.34286 1.1013 -3.03535 +#> ds 5 m1 3 7.5 8.443e+00 -0.94286 1.1013 -0.85613 +#> ds 5 m1 7 16.5 1.580e+01 0.69781 1.5232 0.45811 +#> ds 5 m1 7 19.0 1.580e+01 3.19781 1.5232 2.09935 +#> ds 5 m1 14 22.9 2.216e+01 0.73604 1.9543 0.37663 +#> ds 5 m1 14 23.2 2.216e+01 1.03604 1.9543 0.53014 +#> ds 5 m1 28 22.2 2.423e+01 -2.03128 2.1011 -0.96678 +#> ds 5 m1 28 24.4 2.423e+01 0.16872 2.1011 0.08030 +#> ds 5 m1 60 15.5 1.876e+01 -3.25610 1.7187 -1.89455 +#> ds 5 m1 60 19.8 1.876e+01 1.04390 1.7187 0.60739 +#> ds 5 m1 90 14.9 1.366e+01 1.23585 1.3890 0.88976 +#> ds 5 m1 90 14.2 1.366e+01 0.53585 1.3890 0.38579 +#> ds 5 m1 120 10.9 9.761e+00 1.13911 1.1670 0.97613 +#> ds 5 m1 120 10.4 9.761e+00 0.63911 1.1670 0.54767 +# Add a correlation between random effects of g and k2 +cov_model_3 <- f_saem_dfop_sfo_2$so@model@covariance.model +cov_model_3["log_k2", "g_qlogis"] <- 1 +cov_model_3["g_qlogis", "log_k2"] <- 1 +f_saem_dfop_sfo_3 <- update(f_saem_dfop_sfo, + covariance.model = cov_model_3) +intervals(f_saem_dfop_sfo_3) +#> Approximate 95% confidence intervals +#> +#> Fixed effects: +#> lower est. upper +#> parent_0 98.39888363 101.48951337 104.58014311 +#> k_m1 0.01508704 0.01665986 0.01839665 +#> f_parent_to_m1 0.20141557 0.27540583 0.36418131 +#> k1 0.07708759 0.10430866 0.14114200 +#> k2 0.01476621 0.01786384 0.02161129 +#> g 0.33679867 0.45083525 0.57028162 +#> +#> Random effects: +#> lower est. upper +#> sd(f_parent_qlogis) 0.38085375 0.4441841 0.5075145 +#> sd(log_k1) 0.04774819 0.2660384 0.4843286 +#> sd(log_k2) -0.63842736 0.1977024 1.0338321 +#> sd(g_qlogis) 0.22711289 0.4502227 0.6733326 +#> corr(log_k2,g_qlogis) -0.83271473 -0.6176939 -0.4026730 +#> +#> +#> lower est. upper +#> a.1 0.67347568 0.87437392 1.07527216 +#> b.1 0.06393032 0.07912417 0.09431802 +# The correlation does not improve the fit judged by AIC and BIC, although +# the likelihood is higher with the additional parameter +anova(f_saem_dfop_sfo, f_saem_dfop_sfo_2, f_saem_dfop_sfo_3) +#> Data: 171 observations of 2 variable(s) grouped in 5 datasets +#> +#> npar AIC BIC Lik +#> f_saem_dfop_sfo_2 12 806.96 802.27 -391.48 +#> f_saem_dfop_sfo_3 13 807.99 802.91 -391.00 +#> f_saem_dfop_sfo 14 810.83 805.36 -391.42 # }
    diff --git a/log/test.log b/log/test.log index 89265100..dc1b6c74 100644 --- a/log/test.log +++ b/log/test.log @@ -1,11 +1,11 @@ ℹ Testing mkin ✔ | F W S OK | Context ✔ | 5 | AIC calculation -✔ | 5 | Analytical solutions for coupled models [1.5s] +✔ | 5 | Analytical solutions for coupled models [1.6s] ✔ | 5 | Calculation of Akaike weights ✔ | 3 | Export dataset for reading into CAKE ✔ | 12 | Confidence intervals and p-values [0.4s] -✔ | 1 12 | Dimethenamid data from 2018 [12.3s] +✔ | 1 12 | Dimethenamid data from 2018 [12.4s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data Reason: Fitting this ODE model with saemix takes about 15 minutes on my system @@ -16,23 +16,23 @@ Reason: Fitting this ODE model with saemix takes about 15 minutes on my system ✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.4s] ✔ | 4 | Test fitting the decline of metabolites from their maximum [0.2s] ✔ | 1 | Fitting the logistic model [0.1s] -✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [18.2s] -✔ | 1 11 | Nonlinear mixed-effects models [5.8s] +✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [19.1s] +✔ | 1 11 | Nonlinear mixed-effects models [5.9s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_mixed.R:78'): saemix results are reproducible for biphasic fits Reason: Fitting with saemix takes around 10 minutes when using deSolve ──────────────────────────────────────────────────────────────────────────────── ✔ | 3 | Test dataset classes mkinds and mkindsg ✔ | 10 | Special cases of mkinfit calls [0.4s] -✔ | 3 | mkinfit features [0.4s] +✔ | 3 | mkinfit features [0.5s] ✔ | 8 | mkinmod model generation and printing ✔ | 3 | Model predictions with mkinpredict [0.1s] -✔ | 12 | Multistart method for saem.mmkin models [20.6s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.4s] +✔ | 12 | Multistart method for saem.mmkin models [21.6s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.5s] ✔ | 9 | Nonlinear mixed-effects models with nlme [3.7s] -✔ | 15 | Plotting [4.7s] +✔ | 15 | Plotting [4.6s] ✔ | 4 | Residuals extracted from mkinfit models -✔ | 1 36 | saemix parent models [30.6s] +✔ | 1 36 | saemix parent models [30.9s] ──────────────────────────────────────────────────────────────────────────────── Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem Reason: This still takes almost 2.5 minutes although we do not solve ODEs @@ -47,7 +47,7 @@ Reason: This still takes almost 2.5 minutes although we do not solve ODEs ✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [0.7s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 111.2 s +Duration: 113.6 s ── Skipped tests ────────────────────────────────────────────────────────────── • Fitting this ODE model with saemix takes about 15 minutes on my system (1) diff --git a/man/summary.saem.mmkin.Rd b/man/summary.saem.mmkin.Rd index fb099899..0845d4d2 100644 --- a/man/summary.saem.mmkin.Rd +++ b/man/summary.saem.mmkin.Rd @@ -92,10 +92,21 @@ f_mmkin_dfop_sfo <- mmkin(list(dfop_sfo), ds_syn_dfop_sfo, f_saem_dfop_sfo <- saem(f_mmkin_dfop_sfo) print(f_saem_dfop_sfo) illparms(f_saem_dfop_sfo) -f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, covariance.model = diag(c(0, 0, 1, 1, 1, 0))) +f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, + no_random_effect = c("parent_0", "log_k_m1")) illparms(f_saem_dfop_sfo_2) intervals(f_saem_dfop_sfo_2) summary(f_saem_dfop_sfo_2, data = TRUE) +# Add a correlation between random effects of g and k2 +cov_model_3 <- f_saem_dfop_sfo_2$so@model@covariance.model +cov_model_3["log_k2", "g_qlogis"] <- 1 +cov_model_3["g_qlogis", "log_k2"] <- 1 +f_saem_dfop_sfo_3 <- update(f_saem_dfop_sfo, + covariance.model = cov_model_3) +intervals(f_saem_dfop_sfo_3) +# The correlation does not improve the fit judged by AIC and BIC, although +# the likelihood is higher with the additional parameter +anova(f_saem_dfop_sfo, f_saem_dfop_sfo_2, f_saem_dfop_sfo_3) } } -- cgit v1.2.1 From 0023df3c31fac29b5f9337ecd732a5dfd4d51a2d Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 19 Dec 2022 06:37:32 +0100 Subject: Template and spreadsheet for hierarchical kinetics The template only shows parent data evaluation without covariate models for now. The spreadsheet will also be useful for unit testing of the read_spreadsheet function. --- .Rbuildignore | 3 + .gitignore | 3 + GNUmakefile | 4 +- .../rmarkdown/templates/hier/skeleton/skeleton.Rmd | 186 +++++++++++++++++++++ inst/rmarkdown/templates/hier/template.yaml | 3 + .../lambda-cyhalothrin_soil_efsa_2014.xlsx | Bin 0 -> 36231 bytes 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd create mode 100644 inst/rmarkdown/templates/hier/template.yaml create mode 100644 inst/testdata/lambda-cyhalothrin_soil_efsa_2014.xlsx diff --git a/.Rbuildignore b/.Rbuildignore index 24632401..0dcec29a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,6 +9,9 @@ ^test.R$ ^mkin_.*\.tar\.gz ^mkin.tar$ +^inst/rmarkdown/templates/hier/skeleton/skeleton.pdf$ +^inst/rmarkdown/templates/hier/skeleton/skeleton_cache +^inst/rmarkdown/templates/hier/skeleton/skeleton_files ^vignettes/.build.timestamp$ ^vignettes/.*_cache$ ^vignettes/.*cache$ diff --git a/.gitignore b/.gitignore index 75005f00..4f479259 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ docs/articles/*_cache/ install.log +inst/rmarkdown/templates/hier/skeleton/skeleton_cache +inst/rmarkdown/templates/hier/skeleton/skeleton_files +inst/rmarkdown/templates/hier/skeleton/skeleton.pdf mkin*.tar.gz mkin.tar mkin.Rcheck diff --git a/GNUmakefile b/GNUmakefile index e5f83c1f..4680514c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -24,7 +24,9 @@ pkgfiles = \ DESCRIPTION \ inst/WORDLIST \ inst/dataset_generation/* \ - inst/testdata/fit_old_FOCUS_D.rda \ + inst/rmarkdown/templates/hier/template.yaml \ + inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd \ + inst/testdata/* \ man/* \ NAMESPACE \ NEWS.md \ diff --git a/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd new file mode 100644 index 00000000..df6fa2f9 --- /dev/null +++ b/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd @@ -0,0 +1,186 @@ +--- +title: "Hierarchical kinetic modelling of degradation data" +author: +date: Last change on DD MMM YYYY, last compiled on `r format(Sys.time(), + "%e %B %Y")` +output: + pdf_document: + extra_dependencies: ["float", "listing"] +toc: yes +geometry: margin=2cm +--- + + +```{r setup, echo = FALSE, cache = FALSE} +errmods <- c(const = "constant variance", tc = "two-component error") + +knitr::opts_chunk$set( + comment = "", tidy = FALSE, cache = TRUE, fig.pos = "H", fig.align = "center" +) +options(knitr.kable.NA = "") + +# Version requirements +if (getRversion() < "4.1.0") + stop("You need R with version > 4.1.0 to compile this document") +if ((saemix_version <- packageVersion("saemix")) < "3.1") { + warning("Your saemix version is ", saemix_version, + ", you should preferably use 3.2 to compile this document") +} +if ((mkin_version <- packageVersion("mkin")) < "1.2.2") { + stop("Your mkin version is ", mkin_version, + ", you need at least 1.2.2 to compile this document") +} +``` + +```{r packages, cache = FALSE, message = FALSE, warning = FALSE, echo = FALSE} +library(mkin) +library(saemix) +library(parallel) +library(knitr) +``` + +```{r n_cores, cache = FALSE, echo = FALSE} +n_cores <- detectCores() + +if (Sys.info()["sysname"] == "Windows") { + cl <- makePSOCKcluster(n_cores) +} else { + cl <- makeForkCluster(n_cores) +} +``` + +\clearpage + +# Introduction + +This report shows hierarchical kinetic modelling for ... +The data were obtained from ... + +```{r ds} +data_path <- system.file("testdata", "lambda-cyhalothrin_soil_efsa_2014.xlsx", package = "mkin") +ds <- read_spreadsheet(data_path, valid_datasets = c(1:4, 7:13)) +covariates <- attr(ds, "covariates") +``` + +The covariate data are shown below. + +```{r results = "asis", dependson = "ds", echo = FALSE} +kable(covariates, caption = "Covariate data for all datasets") +``` + +\clearpage + +The datasets with the residue time series are shown in the tables below. Please +refer to the spreadsheet for details like data sources, treatment of values +below reporting limits and time step normalisation factors. + +```{r results = "asis", dependson = "ds", echo = FALSE} +for (ds_name in names(ds)) { + print( + kable(mkin_long_to_wide(ds[[ds_name]]), + caption = paste("Dataset", ds_name), + booktabs = TRUE, row.names = FALSE)) + cat("\n\\clearpage\n") +} +``` + +# Parent only evaluations + +The following code performs separate fits of the candidate degradation models +to all datasets using constant variance and the two-component error model. + +```{r parent-sep, dependson = "ds"} +parent_deg_mods <- c("SFO", "FOMC", "DFOP", "SFORB") +parent_sep_const <- mmkin( + parent_deg_mods, ds, + error_model = "const", + cluster = cl, quiet = TRUE) +parent_sep_tc <- update(parent_sep_const, error_model = "tc") +``` + +To select the parent model, the corresponding hierarchical fits are performed below. + +```{r parent-mhmkin, dependson = "parent-sep"} +parent_mhmkin <- mhmkin(list(parent_sep_const, parent_sep_tc), cluster = cl) +status(parent_mhmkin) |> kable() +``` + +All fits terminate without errors (status OK). The check for ill-defined +parameters shows that not all random effect parameters can be robustly +quantified. + +```{r dependson = "parent_mhmkin"} +illparms(parent_mhmkin) |> kable() +``` + +Therefore, the fits are updated, excluding random effects that were +ill-defined according to the `illparms` function. + +```{r parent-mhmkin-refined} +parent_mhmkin_refined <- update(parent_mhmkin, + no_random_effect = illparms(parent_mhmkin)) +status(parent_mhmkin_refined) |> kable() +``` + +The most suitable model is selected based on the AIC. + +```{r dependson = "parent-mhmkin"} +aic_parent <- AIC(parent_mhmkin_refined) +min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE) +best_degmod_parent <- rownames(aic_parent)[min_aic[1]] +best_errmod_parent <- colnames(aic_parent)[min_aic[2]] +anova(parent_mhmkin_refined) |> kable(digits = 1) +``` + +Based on the AIC, the combination of the `r best_degmod_parent` degradation +model with the error model `r errmods[best_errmod_parent]` is identified to +be most suitable for the degradation of the parent. The check below +confirms that no ill-defined parameters remain for this combined model. + +```{r dependson = "parent-mhmkin"} +illparms(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +``` + +The corresponding fit is shown below. + +```{r parent-best-full, dependson = "parent-mhmkin"} +plot(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +``` + +Detailed listings of the parent fits are shown in the Appendix. + +\clearpage + +# Appendix + +## Summaries of saem fits + +### Parent fits + +```{r listings-parent, results = "asis", echo = FALSE} +for (deg_mod in parent_deg_mods) { + for (err_mod in c("const", "tc")) { + caption <- paste("Hierarchical", deg_mod, "fit with", errmods[err_mod]) + tex_listing(parent_mhmkin[[deg_mod, err_mod]], caption) + } +} +``` + +### Refined parent fits + +```{r listings-pathway, results = "asis", echo = FALSE} +for (deg_mod in parent_deg_mods) { + for (err_mod in c("const", "tc")) { + caption <- paste("Refined hierarchical", deg_mod, "fit with", errmods[err_mod]) + tex_listing(parent_mhmkin_refined[[deg_mod, err_mod]], caption) + } +} +``` + +## Session info + +```{r, echo = FALSE} +parallel::stopCluster(cl) +sessionInfo() +``` + diff --git a/inst/rmarkdown/templates/hier/template.yaml b/inst/rmarkdown/templates/hier/template.yaml new file mode 100644 index 00000000..d8ab6a4d --- /dev/null +++ b/inst/rmarkdown/templates/hier/template.yaml @@ -0,0 +1,3 @@ +name: Hierarchical kinetics +description: Hierarchical kinetic modelling of degradation data +create_dir: true diff --git a/inst/testdata/lambda-cyhalothrin_soil_efsa_2014.xlsx b/inst/testdata/lambda-cyhalothrin_soil_efsa_2014.xlsx new file mode 100644 index 00000000..32fc049f Binary files /dev/null and b/inst/testdata/lambda-cyhalothrin_soil_efsa_2014.xlsx differ -- cgit v1.2.1 From 886c9ef013124aa954d960c655b349b5340ff154 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 19 Dec 2022 12:31:56 +0100 Subject: Rename template folder, create format Instead of rmarkdown::pdf_document, mkin::hierarchical_kinetics is used as a document format in the template. In this way, the template file can be freed from some R code and yaml options that the average user does not have to be aware of. --- .Rbuildignore | 6 +- .gitignore | 6 +- GNUmakefile | 4 +- NAMESPACE | 2 + NEWS.md | 4 + R/hierarchical_kinetics.R | 39 +++++ R/parplot.R | 2 +- .../rmarkdown/templates/hier/skeleton/skeleton.Rmd | 186 --------------------- inst/rmarkdown/templates/hier/template.yaml | 3 - .../hierarchical_kinetics/skeleton/header.tex | 1 + .../hierarchical_kinetics/skeleton/skeleton.Rmd | 162 ++++++++++++++++++ .../templates/hierarchical_kinetics/template.yaml | 3 + log/check.log | 21 ++- man/hierarchical_kinetics.Rd | 29 ++++ 14 files changed, 265 insertions(+), 203 deletions(-) create mode 100644 R/hierarchical_kinetics.R delete mode 100644 inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd delete mode 100644 inst/rmarkdown/templates/hier/template.yaml create mode 100644 inst/rmarkdown/templates/hierarchical_kinetics/skeleton/header.tex create mode 100644 inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd create mode 100644 inst/rmarkdown/templates/hierarchical_kinetics/template.yaml create mode 100644 man/hierarchical_kinetics.Rd diff --git a/.Rbuildignore b/.Rbuildignore index 0dcec29a..1eb33577 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,9 +9,9 @@ ^test.R$ ^mkin_.*\.tar\.gz ^mkin.tar$ -^inst/rmarkdown/templates/hier/skeleton/skeleton.pdf$ -^inst/rmarkdown/templates/hier/skeleton/skeleton_cache -^inst/rmarkdown/templates/hier/skeleton/skeleton_files +^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.pdf$ +^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_cache +^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_files ^vignettes/.build.timestamp$ ^vignettes/.*_cache$ ^vignettes/.*cache$ diff --git a/.gitignore b/.gitignore index 4f479259..9808896d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ docs/articles/*_cache/ install.log -inst/rmarkdown/templates/hier/skeleton/skeleton_cache -inst/rmarkdown/templates/hier/skeleton/skeleton_files -inst/rmarkdown/templates/hier/skeleton/skeleton.pdf +inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_cache +inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_files +inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.pdf mkin*.tar.gz mkin.tar mkin.Rcheck diff --git a/GNUmakefile b/GNUmakefile index 4680514c..4a33c538 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -24,8 +24,8 @@ pkgfiles = \ DESCRIPTION \ inst/WORDLIST \ inst/dataset_generation/* \ - inst/rmarkdown/templates/hier/template.yaml \ - inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd \ + inst/rmarkdown/templates/hierarchical_kinetics/template.yaml \ + inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd \ inst/testdata/* \ man/* \ NAMESPACE \ diff --git a/NAMESPACE b/NAMESPACE index 107ffc54..84d6b713 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -96,6 +96,7 @@ export(create_deg_func) export(endpoints) export(f_time_norm_focus) export(get_deg_func) +export(hierarchical_kinetics) export(illparms) export(ilr) export(intervals) @@ -187,6 +188,7 @@ importFrom(stats,qf) importFrom(stats,qlogis) importFrom(stats,qnorm) importFrom(stats,qt) +importFrom(stats,quantile) importFrom(stats,residuals) importFrom(stats,rnorm) importFrom(stats,shapiro.test) diff --git a/NEWS.md b/NEWS.md index 7e65204f..2c09df35 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # mkin 1.2.2 +- 'inst/rmarkdown/templates/hier': R markdown template to facilitate the application of hierarchical kinetic models. + +- 'inst/testdata/lambda-cyhalothrin_soil_efsa_2014.xlsx': Example spreadsheet for use with 'read_spreadsheet()'. + - 'R/mhmkin.R': Allow an 'illparms.mhmkin' object or a list with suitable dimensions as value of the argument 'no_random_effects', making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well. - 'R/summary.saem.mmkin.R': List all initial parameter values in the summary, including random effects and error model parameters. Avoid redundant warnings that occurred in the calculation of correlations of the fixed effects in the case that the Fisher information matrix could not be inverted. List correlations of random effects if specified by the user in the covariance model. diff --git a/R/hierarchical_kinetics.R b/R/hierarchical_kinetics.R new file mode 100644 index 00000000..f7ffb333 --- /dev/null +++ b/R/hierarchical_kinetics.R @@ -0,0 +1,39 @@ +#' Hierarchical kinetics template +#' +#' R markdown format for setting up hierarchical kinetics based on a template +#' provided with the mkin package. +#' +#' @inheritParams rmarkdown::pdf_document +#' @param ... Arguments to \code{rmarkdown::pdf_document} +#' +#' @return R Markdown output format to pass to +#' \code{\link[rmarkdown:render]{render}} +#' +#' @examples +#' +#' \dontrun{ +#' library(rmarkdown) +#' draft("New analysis.rmd", template = "hierarchical_kinetics", package = "mkin") +#' } +#' +#' @export +hierarchical_kinetics <- function(..., keep_tex = FALSE) { + + if (getRversion() < "4.1.0") + stop("You need R with version > 4.1.0 to compile this document") + + if (!requireNamespace("knitr")) stop("Please install the knitr package to use this template") + if (!requireNamespace("rmarkdown")) stop("Please install the rmarkdown package to use this template") + knitr::opts_chunk$set(echo = FALSE, cache = TRUE, comment = "", tidy = FALSE) + knitr::opts_chunk$set(fig.align = "center", fig.pos = "H") + options(knitr.kable.NA = "") + + fmt <- rmarkdown::pdf_document(..., + keep_tex = keep_tex, + toc = TRUE, + includes = rmarkdown::includes(in_header = "header.tex"), + extra_dependencies = c("float", "listing", "framed") + ) + + return(fmt) +} diff --git a/R/parplot.R b/R/parplot.R index e9c18947..3da4b51a 100644 --- a/R/parplot.R +++ b/R/parplot.R @@ -23,7 +23,7 @@ #' of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478. #' doi: 10.1186/s12859-021-04373-4. #' @seealso [multistart] -#' @importFrom stats median +#' @importFrom stats median quantile #' @export parplot <- function(object, ...) { UseMethod("parplot") diff --git a/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd deleted file mode 100644 index df6fa2f9..00000000 --- a/inst/rmarkdown/templates/hier/skeleton/skeleton.Rmd +++ /dev/null @@ -1,186 +0,0 @@ ---- -title: "Hierarchical kinetic modelling of degradation data" -author: -date: Last change on DD MMM YYYY, last compiled on `r format(Sys.time(), - "%e %B %Y")` -output: - pdf_document: - extra_dependencies: ["float", "listing"] -toc: yes -geometry: margin=2cm ---- - - -```{r setup, echo = FALSE, cache = FALSE} -errmods <- c(const = "constant variance", tc = "two-component error") - -knitr::opts_chunk$set( - comment = "", tidy = FALSE, cache = TRUE, fig.pos = "H", fig.align = "center" -) -options(knitr.kable.NA = "") - -# Version requirements -if (getRversion() < "4.1.0") - stop("You need R with version > 4.1.0 to compile this document") -if ((saemix_version <- packageVersion("saemix")) < "3.1") { - warning("Your saemix version is ", saemix_version, - ", you should preferably use 3.2 to compile this document") -} -if ((mkin_version <- packageVersion("mkin")) < "1.2.2") { - stop("Your mkin version is ", mkin_version, - ", you need at least 1.2.2 to compile this document") -} -``` - -```{r packages, cache = FALSE, message = FALSE, warning = FALSE, echo = FALSE} -library(mkin) -library(saemix) -library(parallel) -library(knitr) -``` - -```{r n_cores, cache = FALSE, echo = FALSE} -n_cores <- detectCores() - -if (Sys.info()["sysname"] == "Windows") { - cl <- makePSOCKcluster(n_cores) -} else { - cl <- makeForkCluster(n_cores) -} -``` - -\clearpage - -# Introduction - -This report shows hierarchical kinetic modelling for ... -The data were obtained from ... - -```{r ds} -data_path <- system.file("testdata", "lambda-cyhalothrin_soil_efsa_2014.xlsx", package = "mkin") -ds <- read_spreadsheet(data_path, valid_datasets = c(1:4, 7:13)) -covariates <- attr(ds, "covariates") -``` - -The covariate data are shown below. - -```{r results = "asis", dependson = "ds", echo = FALSE} -kable(covariates, caption = "Covariate data for all datasets") -``` - -\clearpage - -The datasets with the residue time series are shown in the tables below. Please -refer to the spreadsheet for details like data sources, treatment of values -below reporting limits and time step normalisation factors. - -```{r results = "asis", dependson = "ds", echo = FALSE} -for (ds_name in names(ds)) { - print( - kable(mkin_long_to_wide(ds[[ds_name]]), - caption = paste("Dataset", ds_name), - booktabs = TRUE, row.names = FALSE)) - cat("\n\\clearpage\n") -} -``` - -# Parent only evaluations - -The following code performs separate fits of the candidate degradation models -to all datasets using constant variance and the two-component error model. - -```{r parent-sep, dependson = "ds"} -parent_deg_mods <- c("SFO", "FOMC", "DFOP", "SFORB") -parent_sep_const <- mmkin( - parent_deg_mods, ds, - error_model = "const", - cluster = cl, quiet = TRUE) -parent_sep_tc <- update(parent_sep_const, error_model = "tc") -``` - -To select the parent model, the corresponding hierarchical fits are performed below. - -```{r parent-mhmkin, dependson = "parent-sep"} -parent_mhmkin <- mhmkin(list(parent_sep_const, parent_sep_tc), cluster = cl) -status(parent_mhmkin) |> kable() -``` - -All fits terminate without errors (status OK). The check for ill-defined -parameters shows that not all random effect parameters can be robustly -quantified. - -```{r dependson = "parent_mhmkin"} -illparms(parent_mhmkin) |> kable() -``` - -Therefore, the fits are updated, excluding random effects that were -ill-defined according to the `illparms` function. - -```{r parent-mhmkin-refined} -parent_mhmkin_refined <- update(parent_mhmkin, - no_random_effect = illparms(parent_mhmkin)) -status(parent_mhmkin_refined) |> kable() -``` - -The most suitable model is selected based on the AIC. - -```{r dependson = "parent-mhmkin"} -aic_parent <- AIC(parent_mhmkin_refined) -min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE) -best_degmod_parent <- rownames(aic_parent)[min_aic[1]] -best_errmod_parent <- colnames(aic_parent)[min_aic[2]] -anova(parent_mhmkin_refined) |> kable(digits = 1) -``` - -Based on the AIC, the combination of the `r best_degmod_parent` degradation -model with the error model `r errmods[best_errmod_parent]` is identified to -be most suitable for the degradation of the parent. The check below -confirms that no ill-defined parameters remain for this combined model. - -```{r dependson = "parent-mhmkin"} -illparms(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) -``` - -The corresponding fit is shown below. - -```{r parent-best-full, dependson = "parent-mhmkin"} -plot(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) -``` - -Detailed listings of the parent fits are shown in the Appendix. - -\clearpage - -# Appendix - -## Summaries of saem fits - -### Parent fits - -```{r listings-parent, results = "asis", echo = FALSE} -for (deg_mod in parent_deg_mods) { - for (err_mod in c("const", "tc")) { - caption <- paste("Hierarchical", deg_mod, "fit with", errmods[err_mod]) - tex_listing(parent_mhmkin[[deg_mod, err_mod]], caption) - } -} -``` - -### Refined parent fits - -```{r listings-pathway, results = "asis", echo = FALSE} -for (deg_mod in parent_deg_mods) { - for (err_mod in c("const", "tc")) { - caption <- paste("Refined hierarchical", deg_mod, "fit with", errmods[err_mod]) - tex_listing(parent_mhmkin_refined[[deg_mod, err_mod]], caption) - } -} -``` - -## Session info - -```{r, echo = FALSE} -parallel::stopCluster(cl) -sessionInfo() -``` - diff --git a/inst/rmarkdown/templates/hier/template.yaml b/inst/rmarkdown/templates/hier/template.yaml deleted file mode 100644 index d8ab6a4d..00000000 --- a/inst/rmarkdown/templates/hier/template.yaml +++ /dev/null @@ -1,3 +0,0 @@ -name: Hierarchical kinetics -description: Hierarchical kinetic modelling of degradation data -create_dir: true diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/header.tex b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/header.tex new file mode 100644 index 00000000..a2b7ce83 --- /dev/null +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/header.tex @@ -0,0 +1 @@ +\definecolor{shadecolor}{RGB}{248,248,248} diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd new file mode 100644 index 00000000..74fae164 --- /dev/null +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -0,0 +1,162 @@ +--- +title: "Hierarchical kinetic modelling of degradation data" +author: +date: +output: mkin::hierarchical_kinetics +geometry: margin=2cm +--- + +```{r packages, cache = FALSE, message = FALSE} +library(mkin) +library(knitr) +library(saemix) +library(parallel) +library(readxl) +``` + +```{r n_cores, cache = FALSE, echo = FALSE} +n_cores <- detectCores() + +if (Sys.info()["sysname"] == "Windows") { + cl <- makePSOCKcluster(n_cores) +} else { + cl <- makeForkCluster(n_cores) +} +``` + +\clearpage + +# Introduction + +This report shows hierarchical kinetic modelling for ... +The data were obtained from ... + +```{r ds} +data_path <- system.file("testdata", "lambda-cyhalothrin_soil_efsa_2014.xlsx", package = "mkin") +ds <- read_spreadsheet(data_path, valid_datasets = c(1:4, 7:13)) +covariates <- attr(ds, "covariates") +``` + +The covariate data are shown below. + +```{r results = "asis", dependson = "ds", echo = FALSE} +kable(covariates, caption = "Covariate data for all datasets") +``` + +\clearpage + +The datasets with the residue time series are shown in the tables below. Please +refer to the spreadsheet for details like data sources, treatment of values +below reporting limits and time step normalisation factors. + +```{r results = "asis", dependson = "ds", echo = FALSE} +for (ds_name in names(ds)) { + print( + kable(mkin_long_to_wide(ds[[ds_name]]), + caption = paste("Dataset", ds_name), + booktabs = TRUE, row.names = FALSE)) + cat("\n\\clearpage\n") +} +``` + +# Parent only evaluations + +The following code performs separate fits of the candidate degradation models +to all datasets using constant variance and the two-component error model. + +```{r parent-sep, dependson = "ds"} +parent_deg_mods <- c("SFO", "FOMC", "DFOP", "SFORB") +errmods <- c(const = "constant variance", tc = "two-component error") +parent_sep_const <- mmkin( + parent_deg_mods, ds, + error_model = "const", + cluster = cl, quiet = TRUE) +parent_sep_tc <- update(parent_sep_const, error_model = "tc") +``` + +To select the parent model, the corresponding hierarchical fits are performed below. + +```{r parent-mhmkin, dependson = "parent-sep"} +parent_mhmkin <- mhmkin(list(parent_sep_const, parent_sep_tc), cluster = cl) +status(parent_mhmkin) |> kable() +``` + +All fits terminate without errors (status OK). The check for ill-defined +parameters shows that not all random effect parameters can be robustly +quantified. + +```{r dependson = "parent_mhmkin"} +illparms(parent_mhmkin) |> kable() +``` + +Therefore, the fits are updated, excluding random effects that were +ill-defined according to the `illparms` function. + +```{r parent-mhmkin-refined} +parent_mhmkin_refined <- update(parent_mhmkin, + no_random_effect = illparms(parent_mhmkin)) +status(parent_mhmkin_refined) |> kable() +``` + +The most suitable model is selected based on the AIC. + +```{r, dependson = "parent-mhmkin"} +aic_parent <- AIC(parent_mhmkin_refined) +min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE) +best_degmod_parent <- rownames(aic_parent)[min_aic[1]] +best_errmod_parent <- colnames(aic_parent)[min_aic[2]] +anova(parent_mhmkin_refined) |> kable(digits = 1) +``` + +Based on the AIC, the combination of the `r best_degmod_parent` degradation +model with the error model `r errmods[best_errmod_parent]` is identified to +be most suitable for the degradation of the parent. The check below +confirms that no ill-defined parameters remain for this combined model. + +```{r dependson = "parent-mhmkin"} +illparms(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +``` + +The corresponding fit is shown below. + +```{r parent-best-full, dependson = "parent-mhmkin"} +plot(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +``` + +Detailed listings of the parent fits are shown in the Appendix. + +\clearpage + +# Appendix + +## Summaries of saem fits + +### Parent fits + +```{r listings-parent, results = "asis", echo = FALSE, dependson = "parent_mhmkin"} +for (deg_mod in parent_deg_mods) { + for (err_mod in c("const", "tc")) { + caption <- paste("Hierarchical", deg_mod, "fit with", errmods[err_mod]) + tex_listing(parent_mhmkin[[deg_mod, err_mod]], caption) + } +} +``` + +### Refined parent fits + +```{r listings-parent-refined, results = "asis", echo = FALSE, dependson = "parent_mhmkin_refined"} +for (deg_mod in parent_deg_mods) { + for (err_mod in c("const", "tc")) { + caption <- paste("Refined hierarchical", deg_mod, "fit with", errmods[err_mod]) + tex_listing(parent_mhmkin_refined[[deg_mod, err_mod]], caption) + } +} +``` + +## Session info + +```{r, echo = FALSE, cache = FALSE} +parallel::stopCluster(cl) +sessionInfo() +``` + diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/template.yaml b/inst/rmarkdown/templates/hierarchical_kinetics/template.yaml new file mode 100644 index 00000000..d8ab6a4d --- /dev/null +++ b/inst/rmarkdown/templates/hierarchical_kinetics/template.yaml @@ -0,0 +1,3 @@ +name: Hierarchical kinetics +description: Hierarchical kinetic modelling of degradation data +create_dir: true diff --git a/log/check.log b/log/check.log index 42365918..aec61e33 100644 --- a/log/check.log +++ b/log/check.log @@ -1,5 +1,5 @@ * using log directory ‘/home/jranke/git/mkin/mkin.Rcheck’ -* using R version 4.2.2 (2022-10-31) +* using R version 4.2.2 Patched (2022-11-10 r83330) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-tests --as-cran’ @@ -18,7 +18,7 @@ Maintainer: ‘Johannes Ranke ’ * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking serialization versions ... OK -* checking whether package ‘mkin’ can be installed ... [11s/11s] OK +* checking whether package ‘mkin’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK @@ -41,7 +41,14 @@ Maintainer: ‘Johannes Ranke ’ * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK -* checking R code for possible problems ... [19s/19s] OK +* checking R code for possible problems ... NOTE +parplot.multistart.saem.mmkin: no visible global function definition + for ‘quantile’ +Undefined global functions or variables: + quantile +Consider adding + importFrom("stats", "quantile") +to your NAMESPACE file. * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -57,7 +64,7 @@ Maintainer: ‘Johannes Ranke ’ * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... [24s/24s] OK +* checking examples ... [11s/11s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK @@ -69,5 +76,9 @@ Maintainer: ‘Johannes Ranke ’ * checking for detritus in the temp directory ... OK * DONE -Status: OK +Status: 1 NOTE +See + ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ +for details. + diff --git a/man/hierarchical_kinetics.Rd b/man/hierarchical_kinetics.Rd new file mode 100644 index 00000000..4bb82a4c --- /dev/null +++ b/man/hierarchical_kinetics.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hierarchical_kinetics.R +\name{hierarchical_kinetics} +\alias{hierarchical_kinetics} +\title{Hierarchical kinetics template} +\usage{ +hierarchical_kinetics(..., keep_tex = FALSE) +} +\arguments{ +\item{...}{Arguments to \code{rmarkdown::pdf_document}} + +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +} +\value{ +R Markdown output format to pass to +\code{\link[rmarkdown:render]{render}} +} +\description{ +R markdown format for setting up hierarchical kinetics based on a template +provided with the mkin package. +} +\examples{ + +\dontrun{ +library(rmarkdown) +draft("New analysis.rmd", template = "hierarchical_kinetics", package = "mkin") +} + +} -- cgit v1.2.1 From 9a066c13e2f6324920910a238e3b40261854e21a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 22 Dec 2022 12:57:24 +0100 Subject: Improve code formatting in template skeleton --- inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index 74fae164..3c7dc8a5 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -32,7 +32,9 @@ This report shows hierarchical kinetic modelling for ... The data were obtained from ... ```{r ds} -data_path <- system.file("testdata", "lambda-cyhalothrin_soil_efsa_2014.xlsx", package = "mkin") +data_path <- system.file( + "testdata", "lambda-cyhalothrin_soil_efsa_2014.xlsx", + package = "mkin") ds <- read_spreadsheet(data_path, valid_datasets = c(1:4, 7:13)) covariates <- attr(ds, "covariates") ``` -- cgit v1.2.1 From a89a835e0fd6fe55e4c7353e99cc442c4d309bc1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 2 Jan 2023 10:25:47 +0100 Subject: Echo R code per default in markdown template --- R/hierarchical_kinetics.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/hierarchical_kinetics.R b/R/hierarchical_kinetics.R index f7ffb333..70e0100a 100644 --- a/R/hierarchical_kinetics.R +++ b/R/hierarchical_kinetics.R @@ -24,7 +24,7 @@ hierarchical_kinetics <- function(..., keep_tex = FALSE) { if (!requireNamespace("knitr")) stop("Please install the knitr package to use this template") if (!requireNamespace("rmarkdown")) stop("Please install the rmarkdown package to use this template") - knitr::opts_chunk$set(echo = FALSE, cache = TRUE, comment = "", tidy = FALSE) + knitr::opts_chunk$set(echo = FALSE, cache = TRUE, comment = "", tidy = FALSE, echo = TRUE) knitr::opts_chunk$set(fig.align = "center", fig.pos = "H") options(knitr.kable.NA = "") -- cgit v1.2.1 From 435b7bc8fcbb55b5f487cf5d92d60833daf75ae7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 2 Jan 2023 10:26:40 +0100 Subject: Fix no_random_effect with character vector --- R/mhmkin.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mhmkin.R b/R/mhmkin.R index a9798ff4..6265a59e 100644 --- a/R/mhmkin.R +++ b/R/mhmkin.R @@ -134,7 +134,7 @@ mhmkin.list <- function(objects, backend = "saemix", algorithm = "saem", dimnames(fit_indices) <- list(degradation = names(deg_models), error = error_models) - if (is.null(no_random_effect) || length(dim(no_random_effect)) == 1) { + if (is.null(no_random_effect) || is.null(dim(no_random_effect))) { no_ranef <- rep(list(no_random_effect), n.fits) dim(no_ranef) <- dim(fit_indices) } else { -- cgit v1.2.1 From ed2ab7bba07e3cb036782227fe27943f4b5583fa Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 3 Jan 2023 09:31:48 +0100 Subject: Improved skeleton for hierarchical fits Now with working pathway fits using SFORB-SFO2 (only two parallel metabolites instead of three) as the data for compound Ia was not sufficient for a reliable fit. --- .gitignore | 1 + DESCRIPTION | 14 +- R/hierarchical_kinetics.R | 1 + .../hierarchical_kinetics/skeleton/skeleton.Rmd | 181 +++++++++++++++++++-- 4 files changed, 175 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 9808896d..5416f8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ install.log inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_cache inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_files inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.pdf +inst/rmarkdown/templates/hierarchical_kinetics/skeleton/*_dlls mkin*.tar.gz mkin.tar mkin.Rcheck diff --git a/DESCRIPTION b/DESCRIPTION index 04237b10..d061a5a9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data Version: 1.2.2 -Date: 2022-11-22 +Date: 2023-01-03 Authors@R: c( person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "johannes.ranke@jrwb.de", @@ -17,11 +17,11 @@ Description: Calculation routines based on the FOCUS Kinetics Report (2006, equation models are solved using automatically generated C functions. Heteroscedasticity can be taken into account using variance by variable or two-component error models as described by Ranke and Meinecke (2018) - . Interfaces to several nonlinear - mixed-effects model packages are available, some of which are described by - Ranke et al. (2021) . Please note that no - warranty is implied for correctness of results or fitness for a particular - purpose. + . Hierarchical degradation models can + be fitted using nonlinear mixed-effects model packages as a backend as + described by Ranke et al. (2021) . Please + note that no warranty is implied for correctness of results or fitness for a + particular purpose. Depends: R (>= 2.15.1), Imports: stats, graphics, methods, parallel, deSolve, R6, inline (>= 0.3.19), numDeriv, lmtest, pkgbuild, nlme (>= 3.1-151), saemix (>= 3.1), rlang, vctrs @@ -36,4 +36,4 @@ VignetteBuilder: knitr BugReports: https://github.com/jranke/mkin/issues/ URL: https://pkgdown.jrwb.de/mkin/ Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.2 +RoxygenNote: 7.2.3 diff --git a/R/hierarchical_kinetics.R b/R/hierarchical_kinetics.R index 70e0100a..a90dd619 100644 --- a/R/hierarchical_kinetics.R +++ b/R/hierarchical_kinetics.R @@ -31,6 +31,7 @@ hierarchical_kinetics <- function(..., keep_tex = FALSE) { fmt <- rmarkdown::pdf_document(..., keep_tex = keep_tex, toc = TRUE, + toc_depth = 3, includes = rmarkdown::includes(in_header = "header.tex"), extra_dependencies = c("float", "listing", "framed") ) diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index 3c7dc8a5..9a975607 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -6,6 +6,10 @@ output: mkin::hierarchical_kinetics geometry: margin=2cm --- +\clearpage + +# Setup + ```{r packages, cache = FALSE, message = FALSE} library(mkin) library(knitr) @@ -14,7 +18,7 @@ library(parallel) library(readxl) ``` -```{r n_cores, cache = FALSE, echo = FALSE} +```{r n_cores, cache = FALSE} n_cores <- detectCores() if (Sys.info()["sysname"] == "Windows") { @@ -92,7 +96,8 @@ illparms(parent_mhmkin) |> kable() ``` Therefore, the fits are updated, excluding random effects that were -ill-defined according to the `illparms` function. +ill-defined according to the `illparms` function. The status of the fits +is checked. ```{r parent-mhmkin-refined} parent_mhmkin_refined <- update(parent_mhmkin, @@ -100,14 +105,22 @@ parent_mhmkin_refined <- update(parent_mhmkin, status(parent_mhmkin_refined) |> kable() ``` -The most suitable model is selected based on the AIC. +Also, it is checked if the AIC values of the refined fits are actually smaller +than the AIC values of the original fits. + +```{r dependson = "parent-mhmkin-refined"} +(AIC(parent_mhmkin_refined) < AIC(parent_mhmkin)) |> kable() +``` + +From the refined fits, the most suitable model is selected using the AIC. -```{r, dependson = "parent-mhmkin"} +```{r parent-best, dependson = "parent-mhmkin"} aic_parent <- AIC(parent_mhmkin_refined) min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE) best_degmod_parent <- rownames(aic_parent)[min_aic[1]] best_errmod_parent <- colnames(aic_parent)[min_aic[2]] anova(parent_mhmkin_refined) |> kable(digits = 1) +parent_best <- parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]] ``` Based on the AIC, the combination of the `r best_degmod_parent` degradation @@ -115,25 +128,152 @@ model with the error model `r errmods[best_errmod_parent]` is identified to be most suitable for the degradation of the parent. The check below confirms that no ill-defined parameters remain for this combined model. -```{r dependson = "parent-mhmkin"} -illparms(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +```{r dependson = "parent-best"} +illparms(parent_best) ``` -The corresponding fit is shown below. +The corresponding fit is plotted below. + +```{r dependson = "parent-best"} +plot(parent_best) +``` +The fitted parameters, together with approximate confidence +intervals are listed below. -```{r parent-best-full, dependson = "parent-mhmkin"} -plot(parent_mhmkin_refined[[best_degmod_parent, best_errmod_parent]]) +```{r dependson = "parent-best"} +parms(parent_best, ci = TRUE) |> kable(digits = 3) ``` -Detailed listings of the parent fits are shown in the Appendix. +As an example of the investigation of covariate influence on degradation +parameters, a covariate model is added to the hierarchical model for each of +the degradation parameters with well-defined random effects. Also, +a version with covariate models for both of them is fitted. + +```{r parent-best-pH} +parent_best_pH_1 <- update(parent_best, covariates = covariates, + covariate_models = list(log_k_lambda_free ~ pH)) +parent_best_pH_2 <- update(parent_best, covariates = covariates, + covariate_models = list(log_k_lambda_bound_free ~ pH)) +parent_best_pH_3 <- update(parent_best, covariates = covariates, + covariate_models = list(log_k_lambda_free ~ pH, log_k_lambda_bound_free ~ pH)) +``` + +The resulting models are compared. + +```{r dependson = "parent-best-pH"} +anova(parent_best, parent_best_pH_1, parent_best_pH_2, parent_best_pH_3) |> + kable(digits = 1) +``` + +The model fit with the lowest AIC is the one with a pH correlation of the +desorption rate constant `k_lambda_bound_free`. Plot and parameter listing +of this fit are shown below. Also, it is confirmed that no ill-defined +variance parameters are found. + +```{r dependson = "parent-best-pH"} +plot(parent_best_pH_2) +``` + +```{r dependson = "parent-best-pH"} +illparms(parent_best_pH_2) +parms(parent_best_pH_2, ci = TRUE) |> kable(digits = 3) +``` \clearpage -# Appendix +# Pathway fits + +As an example of a pathway fit, a model with SFORB for the parent compound and +parallel formation of two metabolites is set up. + + +```{r m_sforb_sfo2} +if (!dir.exists("lambda_dlls")) dir.create("lambda_dlls") + +m_sforb_sfo2 = mkinmod( + lambda = mkinsub("SFORB", to = c("c_V", "c_XV")), + c_V = mkinsub("SFO"), + c_XV = mkinsub("SFO"), + name = "sforb_sfo2", + dll_dir = "lambda_dlls", + overwrite = TRUE, quiet = TRUE +) +``` + +Separate evaluations of all datasets are performed with constant variance +and using two-component error. -## Summaries of saem fits +```{r path-sep, dependson = c("m_sforb_all", "ds")} +sforb_sep_const <- mmkin(list(sforb_path = m_sforb_sfo2), ds, + cluster = cl, quiet = TRUE) +sforb_sep_tc <- update(sforb_sep_const, error_model = "tc") +``` + +The separate fits with constant variance are plotted. + +```{r dependson = "path-sep", fig.height = 9} +plot(mixed(sforb_sep_const)) +``` -### Parent fits +The two corresponding hierarchical fits, with the random effects for the parent +degradation parameters excluded as discussed above, and including the covariate +model that was identified for the parent degradation, are attempted below. + +```{r path-1, dependson = "path-sep"} +path_1 <- mhmkin(list(sforb_sep_const, sforb_sep_tc), + no_random_effect = c("lambda_free_0", "log_k_lambda_free_bound"), + covariates = covariates, covariate_models = list(log_k_lambda_bound_free ~ pH), + cluster = cl) +``` + +```{r dependson = "path-1"} +status(path_1) |> kable() +``` + +The status information shows that both fits were successfully completed. + +```{r dependson = "path-1"} +anova(path_1) |> kable(digits = 1) +``` +Model comparison shows that the two-component error model provides a much +better fit. + +```{r dependson = "path-1"} +illparms(path_1[["sforb_path", "tc"]]) +``` + +Two ill-defined variance components are found. Therefore, the fit is +repeated with the corresponding random effects removed. + +```{r path-1-refined, dependson = "path-1"} +path_1_refined <- update(path_1[["sforb_path", "tc"]], + no_random_effect = c("lambda_free_0", "log_k_lambda_free_bound", + "log_k_c_XV", "f_lambda_ilr_2")) +``` + +The empty output of the illparms function indicates that there are no +ill-defined parameters remaining in the refined fit. + +```{r dependson = "path-1-refined"} +illparms(path_1_refined) +``` + +Below, the refined fit is plotted and the fitted parameters are shown together +with their 95% confidence intervals. + +```{r dependson = "path-1-refined", fig.height = 9} +plot(path_1_refined) +``` + +```{r dependson = "path-1-refined", fig.height = 9} +parms(path_1_refined, ci = TRUE) |> kable(digits = 3) +``` + +\clearpage + +# Appendix + +## Listings of initial parent fits ```{r listings-parent, results = "asis", echo = FALSE, dependson = "parent_mhmkin"} for (deg_mod in parent_deg_mods) { @@ -144,7 +284,7 @@ for (deg_mod in parent_deg_mods) { } ``` -### Refined parent fits +## Listings of refined parent fits ```{r listings-parent-refined, results = "asis", echo = FALSE, dependson = "parent_mhmkin_refined"} for (deg_mod in parent_deg_mods) { @@ -155,9 +295,20 @@ for (deg_mod in parent_deg_mods) { } ``` +## Listings of pathway fits + +```{r listings-path-1, results = "asis", echo = FALSE, dependson = "path-1-refined"} +tex_listing(path_1[["sforb_path", "const"]], + caption = "Hierarchical fit of SFORB-SFO2 with constant variance") +tex_listing(path_1[["sforb_path", "tc"]], + caption = "Hierarchical fit of SFORB-SFO2 with two-component error") +tex_listing(path_1_refined, + caption = "Refined hierarchical fit of SFORB-SFO2 with two-component error") +``` + ## Session info -```{r, echo = FALSE, cache = FALSE} +```{r echo = FALSE, cache = FALSE} parallel::stopCluster(cl) sessionInfo() ``` -- cgit v1.2.1 From 18a18ef46391c4b9fa3e5e1cb06937d90a83ba05 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 3 Jan 2023 17:31:47 +0100 Subject: Improve template text, use neutral name for dll_dir --- .../templates/hierarchical_kinetics/skeleton/skeleton.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index 9a975607..e26213f5 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -144,10 +144,10 @@ intervals are listed below. parms(parent_best, ci = TRUE) |> kable(digits = 3) ``` -As an example of the investigation of covariate influence on degradation -parameters, a covariate model is added to the hierarchical model for each of -the degradation parameters with well-defined random effects. Also, -a version with covariate models for both of them is fitted. +To investigate a potential covariate influence on degradation parameters, a +covariate model is added to the hierarchical model for each of the degradation +parameters with well-defined random effects. Also, a version with covariate +models for both of them is fitted. ```{r parent-best-pH} parent_best_pH_1 <- update(parent_best, covariates = covariates, @@ -188,14 +188,14 @@ parallel formation of two metabolites is set up. ```{r m_sforb_sfo2} -if (!dir.exists("lambda_dlls")) dir.create("lambda_dlls") +if (!dir.exists("dlls")) dir.create("dlls") m_sforb_sfo2 = mkinmod( lambda = mkinsub("SFORB", to = c("c_V", "c_XV")), c_V = mkinsub("SFO"), c_XV = mkinsub("SFO"), name = "sforb_sfo2", - dll_dir = "lambda_dlls", + dll_dir = "dlls", overwrite = TRUE, quiet = TRUE ) ``` -- cgit v1.2.1 From ae314cd8869765dd05f1ae44f4d73ae71f788c62 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 3 Jan 2023 17:42:15 +0100 Subject: Reflect changed name of dll directory in template --- .Rbuildignore | 1 + .gitignore | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 1eb33577..70eef830 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,6 +12,7 @@ ^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.pdf$ ^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_cache ^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_files +^inst/rmarkdown/templates/hierarchical_kinetics/skeleton/dlls ^vignettes/.build.timestamp$ ^vignettes/.*_cache$ ^vignettes/.*cache$ diff --git a/.gitignore b/.gitignore index 5416f8f0..a86197a1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ install.log inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_cache inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton_files inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.pdf -inst/rmarkdown/templates/hierarchical_kinetics/skeleton/*_dlls +inst/rmarkdown/templates/hierarchical_kinetics/skeleton/dlls mkin*.tar.gz mkin.tar mkin.Rcheck -- cgit v1.2.1 From fc692554ecdaff66548cc3e6d666e44b7aaaa9af Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 3 Jan 2023 17:52:39 +0100 Subject: Neutral names for code chunks in the template --- .../templates/hierarchical_kinetics/skeleton/skeleton.Rmd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index e26213f5..38a6bd20 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -186,8 +186,7 @@ parms(parent_best_pH_2, ci = TRUE) |> kable(digits = 3) As an example of a pathway fit, a model with SFORB for the parent compound and parallel formation of two metabolites is set up. - -```{r m_sforb_sfo2} +```{r path-1-degmod} if (!dir.exists("dlls")) dir.create("dlls") m_sforb_sfo2 = mkinmod( @@ -203,7 +202,7 @@ m_sforb_sfo2 = mkinmod( Separate evaluations of all datasets are performed with constant variance and using two-component error. -```{r path-sep, dependson = c("m_sforb_all", "ds")} +```{r path-1-sep, dependson = c("path-1-degmod", "ds")} sforb_sep_const <- mmkin(list(sforb_path = m_sforb_sfo2), ds, cluster = cl, quiet = TRUE) sforb_sep_tc <- update(sforb_sep_const, error_model = "tc") @@ -211,7 +210,7 @@ sforb_sep_tc <- update(sforb_sep_const, error_model = "tc") The separate fits with constant variance are plotted. -```{r dependson = "path-sep", fig.height = 9} +```{r dependson = "path-1-sep", fig.height = 9} plot(mixed(sforb_sep_const)) ``` @@ -219,7 +218,7 @@ The two corresponding hierarchical fits, with the random effects for the parent degradation parameters excluded as discussed above, and including the covariate model that was identified for the parent degradation, are attempted below. -```{r path-1, dependson = "path-sep"} +```{r path-1, dependson = "path-1-sep"} path_1 <- mhmkin(list(sforb_sep_const, sforb_sep_tc), no_random_effect = c("lambda_free_0", "log_k_lambda_free_bound"), covariates = covariates, covariate_models = list(log_k_lambda_bound_free ~ pH), -- cgit v1.2.1 From a583cd7e3eecef4c70ac09304495c765a84e76ce Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 4 Jan 2023 05:34:42 +0100 Subject: Update documentation of 'use_of_ff' argument --- R/mkinmod.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mkinmod.R b/R/mkinmod.R index d8740aed..47307ab7 100644 --- a/R/mkinmod.R +++ b/R/mkinmod.R @@ -26,7 +26,7 @@ #' Additionally, [mkinsub()] has an argument \code{to}, specifying names of #' variables to which a transfer is to be assumed in the model. #' If the argument \code{use_of_ff} is set to "min" -#' (default) and the model for the compartment is "SFO" or "SFORB", an +#' and the model for the compartment is "SFO" or "SFORB", an #' additional [mkinsub()] argument can be \code{sink = FALSE}, effectively #' fixing the flux to sink to zero. #' In print.mkinmod, this argument is currently not used. -- cgit v1.2.1 From a5903e74d9cf54c764d5bbc48e461cecd5f56e72 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 5 Jan 2023 15:03:06 +0100 Subject: Don't preschedule multistart runs Sometimes a lot of them fail, so we were wasting time --- R/multistart.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/multistart.R b/R/multistart.R index 61ef43dc..bdfbfe63 100644 --- a/R/multistart.R +++ b/R/multistart.R @@ -100,9 +100,12 @@ multistart.saem.mmkin <- function(object, n = 50, cores = 1, } if (is.null(cluster)) { - res <- parallel::mclapply(1:n, fit_function, mc.cores = cores) + res <- parallel::mclapply(1:n, fit_function, + mc.cores = cores, mc.preschedule = FALSE) } else { - res <- parallel::parLapply(cluster, 1:n, fit_function) + res <- parallel::parLapplyLB(cluster, 1:n, fit_function, + mc.preschedule = FALSE + ) } attr(res, "orig") <- object attr(res, "start_parms") <- start_parms -- cgit v1.2.1 From 24eb77216700cf8b2f2bde3abad84c1f83f9e32a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 9 Jan 2023 06:22:04 +0100 Subject: Prebuilt PDF vignettes, summary_listing --- .Rbuildignore | 2 + .gitignore | 4 + DESCRIPTION | 2 +- GNUmakefile | 7 +- NAMESPACE | 2 + R/hierarchical_kinetics.R | 2 +- R/summary_listing.R | 59 + R/tex_listing.R | 32 - README.md | 2 + _pkgdown.yml | 3 +- docs/dev/articles/2022_wp_1.1_dmta_parent.html | 2177 ++++++++++++++++++++ .../figure-html/convergence-saem-dfop-const-1.png | Bin 0 -> 128154 bytes .../figure-html/convergence-saem-dfop-tc-1.png | Bin 0 -> 109761 bytes .../convergence-saem-dfop-tc-no-ranef-k2-1.png | Bin 0 -> 123528 bytes .../figure-html/convergence-saem-fomc-const-1.png | Bin 0 -> 100169 bytes .../figure-html/convergence-saem-fomc-tc-1.png | Bin 0 -> 93007 bytes .../figure-html/convergence-saem-hs-const-1.png | Bin 0 -> 129829 bytes .../figure-html/convergence-saem-hs-tc-1.png | Bin 0 -> 98778 bytes .../figure-html/convergence-saem-sfo-const-1.png | Bin 0 -> 75641 bytes .../figure-html/convergence-saem-sfo-tc-1.png | Bin 0 -> 62897 bytes .../figure-html/multistart-full-par-1.png | Bin 0 -> 71232 bytes .../figure-html/multistart-reduced-par-1.png | Bin 0 -> 66297 bytes .../multistart-reduced-par-llquant-1.png | Bin 0 -> 58713 bytes .../plot-saem-dfop-tc-no-ranef-k2-1.png | Bin 0 -> 159042 bytes docs/dev/articles/index.html | 6 +- docs/dev/authors.html | 6 +- docs/dev/index.html | 24 +- docs/dev/news/index.html | 6 +- docs/dev/pkgdown.yml | 5 +- .../reference/example_analysis/dlls/sforb_sfo2.so | Bin 0 -> 17272 bytes .../example_analysis/example_analysis.Rmd | 314 +++ docs/dev/reference/example_analysis/header.tex | 1 + docs/dev/reference/example_analysis/skeleton.pdf | Bin 0 -> 351780 bytes .../figure-latex/unnamed-chunk-11-1.pdf | Bin 0 -> 30166 bytes .../figure-latex/unnamed-chunk-16-1.pdf | Bin 0 -> 30137 bytes .../figure-latex/unnamed-chunk-6-1.pdf | Bin 0 -> 16408 bytes .../figure-latex/unnamed-chunk-9-1.pdf | Bin 0 -> 16043 bytes docs/dev/reference/hierarchical_kinetics.html | 154 ++ docs/dev/reference/index.html | 10 +- docs/dev/reference/mkinmod.html | 10 +- docs/dev/reference/summary_listing.html | 147 ++ docs/dev/sitemap.xml | 9 + inst/testdata/cyantraniliprole_soil_efsa_2014.xlsx | Bin 0 -> 35878 bytes log/check.log | 34 +- man/hierarchical_kinetics.Rd | 2 +- man/mkinmod.Rd | 2 +- man/summary_listing.Rd | 27 + man/tex_listing.Rd | 21 - vignettes/FOCUS_D.html | 44 +- vignettes/FOCUS_L.html | 215 +- vignettes/dmta_parent_2022_prebuilt.rnw | 7 + vignettes/dmta_pathway_2022_prebuilt.rnw | 7 + vignettes/mkin.html | 310 ++- vignettes/prebuilt/2022_cyan_pathway.rmd | 536 +++++ vignettes/prebuilt/2022_dmta_parent.rmd | 406 ++++ vignettes/prebuilt/2022_dmta_pathway.rmd | 426 ++++ vignettes/prebuilt/references.bib | 187 ++ vignettes/references.bib | 34 +- vignettes/twa.html | 108 +- vignettes/web_only/FOCUS_Z.R | 115 ++ vignettes/web_only/FOCUS_Z.html | 278 ++- vignettes/web_only/benchmarks.R | 114 + vignettes/web_only/benchmarks.html | 193 +- vignettes/web_only/compiled_models.R | 65 + vignettes/web_only/compiled_models.html | 230 ++- vignettes/web_only/dimethenamid_2018.R | 152 ++ vignettes/web_only/dimethenamid_2018.html | 365 +++- .../figure-html/f_parent_mkin_dfop_const-1.png | Bin 58608 -> 57786 bytes .../f_parent_mkin_dfop_const_test-1.png | Bin 58777 -> 57786 bytes .../figure-html/f_parent_mkin_dfop_tc_test-1.png | Bin 60062 -> 59396 bytes .../figure-html/f_parent_mkin_sfo_const-1.png | Bin 56694 -> 55982 bytes .../figure-html/f_parent_saemix_sfo_tc-1.png | Bin 28655 -> 28538 bytes .../figure-html/plot_parent_nlme-1.png | Bin 59194 -> 59192 bytes vignettes/web_only/mkin_benchmarks.rda | Bin 1650 -> 1722 bytes 74 files changed, 6255 insertions(+), 607 deletions(-) create mode 100644 R/summary_listing.R delete mode 100644 R/tex_listing.R create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent.html create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-full-par-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png create mode 100644 docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png create mode 100755 docs/dev/reference/example_analysis/dlls/sforb_sfo2.so create mode 100644 docs/dev/reference/example_analysis/example_analysis.Rmd create mode 100644 docs/dev/reference/example_analysis/header.tex create mode 100644 docs/dev/reference/example_analysis/skeleton.pdf create mode 100644 docs/dev/reference/example_analysis/skeleton_files/figure-latex/unnamed-chunk-11-1.pdf create mode 100644 docs/dev/reference/example_analysis/skeleton_files/figure-latex/unnamed-chunk-16-1.pdf create mode 100644 docs/dev/reference/example_analysis/skeleton_files/figure-latex/unnamed-chunk-6-1.pdf create mode 100644 docs/dev/reference/example_analysis/skeleton_files/figure-latex/unnamed-chunk-9-1.pdf create mode 100644 docs/dev/reference/hierarchical_kinetics.html create mode 100644 docs/dev/reference/summary_listing.html create mode 100644 inst/testdata/cyantraniliprole_soil_efsa_2014.xlsx create mode 100644 man/summary_listing.Rd delete mode 100644 man/tex_listing.Rd create mode 100644 vignettes/dmta_parent_2022_prebuilt.rnw create mode 100644 vignettes/dmta_pathway_2022_prebuilt.rnw create mode 100644 vignettes/prebuilt/2022_cyan_pathway.rmd create mode 100644 vignettes/prebuilt/2022_dmta_parent.rmd create mode 100644 vignettes/prebuilt/2022_dmta_pathway.rmd create mode 100644 vignettes/prebuilt/references.bib create mode 100644 vignettes/web_only/FOCUS_Z.R create mode 100644 vignettes/web_only/benchmarks.R create mode 100644 vignettes/web_only/compiled_models.R create mode 100644 vignettes/web_only/dimethenamid_2018.R diff --git a/.Rbuildignore b/.Rbuildignore index 70eef830..7e13343b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,6 +28,8 @@ ^vignettes/.*.synctex.gz ^vignettes/.*.toc$ ^vignettes/figure +^vignettes/prebuilt/*_dlls +^vignettes/prebuilt/*.pdf ^vignettes/FOCUS_Z.tex$ ^vignettes/mkin.tex$ ^vignettes/mkin_benchmarks.rda$ diff --git a/.gitignore b/.gitignore index a86197a1..5bec45e6 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,7 @@ vignettes/cache/ vignettes/figure/ vignettes/*_cache/ vignettes/*_files/ +vignettes/prebuilt/*_cache +vignettes/prebuilt/*_files +vignettes/prebuilt/*_dlls +vignettes/prebuilt/*.pdf diff --git a/DESCRIPTION b/DESCRIPTION index d061a5a9..50dba006 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data Version: 1.2.2 -Date: 2023-01-03 +Date: 2023-01-08 Authors@R: c( person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "johannes.ranke@jrwb.de", diff --git a/GNUmakefile b/GNUmakefile index 4a33c538..9f268335 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,10 +37,6 @@ pkgfiles = \ all: build $(TGZ): $(pkgfiles) vignettes - $(RM) -r vignettes/*_cache - $(RM) -r vignettes/*_files - $(RM) -r vignettes/*.R - $(RM) -r vignettes/web_only/*.R $(RM) Rplots.pdf "$(RBIN)/R" CMD build . 2>&1 | tee log/build.log @@ -111,7 +107,8 @@ vignettes: vignettes/mkin.html vignettes/FOCUS_D.html vignettes/FOCUS_L.html vig vignettes/web_only/%.html: vignettes/references.bib vignettes/web_only/%.rmd "$(RBIN)/Rscript" -e "tools::buildVignette(file = 'vignettes/web_only/$*.rmd', dir = 'vignettes/web_only', keep=c('mkin_benchmarks.rda', 'saem_benchmarks.rda'))" -articles: vignettes/web_only/FOCUS_Z.html vignettes/web_only/compiled_models.html vignettes/web_only/benchmarks.html vignettes/web_only/dimethenamid_2018.html vignettes/web_only/multistart.html +vignettes/prebuilt/%.pdf: vignettes/prebuilt/references.bib vignettes/prebuilt/%.rmd + "$(RBIN)/Rscript" -e "rmarkdown::render('vignettes/prebuilt/$*.rmd')" pd: roxygen "$(RBIN)/Rscript" -e "pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)" diff --git a/NAMESPACE b/NAMESPACE index 84d6b713..b41bf614 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -97,6 +97,7 @@ export(endpoints) export(f_time_norm_focus) export(get_deg_func) export(hierarchical_kinetics) +export(html_listing) export(illparms) export(ilr) export(intervals) @@ -145,6 +146,7 @@ export(set_nd_nq) export(set_nd_nq_focus) export(sigma_twocomp) export(status) +export(summary_listing) export(tex_listing) export(transform_odeparms) export(which.best) diff --git a/R/hierarchical_kinetics.R b/R/hierarchical_kinetics.R index a90dd619..e545754a 100644 --- a/R/hierarchical_kinetics.R +++ b/R/hierarchical_kinetics.R @@ -13,7 +13,7 @@ #' #' \dontrun{ #' library(rmarkdown) -#' draft("New analysis.rmd", template = "hierarchical_kinetics", package = "mkin") +#' draft("example_analysis.rmd", template = "hierarchical_kinetics", package = "mkin") #' } #' #' @export diff --git a/R/summary_listing.R b/R/summary_listing.R new file mode 100644 index 00000000..38b52240 --- /dev/null +++ b/R/summary_listing.R @@ -0,0 +1,59 @@ +#' Display the output of a summary function according to the output format +#' +#' This function is intended for use in a R markdown code chunk with the chunk +#' option `results = "asis"`. +#' +#' @param object The object for which the summary is to be listed +#' @param caption An optional caption +#' @param label An optional label, ignored in html output +#' @param clearpage Should a new page be started after the listing? Ignored in html output +#' @export +summary_listing <- function(object, caption = NULL, label = NULL, + clearpage = TRUE) { + if (knitr::is_latex_output()) { + tex_listing(object = object, caption = caption, label = label, + clearpage = clearpage) + } + if (knitr::is_html_output()) { + html_listing(object = object, caption = caption) + } +} + +#' @rdname summary_listing +#' @export +tex_listing <- function(object, caption = NULL, label = NULL, + clearpage = TRUE) { + cat("\n") + cat("\\begin{listing}", "\n") + if (!is.null(caption)) { + cat("\\caption{", caption, "}", "\n", sep = "") + } + if (!is.null(label)) { + cat("\\caption{", label, "}", "\n", sep = "") + } + cat("\\begin{snugshade}", "\n") + cat("\\scriptsize", "\n") + cat("\\begin{verbatim}", "\n") + cat(capture.output(suppressWarnings(summary(object))), sep = "\n") + cat("\n") + cat("\\end{verbatim}", "\n") + cat("\\end{snugshade}", "\n") + cat("\\end{listing}", "\n") + if (clearpage) { + cat("\\clearpage", "\n") + } +} + +#' @rdname summary_listing +#' @export +html_listing <- function(object, caption = NULL) { + cat("\n") + if (!is.null(caption)) { + cat("", caption, "", "\n", sep = "") + } + cat("
    \n")
    +  cat(capture.output(suppressWarnings(summary(object))), sep = "\n")
    +  cat("\n")
    +  cat("
    \n") +} + diff --git a/R/tex_listing.R b/R/tex_listing.R deleted file mode 100644 index 05f662e4..00000000 --- a/R/tex_listing.R +++ /dev/null @@ -1,32 +0,0 @@ -#' Wrap the output of a summary function in tex listing environment -#' -#' This function can be used in a R markdown code chunk with the chunk -#' option `results = "asis"`. -#' -#' @param object The object for which the summary is to be listed -#' @param caption An optional caption -#' @param label An optional label -#' @param clearpage Should a new page be started after the listing? -#' @export -tex_listing <- function(object, caption = NULL, label = NULL, - clearpage = TRUE) { - cat("\n") - cat("\\begin{listing}", "\n") - if (!is.null(caption)) { - cat("\\caption{", caption, "}", "\n", sep = "") - } - if (!is.null(label)) { - cat("\\caption{", label, "}", "\n", sep = "") - } - cat("\\begin{snugshade}", "\n") - cat("\\scriptsize", "\n") - cat("\\begin{verbatim}", "\n") - cat(capture.output(suppressWarnings(summary(object))), sep = "\n") - cat("\n") - cat("\\end{verbatim}", "\n") - cat("\\end{snugshade}", "\n") - cat("\\end{listing}", "\n") - if (clearpage) { - cat("\\clearpage", "\n") - } -} diff --git a/README.md b/README.md index f3c36890..b6171767 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,8 @@ to ModelMaker 4.0, 2014-2015) of the visual fit in the kinetic evaluation of degradation data, 2019-2020) - Project Number 146839 (Checking the feasibility of using mixed-effects models for the derivation of kinetic modelling parameters from degradation studies, 2020-2021) +- Project Number 173340 (Application of nonlinear hierarchical models to the + kinetic evaluation of chemical degradation data) Thanks to everyone involved for collaboration and support! diff --git a/_pkgdown.yml b/_pkgdown.yml index ca5ea6e0..5d7fdbf4 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -47,6 +47,7 @@ reference: - title: Mixed models desc: Create and work with nonlinear hierarchical models contents: + - hierarchical_kinetics - read_spreadsheet - nlme.mmkin - saem.mmkin @@ -92,7 +93,7 @@ reference: - plot.nafta - title: Utility functions contents: - - tex_listing + - summary_listing - f_time_norm_focus - set_nd_nq - max_twa_parent diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent.html b/docs/dev/articles/2022_wp_1.1_dmta_parent.html new file mode 100644 index 00000000..61bb81d3 --- /dev/null +++ b/docs/dev/articles/2022_wp_1.1_dmta_parent.html @@ -0,0 +1,2177 @@ + + + + + + + +Work package 1.1: Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P • mkin + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Introduction +

    +

    The purpose of this document is to demonstrate how nonlinear +hierarchical models (NLHM) based on the parent degradation models SFO, +FOMC, DFOP and HS can be fitted with the mkin package.

    +

    The mkin package is used in version 1.2.2. It contains the test data +and the functions used in the evaluations. The saemix +package is used as a backend for fitting the NLHM, but is also loaded to +make the convergence plot function available.

    +

    This document is processed with the knitr package, which +also provides the kable function that is used to improve +the display of tabular data in R markdown documents. For parallel +processing, the parallel package is used.

    +
    +library(mkin)
    +library(knitr)
    +library(saemix)
    +library(parallel)
    +n_cores <- detectCores()
    +if (Sys.info()["sysname"] == "Windows") {
    +  cl <- makePSOCKcluster(n_cores)
    +} else {
    +  cl <- makeForkCluster(n_cores)
    +}
    +
    +

    Preprocessing of test data +

    +

    The test data are available in the mkin package as an object of class +mkindsg (mkin dataset group) under the identifier +dimethenamid_2018. The following preprocessing steps are +still necessary:

    +
      +
    • The data available for the enantiomer dimethenamid-P (DMTAP) are +renamed to have the same substance name as the data for the racemic +mixture dimethenamid (DMTA). The reason for this is that no difference +between their degradation behaviour was identified in the EU risk +assessment.
    • +
    • The data for transformation products and unnecessary columns are +discarded
    • +
    • The observation times of each dataset are multiplied with the +corresponding normalisation factor also available in the dataset, in +order to make it possible to describe all datasets with a single set of +parameters that are independent of temperature
    • +
    • Finally, datasets observed in the same soil (Elliot 1 +and Elliot 2) are combined, resulting in dimethenamid +(DMTA) data from six soils.
    • +
    +

    The following commented R code performs this preprocessing.

    +
    +# Apply a function to each of the seven datasets in the mkindsg object to create a list
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data                     # Get a dataset
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"              # Rename DMTAP to DMTA
    +  ds_i <- subset(ds_i, name == "DMTA", c("name", "time", "value")) # Select data
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]  # Normalise time
    +  ds_i                                                       # Return the dataset
    +})
    +
    +# Use dataset titles as names for the list elements
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +
    +# Combine data for Elliot soil to obtain a named list with six elements
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]]) #
    +dmta_ds[["Elliot 1"]] <- NULL
    +dmta_ds[["Elliot 2"]] <- NULL
    +

    The following tables show the 6 datasets.

    +
    +for (ds_name in names(dmta_ds)) {
    +    print(kable(mkin_long_to_wide(dmta_ds[[ds_name]]),
    +      caption = paste("Dataset", ds_name),
    +      label = paste0("tab:", ds_name), booktabs = TRUE))
    +    cat("\n\\clearpage\n")
    +}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Calke
    timeDMTA
    095.8
    098.7
    1460.5
    3039.1
    5915.2
    1204.8
    1204.6
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Borstel
    timeDMTA
    0.000000100.5
    0.00000099.6
    1.94129591.9
    1.94129591.3
    6.79453481.8
    6.79453482.1
    13.58906769.1
    13.58906768.0
    27.17813551.4
    27.17813551.4
    56.29756527.6
    56.29756526.8
    86.38764315.7
    86.38764315.3
    115.5070737.9
    115.5070738.1
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Flaach
    timeDMTA
    0.000000096.5
    0.000000096.8
    0.000000097.0
    0.623385682.9
    0.623385686.7
    0.623385687.4
    1.870156772.8
    1.870156769.9
    1.870156771.9
    4.363698951.4
    4.363698952.9
    4.363698948.6
    8.727397928.5
    8.727397927.3
    8.727397927.5
    13.091096814.8
    13.091096813.4
    13.091096814.4
    17.45479577.7
    17.45479577.3
    17.45479578.1
    26.18219362.0
    26.18219361.5
    26.18219361.9
    34.90959151.3
    34.90959151.0
    34.90959151.1
    43.63698930.9
    43.63698930.7
    43.63698930.7
    52.36438720.6
    52.36438720.4
    52.36438720.5
    74.80626740.4
    74.80626740.3
    74.80626740.3
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.2
    timeDMTA
    0.000000098.09
    0.000000098.77
    0.767892293.52
    0.767892292.03
    2.303676588.39
    2.303676587.18
    5.375245269.38
    5.375245271.06
    10.750490445.21
    10.750490446.81
    16.125735530.54
    16.125735530.07
    21.500980721.60
    21.500980720.41
    32.25147119.10
    32.25147119.70
    43.00196146.58
    43.00196146.31
    53.75245183.47
    53.75245183.52
    64.50294213.40
    64.50294213.67
    91.37916801.62
    91.37916801.62
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.3
    timeDMTA
    0.000000099.33
    0.000000097.44
    0.673393893.73
    0.673393893.77
    2.020181487.84
    2.020181489.82
    4.713756571.61
    4.713756571.42
    9.427513145.60
    9.427513145.42
    14.141269631.12
    14.141269631.68
    18.855026223.20
    18.855026224.13
    28.28253939.43
    28.28253939.82
    37.71005237.08
    37.71005238.64
    47.13756544.41
    47.13756544.78
    56.56507854.92
    56.56507855.08
    80.13386122.13
    80.13386122.23
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Elliot
    timeDMTA
    0.00000097.5
    0.000000100.7
    1.22847886.4
    1.22847888.5
    3.68543569.8
    3.68543577.1
    8.59934959.0
    8.59934954.2
    17.19869731.3
    17.19869733.5
    25.79804619.6
    25.79804620.9
    34.39739513.3
    34.39739515.8
    51.5960926.7
    51.5960928.7
    68.7947898.8
    68.7947898.7
    103.1921846.0
    103.1921844.4
    146.1889283.3
    146.1889282.8
    223.5830661.4
    223.5830661.8
    0.00000093.4
    0.000000103.2
    1.22847889.2
    1.22847886.6
    3.68543578.2
    3.68543578.1
    8.59934955.6
    8.59934953.0
    17.19869733.7
    17.19869733.2
    25.79804620.9
    25.79804619.9
    34.39739518.2
    34.39739512.7
    51.5960927.8
    51.5960929.0
    68.79478911.4
    68.7947899.0
    103.1921843.9
    103.1921844.4
    146.1889282.6
    146.1889283.4
    223.5830662.0
    223.5830661.7
    +
    +
    +
    +

    Separate evaluations +

    +

    In order to obtain suitable starting parameters for the NLHM fits, +separate fits of the four models to the data for each soil are generated +using the mmkin function from the mkin +package. In a first step, constant variance is assumed. Convergence is +checked with the status function.

    +
    +deg_mods <- c("SFO", "FOMC", "DFOP", "HS")
    +f_sep_const <- mmkin(
    +  deg_mods,
    +  dmta_ds,
    +  error_model = "const",
    +  quiet = TRUE)
    +
    +status(f_sep_const) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    SFOOKOKOKOKOKOK
    FOMCOKOKOKOKOKOK
    DFOPOKOKOKOKOKOK
    HSOKOKOKCOKOK
    +

    In the table above, OK indicates convergence, and C indicates failure +to converge. All separate fits with constant variance converged, with +the sole exception of the HS fit to the BBA 2.2 data. To prepare for +fitting NLHM using the two-component error model, the separate fits are +updated assuming two-component error.

    +
    +f_sep_tc <- update(f_sep_const, error_model = "tc")
    +status(f_sep_tc) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    SFOOKOKOKOKOKOK
    FOMCOKOKOKOKCOK
    DFOPOKOKCOKCOK
    HSOKCOKOKOKOK
    +

    Using the two-component error model, the one fit that did not +converge with constant variance did converge, but other non-SFO fits +failed to converge.

    +
    +
    +

    Hierarchichal model fits +

    +

    The following code fits eight versions of hierarchical models to the +data, using SFO, FOMC, DFOP and HS for the parent compound, and using +either constant variance or two-component error for the error model. The +default parameter distribution model in mkin allows for variation of all +degradation parameters across the assumed population of soils. In other +words, each degradation parameter is associated with a random effect as +a first step. The mhmkin function makes it possible to fit +all eight versions in parallel (given a sufficient number of computing +cores being available) to save execution time.

    +

    Convergence plots and summaries for these fits are shown in the +appendix.

    +
    +f_saem <- mhmkin(list(f_sep_const, f_sep_tc), transformations = "saemix")
    +

    The output of the status function shows that all fits +terminated successfully.

    +
    +status(f_saem) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOOKOK
    FOMCOKOK
    DFOPOKOK
    HSOKOK
    +

    The AIC and BIC values show that the biphasic models DFOP and HS give +the best fits.

    +
    +anova(f_saem) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    SFO const5796.3795.3-393.2
    SFO tc6798.3797.1-393.2
    FOMC const7734.2732.7-360.1
    FOMC tc8720.4718.8-352.2
    DFOP const9711.8710.0-346.9
    HS const9714.0712.1-348.0
    DFOP tc10665.5663.4-322.8
    HS tc10667.1665.0-323.6
    +

    The DFOP model is preferred here, as it has a better mechanistic +basis for batch experiments with constant incubation conditions. Also, +it shows the lowest AIC and BIC values in the first set of fits when +combined with the two-component error model. Therefore, the DFOP model +was selected for further refinements of the fits with the aim to make +the model fully identifiable.

    +
    +

    Parameter identifiability based on the Fisher Information +Matrix +

    +

    Using the illparms function, ill-defined statistical +model parameters such as standard deviations of the degradation +parameters in the population and error model parameters can be +found.

    +
    +illparms(f_saem) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOb.1
    FOMCsd(DMTA_0)
    DFOPsd(k2)sd(k2)
    HSsd(tb)
    +

    According to the illparms function, the fitted standard +deviation of the second kinetic rate constant k2 is +ill-defined in both DFOP fits. This suggests that different values would +be obtained for this standard deviation when using different starting +values.

    +

    The thus identified overparameterisation is addressed by removing the +random effect for k2 from the parameter model.

    +
    +f_saem_dfop_tc_no_ranef_k2 <- update(f_saem[["DFOP", "tc"]],
    +  no_random_effect = "k2")
    +

    For the resulting fit, it is checked whether there are still +ill-defined parameters,

    +
    +illparms(f_saem_dfop_tc_no_ranef_k2)
    +

    which is not the case. Below, the refined model is compared with the +previous best model. The model without random effect for k2 +is a reduced version of the previous model. Therefore, the models are +nested and can be compared using the likelihood ratio test. This is +achieved with the argument test = TRUE to the +anova function.

    +
    +anova(f_saem[["DFOP", "tc"]], f_saem_dfop_tc_no_ranef_k2, test = TRUE) |>
    +  kable(format.args = list(digits = 4))
    + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLikChisqDfPr(>Chisq)
    f_saem_dfop_tc_no_ranef_k29663.8661.9-322.9NANANA
    f_saem[[“DFOP”, “tc”]]10665.5663.4-322.80.280910.5961
    +

    The AIC and BIC criteria are lower after removal of the ill-defined +random effect for k2. The p value of the likelihood ratio +test is much greater than 0.05, indicating that the model with the +higher likelihood (here the model with random effects for all +degradation parameters f_saem[["DFOP", "tc"]]) does not fit +significantly better than the model with the lower likelihood (the +reduced model f_saem_dfop_tc_no_ranef_k2).

    +

    Therefore, AIC, BIC and likelihood ratio test suggest the use of the +reduced model.

    +

    The convergence of the fit is checked visually.

    +
    +Convergence plot for the NLHM DFOP fit with two-component error and without a random effect on 'k2'

    +Convergence plot for the NLHM DFOP fit with two-component error and +without a random effect on ‘k2’ +

    +
    +

    All parameters appear to have converged to a satisfactory degree. The +final fit is plotted using the plot method from the mkin package.

    +
    +plot(f_saem_dfop_tc_no_ranef_k2)
    +
    +Plot of the final NLHM DFOP fit

    +Plot of the final NLHM DFOP fit +

    +
    +

    Finally, a summary report of the fit is produced.

    +
    +summary(f_saem_dfop_tc_no_ranef_k2)
    +
    saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:13 2023 
    +Date of summary: Thu Jan  5 08:19:13 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 4.075 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +   DMTA_0        k1        k2         g 
    +98.759266  0.087034  0.009933  0.930827 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.76  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  663.8 661.9 -322.9
    +
    +Optimised parameters:
    +               est.     lower     upper
    +DMTA_0    98.228939 96.285869 100.17201
    +k1         0.064063  0.033477   0.09465
    +k2         0.008297  0.005824   0.01077
    +g          0.953821  0.914328   0.99331
    +a.1        1.068479  0.869538   1.26742
    +b.1        0.029424  0.022406   0.03644
    +SD.DMTA_0  2.030437  0.404824   3.65605
    +SD.k1      0.594692  0.256660   0.93272
    +SD.g       1.006754  0.361327   1.65218
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0218                
    +k2  0.0556  0.0355        
    +g  -0.0516 -0.0284 -0.2800
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 2.0304 0.4048 3.6560
    +SD.k1     0.5947 0.2567 0.9327
    +SD.g      1.0068 0.3613 1.6522
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.06848 0.86954 1.26742
    +b.1 0.02942 0.02241 0.03644
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.45 41.4    12.46   10.82   83.54
    +
    +
    +

    Alternative check of parameter identifiability +

    +

    The parameter check used in the illparms function is +based on a quadratic approximation of the likelihood surface near its +optimum, which is calculated using the Fisher Information Matrix (FIM). +An alternative way to check parameter identifiability based on a +multistart approach has recently been implemented in mkin.

    +

    The graph below shows boxplots of the parameters obtained in 50 runs +of the saem algorithm with different parameter combinations, sampled +from the range of the parameters obtained for the individual datasets +fitted separately using nonlinear regression.

    +
    +f_saem_dfop_tc_multi <- multistart(f_saem[["DFOP", "tc"]], n = 50, cores = 15)
    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_multi, lpos = "bottomright", ylim = c(0.3, 10), las = 2)
    +
    +Scaled parameters from the multistart runs, full model

    +Scaled parameters from the multistart runs, full model +

    +
    +

    The graph clearly confirms the lack of identifiability of the +variance of k2 in the full model. The overparameterisation +of the model also indicates a lack of identifiability of the variance of +parameter g.

    +

    The parameter boxplots of the multistart runs with the reduced model +shown below indicate that all runs give similar results, regardless of +the starting parameters.

    +
    +f_saem_dfop_tc_no_ranef_k2_multi <- multistart(f_saem_dfop_tc_no_ranef_k2,
    +  n = 50, cores = 15)
    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_no_ranef_k2_multi, ylim = c(0.5, 2), las = 2,
    +  lpos = "bottomright")
    +
    +Scaled parameters from the multistart runs, reduced model

    +Scaled parameters from the multistart runs, reduced model +

    +
    +

    When only the parameters of the top 25% of the fits are shown (based +on a feature introduced in mkin 1.2.2 currently under development), the +scatter is even less as shown below.

    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_no_ranef_k2_multi, ylim = c(0.5, 2), las = 2, llquant = 0.25,
    +  lpos = "bottomright")
    +
    +Scaled parameters from the multistart runs, reduced model, fits with the top 25\% likelihood values

    +Scaled parameters from the multistart runs, reduced model, fits with the +top 25% likelihood values +

    +
    +
    +
    +
    +

    Conclusions +

    +

    Fitting the four parent degradation models SFO, FOMC, DFOP and HS as +part of hierarchical model fits with two different error models and +normal distributions of the transformed degradation parameters works +without technical problems. The biphasic models DFOP and HS gave the +best fit to the data, but the default parameter distribution model was +not fully identifiable. Removing the random effect for the second +kinetic rate constant of the DFOP model resulted in a reduced model that +was fully identifiable and showed the lowest values for the model +selection criteria AIC and BIC. The reliability of the identification of +all model parameters was confirmed using multiple starting values.

    +
    +
    +

    Appendix +

    +
    +

    Hierarchical model fit listings +

    + +Hierarchical mkin fit of the SFO model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:06 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - k_DMTA * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 1.09 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    + DMTA_0  k_DMTA 
    +97.2953  0.0566 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k_DMTA
    +DMTA_0   97.3      0
    +k_DMTA    0.0      1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  796.3 795.3 -393.2
    +
    +Optimised parameters:
    +              est.    lower   upper
    +DMTA_0    97.28130 95.71113 98.8515
    +k_DMTA     0.05665  0.02909  0.0842
    +a.1        2.66442  2.35579  2.9731
    +SD.DMTA_0  1.54776  0.15447  2.9411
    +SD.k_DMTA  0.60690  0.26248  0.9513
    +
    +Correlation: 
    +       DMTA_0
    +k_DMTA 0.0168
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 1.5478 0.1545 2.9411
    +SD.k_DMTA 0.6069 0.2625 0.9513
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.664 2.356 2.973
    +
    +Estimated disappearance times:
    +      DT50  DT90
    +DMTA 12.24 40.65
    +
    +
    +

    + +Hierarchical mkin fit of the SFO model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:07 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - k_DMTA * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.441 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +  DMTA_0   k_DMTA 
    +96.99175  0.05603 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k_DMTA
    +DMTA_0  96.99      0
    +k_DMTA   0.00      1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  798.3 797.1 -393.2
    +
    +Optimised parameters:
    +               est.     lower    upper
    +DMTA_0    97.271822 95.703157 98.84049
    +k_DMTA     0.056638  0.029110  0.08417
    +a.1        2.660081  2.230398  3.08976
    +b.1        0.001665 -0.006911  0.01024
    +SD.DMTA_0  1.545520  0.145035  2.94601
    +SD.k_DMTA  0.606422  0.262274  0.95057
    +
    +Correlation: 
    +       DMTA_0
    +k_DMTA 0.0169
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 1.5455 0.1450 2.9460
    +SD.k_DMTA 0.6064 0.2623 0.9506
    +
    +Variance model:
    +        est.     lower   upper
    +a.1 2.660081  2.230398 3.08976
    +b.1 0.001665 -0.006911 0.01024
    +
    +Estimated disappearance times:
    +      DT50  DT90
    +DMTA 12.24 40.65
    +
    +
    +

    + +Hierarchical mkin fit of the FOMC model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:06 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - (alpha/beta) * 1/((time/beta) + 1) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 1.156 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    + DMTA_0   alpha    beta 
    + 98.292   9.909 156.341 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 alpha beta
    +DMTA_0  98.29     0    0
    +alpha    0.00     1    0
    +beta     0.00     0    1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  734.2 732.7 -360.1
    +
    +Optimised parameters:
    +              est.   lower   upper
    +DMTA_0     98.3435 96.9033  99.784
    +alpha       7.2007  2.5889  11.812
    +beta      112.8746 34.8816 190.868
    +a.1         2.0459  1.8054   2.286
    +SD.DMTA_0   1.4795  0.2717   2.687
    +SD.alpha    0.6396  0.1509   1.128
    +SD.beta     0.6874  0.1587   1.216
    +
    +Correlation: 
    +      DMTA_0  alpha  
    +alpha -0.1125        
    +beta  -0.1227  0.3632
    +
    +Random effects:
    +            est.  lower upper
    +SD.DMTA_0 1.4795 0.2717 2.687
    +SD.alpha  0.6396 0.1509 1.128
    +SD.beta   0.6874 0.1587 1.216
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.046 1.805 2.286
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back
    +DMTA 11.41 42.53     12.8
    +
    +
    +

    + +Hierarchical mkin fit of the FOMC model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:07 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - (alpha/beta) * 1/((time/beta) + 1) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.729 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +DMTA_0  alpha   beta 
    +98.772  4.663 92.597 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 alpha beta
    +DMTA_0  98.77     0    0
    +alpha    0.00     1    0
    +beta     0.00     0    1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  720.4 718.8 -352.2
    +
    +Optimised parameters:
    +              est.    lower     upper
    +DMTA_0    98.99136 97.26011 100.72261
    +alpha      5.86312  2.57485   9.15138
    +beta      88.55571 29.20889 147.90254
    +a.1        1.51063  1.24384   1.77741
    +b.1        0.02824  0.02040   0.03609
    +SD.DMTA_0  1.57436 -0.04867   3.19739
    +SD.alpha   0.59871  0.17132   1.02611
    +SD.beta    0.72994  0.22849   1.23139
    +
    +Correlation: 
    +      DMTA_0  alpha  
    +alpha -0.1363        
    +beta  -0.1414  0.2542
    +
    +Random effects:
    +            est.    lower upper
    +SD.DMTA_0 1.5744 -0.04867 3.197
    +SD.alpha  0.5987  0.17132 1.026
    +SD.beta   0.7299  0.22849 1.231
    +
    +Variance model:
    +       est.  lower   upper
    +a.1 1.51063 1.2438 1.77741
    +b.1 0.02824 0.0204 0.03609
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back
    +DMTA 11.11 42.6    12.82
    +
    +
    +

    + +Hierarchical mkin fit of the DFOP model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:07 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.007 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2        g 
    +98.64383  0.09211  0.02999  0.76814 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.64  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC BIC logLik
    +  711.8 710 -346.9
    +
    +Optimised parameters:
    +               est.     lower    upper
    +DMTA_0    98.092481 96.573898 99.61106
    +k1         0.062499  0.030336  0.09466
    +k2         0.009065 -0.005133  0.02326
    +g          0.948967  0.862079  1.03586
    +a.1        1.821671  1.604774  2.03857
    +SD.DMTA_0  1.677785  0.472066  2.88350
    +SD.k1      0.634962  0.270788  0.99914
    +SD.k2      1.033498 -0.205994  2.27299
    +SD.g       1.710046  0.428642  2.99145
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0246                
    +k2  0.0491  0.0953        
    +g  -0.0552 -0.0889 -0.4795
    +
    +Random effects:
    +           est.   lower  upper
    +SD.DMTA_0 1.678  0.4721 2.8835
    +SD.k1     0.635  0.2708 0.9991
    +SD.k2     1.033 -0.2060 2.2730
    +SD.g      1.710  0.4286 2.9914
    +
    +Variance model:
    +     est. lower upper
    +a.1 1.822 1.605 2.039
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.79 42.8    12.88   11.09   76.46
    +
    +
    +

    + +Hierarchical mkin fit of the DFOP model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:08 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 3.033 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +   DMTA_0        k1        k2         g 
    +98.759266  0.087034  0.009933  0.930827 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.76  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  665.5 663.4 -322.8
    +
    +Optimised parameters:
    +               est.     lower     upper
    +DMTA_0    98.377019 96.447952 100.30609
    +k1         0.064843  0.034607   0.09508
    +k2         0.008895  0.006368   0.01142
    +g          0.949696  0.903815   0.99558
    +a.1        1.065241  0.865754   1.26473
    +b.1        0.029340  0.022336   0.03634
    +SD.DMTA_0  2.007754  0.387982   3.62753
    +SD.k1      0.580473  0.250286   0.91066
    +SD.k2      0.006105 -4.920337   4.93255
    +SD.g       1.097149  0.412779   1.78152
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0235                
    +k2  0.0595  0.0424        
    +g  -0.0470 -0.0278 -0.2731
    +
    +Random effects:
    +              est.   lower  upper
    +SD.DMTA_0 2.007754  0.3880 3.6275
    +SD.k1     0.580473  0.2503 0.9107
    +SD.k2     0.006105 -4.9203 4.9325
    +SD.g      1.097149  0.4128 1.7815
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.06524 0.86575 1.26473
    +b.1 0.02934 0.02234 0.03634
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.36 41.32    12.44   10.69   77.92
    +
    +
    +

    + +Hierarchical mkin fit of the HS model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:07 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - ifelse(time <= tb, k1, k2) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.004 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2       tb 
    +97.82176  0.06931  0.02997 11.13945 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 tb
    +DMTA_0  97.82  0  0  0
    +k1       0.00  1  0  0
    +k2       0.00  0  1  0
    +tb       0.00  0  0  1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +  AIC   BIC logLik
    +  714 712.1   -348
    +
    +Optimised parameters:
    +              est.    lower    upper
    +DMTA_0    98.16102 96.47747 99.84456
    +k1         0.07876  0.05261  0.10491
    +k2         0.02227  0.01706  0.02747
    +tb        13.99089 -7.40049 35.38228
    +a.1        1.82305  1.60700  2.03910
    +SD.DMTA_0  1.88413  0.56204  3.20622
    +SD.k1      0.34292  0.10482  0.58102
    +SD.k2      0.19851  0.01718  0.37985
    +SD.tb      1.68168  0.58064  2.78272
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0142                
    +k2  0.0001 -0.0025        
    +tb  0.0165 -0.1256 -0.0301
    +
    +Random effects:
    +            est.   lower  upper
    +SD.DMTA_0 1.8841 0.56204 3.2062
    +SD.k1     0.3429 0.10482 0.5810
    +SD.k2     0.1985 0.01718 0.3798
    +SD.tb     1.6817 0.58064 2.7827
    +
    +Variance model:
    +     est. lower upper
    +a.1 1.823 1.607 2.039
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 8.801 67.91    20.44   8.801   31.13
    +
    +
    +

    + +Hierarchical mkin fit of the HS model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Thu Jan  5 08:19:08 2023 
    +Date of summary: Thu Jan  5 08:20:11 2023 
    +
    +Equations:
    +d_DMTA/dt = - ifelse(time <= tb, k1, k2) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 3.287 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2       tb 
    +98.45190  0.07525  0.02576 19.19375 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 tb
    +DMTA_0  98.45  0  0  0
    +k1       0.00  1  0  0
    +k2       0.00  0  1  0
    +tb       0.00  0  0  1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC BIC logLik
    +  667.1 665 -323.6
    +
    +Optimised parameters:
    +              est.    lower    upper
    +DMTA_0    97.76570 95.81350 99.71791
    +k1         0.05855  0.03080  0.08630
    +k2         0.02337  0.01664  0.03010
    +tb        31.09638 29.38289 32.80987
    +a.1        1.08835  0.88590  1.29080
    +b.1        0.02964  0.02257  0.03671
    +SD.DMTA_0  2.04877  0.42607  3.67147
    +SD.k1      0.59166  0.25621  0.92711
    +SD.k2      0.30698  0.09561  0.51835
    +SD.tb      0.01274 -0.10914  0.13462
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0160                
    +k2 -0.0070 -0.0024        
    +tb -0.0668 -0.0103 -0.2013
    +
    +Random effects:
    +             est.    lower  upper
    +SD.DMTA_0 2.04877  0.42607 3.6715
    +SD.k1     0.59166  0.25621 0.9271
    +SD.k2     0.30698  0.09561 0.5183
    +SD.tb     0.01274 -0.10914 0.1346
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.08835 0.88590 1.29080
    +b.1 0.02964 0.02257 0.03671
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.84 51.71    15.57   11.84   29.66
    +
    +
    +

    +
    +
    +

    Hierarchical model convergence plots +

    +
    +Convergence plot for the NLHM SFO fit with constant variance

    +Convergence plot for the NLHM SFO fit with constant variance +

    +
    +
    +Convergence plot for the NLHM SFO fit with two-component error

    +Convergence plot for the NLHM SFO fit with two-component error +

    +
    +
    +Convergence plot for the NLHM FOMC fit with constant variance

    +Convergence plot for the NLHM FOMC fit with constant variance +

    +
    +
    +Convergence plot for the NLHM FOMC fit with two-component error

    +Convergence plot for the NLHM FOMC fit with two-component error +

    +
    +
    +Convergence plot for the NLHM DFOP fit with constant variance

    +Convergence plot for the NLHM DFOP fit with constant variance +

    +
    +
    +Convergence plot for the NLHM DFOP fit with two-component error

    +Convergence plot for the NLHM DFOP fit with two-component error +

    +
    +
    +Convergence plot for the NLHM HS fit with constant variance

    +Convergence plot for the NLHM HS fit with constant variance +

    +
    +
    +Convergence plot for the NLHM HS fit with two-component error

    +Convergence plot for the NLHM HS fit with two-component error +

    +
    +
    +
    +

    Session info +

    +
    R version 4.2.2 Patched (2022-11-10 r83330)
    +Platform: x86_64-pc-linux-gnu (64-bit)
    +Running under: Debian GNU/Linux bookworm/sid
    +
    +Matrix products: default
    +BLAS:   /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
    +LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/libopenblas-r0.3.21.so
    +
    +locale:
    + [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
    + [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
    + [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
    + [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
    + [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    +[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       
    +
    +attached base packages:
    +[1] parallel  stats     graphics  grDevices utils     datasets  methods  
    +[8] base     
    +
    +other attached packages:
    +[1] saemix_3.2 npde_3.3   knitr_1.41 mkin_1.2.2
    +
    +loaded via a namespace (and not attached):
    + [1] deSolve_1.34      zoo_1.8-11        tidyselect_1.2.0  xfun_0.35        
    + [5] bslib_0.4.2       purrr_1.0.0       lattice_0.20-45   colorspace_2.0-3 
    + [9] vctrs_0.5.1       generics_0.1.3    htmltools_0.5.4   yaml_2.3.6       
    +[13] utf8_1.2.2        rlang_1.0.6       pkgdown_2.0.7     jquerylib_0.1.4  
    +[17] pillar_1.8.1      glue_1.6.2        DBI_1.1.3         lifecycle_1.0.3  
    +[21] stringr_1.5.0     munsell_0.5.0     gtable_0.3.1      ragg_1.2.4       
    +[25] codetools_0.2-18  memoise_2.0.1     evaluate_0.19     fastmap_1.1.0    
    +[29] lmtest_0.9-40     fansi_1.0.3       highr_0.9         scales_1.2.1     
    +[33] cachem_1.0.6      desc_1.4.2        jsonlite_1.8.4    systemfonts_1.0.4
    +[37] fs_1.5.2          textshaping_0.3.6 gridExtra_2.3     ggplot2_3.4.0    
    +[41] digest_0.6.31     stringi_1.7.8     dplyr_1.0.10      grid_4.2.2       
    +[45] rprojroot_2.0.3   cli_3.5.0         tools_4.2.2       magrittr_2.0.3   
    +[49] sass_0.4.4        tibble_3.1.8      pkgconfig_2.0.3   assertthat_0.2.1 
    +[53] rmarkdown_2.19    R6_2.5.1          mclust_6.0.0      nlme_3.1-161     
    +[57] compiler_4.2.2   
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png new file mode 100644 index 00000000..4f87b956 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png new file mode 100644 index 00000000..58825300 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png new file mode 100644 index 00000000..17defde1 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png new file mode 100644 index 00000000..b802acc6 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png new file mode 100644 index 00000000..2d6427d5 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png new file mode 100644 index 00000000..f15137d0 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png new file mode 100644 index 00000000..322668f0 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png new file mode 100644 index 00000000..4ceb281f Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png new file mode 100644 index 00000000..07383871 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-full-par-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-full-par-1.png new file mode 100644 index 00000000..cf4b058e Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-full-par-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-1.png new file mode 100644 index 00000000..d9ed8685 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png new file mode 100644 index 00000000..45dd7eb4 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png differ diff --git a/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png new file mode 100644 index 00000000..5a3bd434 Binary files /dev/null and b/docs/dev/articles/2022_wp_1.1_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png differ diff --git a/docs/dev/articles/index.html b/docs/dev/articles/index.html index e04302ef..cd0e315f 100644 --- a/docs/dev/articles/index.html +++ b/docs/dev/articles/index.html @@ -90,7 +90,9 @@

    All vignettes

    -
    Example evaluation of FOCUS Example Dataset D
    +
    Work package 1.1: Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P
    +
    +
    Example evaluation of FOCUS Example Dataset D
    Example evaluation of FOCUS Laboratory Data L1 to L3
    @@ -122,7 +124,7 @@
    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/dev/authors.html b/docs/dev/authors.html index bd58bc3d..165e2400 100644 --- a/docs/dev/authors.html +++ b/docs/dev/authors.html @@ -113,14 +113,14 @@ -

    Ranke J (2022). +

    Ranke J (2023). mkin: Kinetic Evaluation of Chemical Degradation Data. R package version 1.2.2, https://pkgdown.jrwb.de/mkin/.

    @Manual{,
       title = {mkin: Kinetic Evaluation of Chemical Degradation Data},
       author = {Johannes Ranke},
    -  year = {2022},
    +  year = {2023},
       note = {R package version 1.2.2},
       url = {https://pkgdown.jrwb.de/mkin/},
     }
    @@ -136,7 +136,7 @@ R package version 1.2.2, https://pkgdown
    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/dev/index.html b/docs/dev/index.html index 4723879e..993b8eea 100644 --- a/docs/dev/index.html +++ b/docs/dev/index.html @@ -19,11 +19,11 @@ equation models are solved using automatically generated C functions. Heteroscedasticity can be taken into account using variance by variable or two-component error models as described by Ranke and Meinecke (2018) - <doi:10.3390/environments6120124>. Interfaces to several nonlinear - mixed-effects model packages are available, some of which are described by - Ranke et al. (2021) <doi:10.3390/environments8080071>. Please note that no - warranty is implied for correctness of results or fitness for a particular - purpose."> + <doi:10.3390/environments6120124>. Hierarchical degradation models can + be fitted using nonlinear mixed-effects model packages as a backend as + described by Ranke et al. (2021) <doi:10.3390/environments8080071>. Please + note that no warranty is implied for correctness of results or fitness for a + particular purpose."> Hierarchical kinetics template — hierarchical_kinetics • mkin + + +
    +
    + + + +
    +
    + + +
    +

    R markdown format for setting up hierarchical kinetics based on a template +provided with the mkin package.

    +
    + +
    +
    hierarchical_kinetics(..., keep_tex = FALSE)
    +
    + +
    +

    Arguments

    +
    ...
    +

    Arguments to rmarkdown::pdf_document

    + + +
    keep_tex
    +

    Keep the intermediate tex file used in the conversion to PDF

    + +
    +
    +

    Value

    + + +

    R Markdown output format to pass to +render

    + + +
    + +
    +

    Examples

    +
    
    +# \dontrun{
    +library(rmarkdown)
    +draft("example_analysis.rmd", template = "hierarchical_kinetics", package = "mkin")
    +# }
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/dev/reference/index.html b/docs/dev/reference/index.html index 794126cf..525551fd 100644 --- a/docs/dev/reference/index.html +++ b/docs/dev/reference/index.html @@ -195,6 +195,10 @@ of an mmkin object

    Create and work with nonlinear hierarchical models

    +

    hierarchical_kinetics()

    + +

    Hierarchical kinetics template

    +

    read_spreadsheet()

    Read datasets and relevant meta information from a spreadsheet file

    @@ -356,9 +360,9 @@ degradation models and one or more error models

    -

    tex_listing()

    +

    summary_listing() tex_listing() html_listing()

    -

    Wrap the output of a summary function in tex listing environment

    +

    Display the output of a summary function according to the output format

    f_time_norm_focus()

    @@ -493,7 +497,7 @@ kinetic models fitted with mkinfit

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html index 251215a7..145dee83 100644 --- a/docs/dev/reference/mkinmod.html +++ b/docs/dev/reference/mkinmod.html @@ -132,7 +132,7 @@ the source compartment. Additionally, mkinsub() has an argument to, specifying names of variables to which a transfer is to be assumed in the model. If the argument use_of_ff is set to "min" -(default) and the model for the compartment is "SFO" or "SFORB", an +and the model for the compartment is "SFO" or "SFORB", an additional mkinsub() argument can be sink = FALSE, effectively fixing the flux to sink to zero. In print.mkinmod, this argument is currently not used.

    @@ -247,7 +247,7 @@ in the FOCUS and NAFTA guidance documents are used.

    For kinetic models with more than one observed variable, a symbolic solution of the system of differential equations is included in the resulting mkinmod object in some cases, speeding up the solution.

    -

    If a C compiler is found by pkgbuild::has_compiler() and there +

    If a C compiler is found by pkgbuild::has_compiler() and there is more than one observed variable in the specification, C code is generated for evaluating the differential equations, compiled using inline::cfunction() and added to the resulting mkinmod object.

    @@ -310,7 +310,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

    parent = mkinsub("SFO", "m1", full_name = "Test compound"), m1 = mkinsub("SFO", full_name = "Metabolite M1"), name = "SFO_SFO", dll_dir = DLL_dir, unload = TRUE, overwrite = TRUE) -#> Copied DLL from /tmp/RtmpbZbZ8Y/file8c6a9f402f42.so to /home/jranke/.local/share/mkin/SFO_SFO.so +#> Copied DLL from /tmp/RtmpelWAOB/fileb43c31a25a86.so to /home/jranke/.local/share/mkin/SFO_SFO.so # Now we can save the model and restore it in a new session saveRDS(SFO_SFO.2, file = "~/SFO_SFO.rds") # Terminate the R session here if you would like to check, and then do @@ -363,7 +363,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

    #> }) #> return(predicted) #> } -#> <environment: 0x55556029f678> +#> <environment: 0x55555f013820> # If we have several parallel metabolites # (compare tests/testthat/test_synthetic_data_for_UBA_2014.R) @@ -392,7 +392,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/dev/reference/summary_listing.html b/docs/dev/reference/summary_listing.html new file mode 100644 index 00000000..876412cc --- /dev/null +++ b/docs/dev/reference/summary_listing.html @@ -0,0 +1,147 @@ + +Display the output of a summary function according to the output format — summary_listing • mkin + + +
    +
    + + + +
    +
    + + +
    +

    This function is intended for use in a R markdown code chunk with the chunk +option results = "asis".

    +
    + +
    +
    summary_listing(object, caption = NULL, label = NULL, clearpage = TRUE)
    +
    +tex_listing(object, caption = NULL, label = NULL, clearpage = TRUE)
    +
    +html_listing(object, caption = NULL)
    +
    + +
    +

    Arguments

    +
    object
    +

    The object for which the summary is to be listed

    + + +
    caption
    +

    An optional caption

    + + +
    label
    +

    An optional label, ignored in html output

    + + +
    clearpage
    +

    Should a new page be started after the listing? Ignored in html output

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/dev/sitemap.xml b/docs/dev/sitemap.xml index 06f56c5d..6e51371c 100644 --- a/docs/dev/sitemap.xml +++ b/docs/dev/sitemap.xml @@ -3,6 +3,9 @@ https://pkgdown.jrwb.de/mkin/404.html + + https://pkgdown.jrwb.de/mkin/articles/2022_wp_1.1_dmta_parent.html + https://pkgdown.jrwb.de/mkin/articles/FOCUS_D.html @@ -138,6 +141,9 @@ https://pkgdown.jrwb.de/mkin/reference/get_deg_func.html + + https://pkgdown.jrwb.de/mkin/reference/hierarchical_kinetics.html + https://pkgdown.jrwb.de/mkin/reference/illparms.html @@ -306,6 +312,9 @@ https://pkgdown.jrwb.de/mkin/reference/summary.saem.mmkin.html + + https://pkgdown.jrwb.de/mkin/reference/summary_listing.html + https://pkgdown.jrwb.de/mkin/reference/synthetic_data_for_UBA_2014.html diff --git a/inst/testdata/cyantraniliprole_soil_efsa_2014.xlsx b/inst/testdata/cyantraniliprole_soil_efsa_2014.xlsx new file mode 100644 index 00000000..3252fdf1 Binary files /dev/null and b/inst/testdata/cyantraniliprole_soil_efsa_2014.xlsx differ diff --git a/log/check.log b/log/check.log index aec61e33..a81475d9 100644 --- a/log/check.log +++ b/log/check.log @@ -7,11 +7,28 @@ * checking extension type ... Package * this is package ‘mkin’ version ‘1.2.2’ * package encoding: UTF-8 -* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers +* checking CRAN incoming feasibility ... NOTE Maintainer: ‘Johannes Ranke ’ + +Size of tarball: 6636884 bytes * checking package namespace information ... OK * checking package dependencies ... OK -* checking if this is a source package ... OK +* checking if this is a source package ... NOTE +Found the following apparent object files/libraries: + vignettes/2022_wp_1/cyan_dlls/dfop_path_1.so + vignettes/2022_wp_1/cyan_dlls/dfop_path_2.so + vignettes/2022_wp_1/cyan_dlls/fomc_path_1.so + vignettes/2022_wp_1/cyan_dlls/fomc_path_2.so + vignettes/2022_wp_1/cyan_dlls/hs_path_1.so + vignettes/2022_wp_1/cyan_dlls/sfo_path_1.so + vignettes/2022_wp_1/cyan_dlls/sforb_path_1.so + vignettes/2022_wp_1/cyan_dlls/sforb_path_2.so + vignettes/2022_wp_1/dmta_dlls/m_dfop_path.so + vignettes/2022_wp_1/dmta_dlls/m_fomc_path.so + vignettes/2022_wp_1/dmta_dlls/m_hs_path.so + vignettes/2022_wp_1/dmta_dlls/m_sfo_path.so + vignettes/2022_wp_1/dmta_dlls/m_sforb_path.so +Object files/libraries should not be included in a source package. * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK @@ -41,14 +58,7 @@ Maintainer: ‘Johannes Ranke ’ * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK -* checking R code for possible problems ... NOTE -parplot.multistart.saem.mmkin: no visible global function definition - for ‘quantile’ -Undefined global functions or variables: - quantile -Consider adding - importFrom("stats", "quantile") -to your NAMESPACE file. +* checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -64,7 +74,7 @@ to your NAMESPACE file. * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... [11s/11s] OK +* checking examples ... [10s/10s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK @@ -76,7 +86,7 @@ to your NAMESPACE file. * checking for detritus in the temp directory ... OK * DONE -Status: 1 NOTE +Status: 2 NOTEs See ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ for details. diff --git a/man/hierarchical_kinetics.Rd b/man/hierarchical_kinetics.Rd index 4bb82a4c..2a8e211c 100644 --- a/man/hierarchical_kinetics.Rd +++ b/man/hierarchical_kinetics.Rd @@ -23,7 +23,7 @@ provided with the mkin package. \dontrun{ library(rmarkdown) -draft("New analysis.rmd", template = "hierarchical_kinetics", package = "mkin") +draft("example_analysis.rmd", template = "hierarchical_kinetics", package = "mkin") } } diff --git a/man/mkinmod.Rd b/man/mkinmod.Rd index 87ce9016..65b5de1a 100644 --- a/man/mkinmod.Rd +++ b/man/mkinmod.Rd @@ -33,7 +33,7 @@ the source compartment. Additionally, \code{\link[=mkinsub]{mkinsub()}} has an argument \code{to}, specifying names of variables to which a transfer is to be assumed in the model. If the argument \code{use_of_ff} is set to "min" -(default) and the model for the compartment is "SFO" or "SFORB", an +and the model for the compartment is "SFO" or "SFORB", an additional \code{\link[=mkinsub]{mkinsub()}} argument can be \code{sink = FALSE}, effectively fixing the flux to sink to zero. In print.mkinmod, this argument is currently not used.} diff --git a/man/summary_listing.Rd b/man/summary_listing.Rd new file mode 100644 index 00000000..995ebd8d --- /dev/null +++ b/man/summary_listing.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/summary_listing.R +\name{summary_listing} +\alias{summary_listing} +\alias{tex_listing} +\alias{html_listing} +\title{Display the output of a summary function according to the output format} +\usage{ +summary_listing(object, caption = NULL, label = NULL, clearpage = TRUE) + +tex_listing(object, caption = NULL, label = NULL, clearpage = TRUE) + +html_listing(object, caption = NULL) +} +\arguments{ +\item{object}{The object for which the summary is to be listed} + +\item{caption}{An optional caption} + +\item{label}{An optional label, ignored in html output} + +\item{clearpage}{Should a new page be started after the listing? Ignored in html output} +} +\description{ +This function is intended for use in a R markdown code chunk with the chunk +option \code{results = "asis"}. +} diff --git a/man/tex_listing.Rd b/man/tex_listing.Rd deleted file mode 100644 index 2f11d211..00000000 --- a/man/tex_listing.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/tex_listing.R -\name{tex_listing} -\alias{tex_listing} -\title{Wrap the output of a summary function in tex listing environment} -\usage{ -tex_listing(object, caption = NULL, label = NULL, clearpage = TRUE) -} -\arguments{ -\item{object}{The object for which the summary is to be listed} - -\item{caption}{An optional caption} - -\item{label}{An optional label} - -\item{clearpage}{Should a new page be started after the listing?} -} -\description{ -This function can be used in a R markdown code chunk with the chunk -option \code{results = "asis"}. -} diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index b8a63a7b..c729e3c2 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -31,7 +31,7 @@ document.addEventListener('DOMContentLoaded', function(e) { !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 - - - - + + @@ -1874,6 +1947,9 @@ $(document).ready(function () { - + - + - + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + + + @@ -1711,6 +1748,9 @@ $(document).ready(function () { - + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Introduction +

    +

    The purpose of this document is to test demonstrate how nonlinear +hierarchical models (NLHM) based on the parent degradation models SFO, +FOMC, DFOP and HS, with serial formation of two or more metabolites can +be fitted with the mkin package.

    +

    It was assembled in the course of work package 1.2 of Project Number +173340 (Application of nonlinear hierarchical models to the kinetic +evaluation of chemical degradation data) of the German Environment +Agency carried out in 2022 and 2023.

    +

    The mkin package is used in version 1.2.2 which is currently under +development. The newly introduced functionality that is used here is a +simplification of excluding random effects for a set of fits based on a +related set of fits with a reduced model, and the documentation of the +starting parameters of the fit, so that all starting parameters of +saem fits are now listed in the summary. The +saemix package is used as a backend for fitting the NLHM, +but is also loaded to make the convergence plot function available.

    +

    This document is processed with the knitr package, which +also provides the kable function that is used to improve +the display of tabular data in R markdown documents. For parallel +processing, the parallel package is used.

    +
    +library(mkin)
    +library(knitr)
    +library(saemix)
    +library(parallel)
    +n_cores <- detectCores()
    +if (Sys.info()["sysname"] == "Windows") {
    +  cl <- makePSOCKcluster(n_cores)
    +} else {
    +  cl <- makeForkCluster(n_cores)
    +}
    +
    +

    Test data +

    +

    The example data are taken from the final addendum to the DAR from +2014 and are distributed with the mkin package. Residue data and time +step normalisation factors are read in using the function +read_spreadsheet from the mkin package. This function also +performs the time step normalisation.

    +
    +data_file <- system.file(
    +  "testdata", "cyantraniliprole_soil_efsa_2014.xlsx",
    +  package = "mkin")
    +cyan_ds <- read_spreadsheet(data_file, parent_only = FALSE)
    +

    The following tables show the covariate data and the 5 datasets that +were read in from the spreadsheet file.

    +
    +pH <- attr(cyan_ds, "covariates")
    +kable(pH, caption = "Covariate data")
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Covariate data
    pH
    Nambsheim7.90
    Tama6.20
    Gross-Umstadt7.04
    Sassafras4.62
    Lleida8.05
    +
    +for (ds_name in names(cyan_ds)) {
    +  print(
    +    kable(mkin_long_to_wide(cyan_ds[[ds_name]]),
    +      caption = paste("Dataset", ds_name),
    +      booktabs = TRUE, row.names = FALSE))
    +    cat("\n\\clearpage\n")
    +}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Nambsheim
    timecyanJCZ38J9C38JSE76J9Z38
    0.000000105.79NANANANA
    3.21042477.267.9211.945.589.12
    7.49098857.1315.4616.5812.5911.74
    17.12225937.7415.9813.3626.0510.77
    23.54310531.476.0514.4934.714.96
    43.87578816.746.077.5740.386.52
    67.4188938.8510.346.3930.718.90
    107.0141165.199.611.9520.4112.93
    129.4870803.456.181.3621.786.99
    195.8358322.159.130.9516.297.69
    254.6935961.926.920.2013.577.16
    321.0423482.267.02NA11.128.66
    383.110535NA5.05NA10.645.56
    0.000000105.57NANANANA
    3.21042478.8812.7711.945.479.12
    7.49098859.9415.2716.5813.6011.74
    17.12225939.6714.2613.3629.4410.77
    23.54310530.2116.0714.4935.904.96
    43.87578818.069.447.5742.306.52
    67.4188938.545.786.3934.708.90
    107.0141167.264.541.9523.3312.93
    129.4870803.604.221.3623.566.99
    195.8358322.843.050.9516.217.69
    254.6935962.002.900.2015.537.16
    321.0423481.790.94NA9.808.66
    383.110535NA1.82NA9.495.56
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Tama
    timecyanJCZ38J9Z38JSE76
    0.000000106.14NANANA
    2.40083393.476.462.85NA
    5.60194388.3910.864.653.85
    12.80444272.2911.974.9111.24
    17.60610865.7913.116.6313.79
    32.81138253.1611.248.9023.40
    50.41749044.0111.349.9829.56
    80.02776133.238.8211.3135.63
    96.83359140.685.948.3229.09
    146.45080320.654.498.7236.88
    190.46607217.714.6611.1040.97
    240.08328414.862.2711.6240.11
    286.49938612.02NA10.7342.58
    0.000000109.11NANANA
    2.40083396.845.522.042.02
    5.60194385.299.652.994.39
    12.80444273.6812.485.0511.47
    17.60610864.8912.446.2915.00
    32.81138252.2710.867.6523.30
    50.41749042.6110.549.3731.06
    80.02776134.2910.029.0437.87
    96.83359130.506.348.1433.97
    146.45080319.216.298.5226.15
    190.46607217.555.819.8932.08
    240.08328413.225.9910.7940.66
    286.49938611.096.058.8242.90
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Gross-Umstadt
    timecyanJCZ38J9Z38JSE76
    0.0000000103.03NANANA
    2.101468187.854.793.260.62
    4.903425577.358.059.891.32
    10.507340469.339.7412.324.74
    21.014680755.6514.5713.599.84
    31.522021149.0314.6616.7112.32
    42.029361541.8615.9713.6415.53
    63.044042234.8818.2014.1222.02
    84.058723028.2615.6414.0625.60
    0.0000000104.05NANANA
    2.101468185.252.687.320.69
    4.903425577.227.288.371.45
    10.507340465.2310.7310.934.74
    21.014680757.7812.2914.809.05
    31.522021154.8314.0512.0111.05
    42.029361545.1712.1217.8915.71
    63.044042234.8312.9015.8622.52
    84.058723026.5914.2814.9128.48
    0.0000000104.62NANANA
    0.814522597.21NA4.00NA
    1.900552589.643.595.24NA
    4.072612587.904.109.58NA
    8.145225186.905.969.45NA
    12.217837674.747.8315.035.33
    16.290450274.138.8414.415.10
    24.435675365.2611.8418.336.71
    32.580900457.7012.7419.939.74
    0.0000000101.94NANANA
    0.814522599.94NANANA
    1.900552594.87NA4.56NA
    4.072612586.966.756.90NA
    8.145225180.5110.687.432.58
    12.217837678.3810.359.463.69
    16.290450270.0513.739.277.18
    24.435675361.2812.5713.2813.19
    32.580900452.8512.6712.9513.69
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Sassafras
    timecyanJCZ38J9Z38JSE76
    0.000000102.17NANANA
    2.21671995.491.110.100.83
    5.17234383.356.432.893.30
    11.08359378.1810.005.590.81
    22.16718670.4417.214.231.09
    33.25077968.0020.455.861.17
    44.33437159.6424.643.172.72
    66.50155750.7327.506.191.27
    88.66874245.6532.775.694.54
    0.000000100.43NANANA
    2.21671995.343.210.140.46
    5.17234384.385.734.750.62
    11.08359378.5011.893.990.73
    22.16718671.1717.284.390.66
    33.25077959.4118.7311.852.65
    44.33437164.5722.935.132.01
    66.50155749.0833.395.673.63
    88.66874240.4139.605.936.17
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Lleida
    timecyanJCZ38J9Z38JSE76
    0.000000102.71NANANA
    2.82105179.115.708.070.97
    6.58245170.037.1711.314.72
    14.10525350.9310.2514.849.95
    28.21050533.4310.4014.8224.06
    42.31575824.699.7516.3829.38
    56.42101022.9910.0615.5129.25
    84.63151614.635.6314.7431.04
    112.84202112.434.1713.5333.28
    0.00000099.31NANANA
    2.82105182.076.555.601.12
    6.58245170.657.618.013.21
    14.10525353.5211.4810.8212.24
    28.21050535.6011.1915.4323.53
    42.31575834.2611.0913.2627.42
    56.42101021.794.8018.3030.20
    84.63151614.066.3016.3532.32
    112.84202111.515.5712.6432.51
    +
    +
    +
    +

    Parent only evaluations +

    +

    As the pathway fits have very long run times, evaluations of the +parent data are performed first, in order to determine for each +hierarchical parent degradation model which random effects on the +degradation model parameters are ill-defined.

    +
    +cyan_sep_const <- mmkin(c("SFO", "FOMC", "DFOP", "SFORB", "HS"),
    +  cyan_ds, quiet = TRUE, cores = n_cores)
    +cyan_sep_tc <- update(cyan_sep_const, error_model = "tc")
    +cyan_saem_full <- mhmkin(list(cyan_sep_const, cyan_sep_tc))
    +status(cyan_saem_full) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOOKOK
    FOMCOKOK
    DFOPOKOK
    SFORBOKOK
    HSOKOK
    +

    All fits converged successfully.

    +
    +illparms(cyan_saem_full) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOsd(cyan_0)sd(cyan_0)
    FOMCsd(log_beta)sd(cyan_0)
    DFOPsd(cyan_0)sd(cyan_0), sd(log_k1)
    SFORBsd(cyan_free_0)sd(cyan_free_0), sd(log_k_cyan_free_bound)
    HSsd(cyan_0)sd(cyan_0)
    +

    In almost all models, the random effect for the initial concentration +of the parent compound is ill-defined. For the biexponential models DFOP +and SFORB, the random effect of one additional parameter is ill-defined +when the two-component error model is used.

    +
    +anova(cyan_saem_full) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    SFO const5833.9832.0-412.0
    SFO tc6831.6829.3-409.8
    FOMC const7709.1706.4-347.6
    FOMC tc8689.2686.1-336.6
    DFOP const9703.0699.5-342.5
    SFORB const9701.3697.8-341.7
    HS const9718.6715.1-350.3
    DFOP tc10703.1699.2-341.6
    SFORB tc10700.1696.2-340.1
    HS tc10716.7712.8-348.3
    +

    Model comparison based on AIC and BIC indicates that the +two-component error model is preferable for all parent models with the +exception of DFOP. The lowest AIC and BIC values are are obtained with +the FOMC model, followed by SFORB and DFOP.

    +
    +
    +

    Pathway fits +

    +
    +

    Evaluations with pathway established previously +

    +

    To test the technical feasibility of coupling the relevant parent +degradation models with different transformation pathway models, a list +of mkinmod models is set up below. As in the EU evaluation, +parallel formation of metabolites JCZ38 and J9Z38 and secondary +formation of metabolite JSE76 from JCZ38 is used.

    +
    +if (!dir.exists("cyan_dlls")) dir.create("cyan_dlls")
    +cyan_path_1 <- list(
    +  sfo_path_1 = mkinmod(
    +    cyan = mkinsub("SFO", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO"), quiet = TRUE,
    +    name = "sfo_path_1", dll_dir = "cyan_dlls", overwrite = TRUE),
    +  fomc_path_1 = mkinmod(
    +    cyan = mkinsub("FOMC", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO"), quiet = TRUE,
    +    name = "fomc_path_1", dll_dir = "cyan_dlls", overwrite = TRUE),
    +  dfop_path_1 = mkinmod(
    +    cyan = mkinsub("DFOP", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO"), quiet = TRUE,
    +    name = "dfop_path_1", dll_dir = "cyan_dlls", overwrite = TRUE),
    +  sforb_path_1 = mkinmod(
    +    cyan = mkinsub("SFORB", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO"), quiet = TRUE,
    +    name = "sforb_path_1", dll_dir = "cyan_dlls", overwrite = TRUE),
    +  hs_path_1 = mkinmod(
    +    cyan = mkinsub("HS", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO"), quiet = TRUE,
    +    name = "hs_path_1", dll_dir = "cyan_dlls", overwrite = TRUE)
    +)
    +

    To obtain suitable starting values for the NLHM fits, separate +pathway fits are performed for all datasets.

    +
    +f_sep_1_const <- mmkin(
    +  cyan_path_1,
    +  cyan_ds,
    +  error_model = "const",
    +  cluster = cl,
    +  quiet = TRUE)
    +status(f_sep_1_const) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NambsheimTamaGross-UmstadtSassafrasLleida
    sfo_path_1OKOKOKOKOK
    fomc_path_1OKOKOKOKOK
    dfop_path_1OKOKOKOKOK
    sforb_path_1OKOKOKOKOK
    hs_path_1CCCCC
    +
    +f_sep_1_tc <- update(f_sep_1_const, error_model = "tc")
    +status(f_sep_1_tc) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NambsheimTamaGross-UmstadtSassafrasLleida
    sfo_path_1OKOKOKOKOK
    fomc_path_1OKOKOKOKC
    dfop_path_1OKOKOKOKOK
    sforb_path_1OKCOKOKOK
    hs_path_1COKCOKOK
    +

    Most separate fits converged successfully. The biggest convergence +problems are seen when using the HS model with constant variance.

    +

    For the hierarchical pathway fits, those random effects that could +not be quantified in the corresponding parent data analyses are +excluded.

    +

    In the code below, the output of the illparms function +for the parent only fits is used as an argument +no_random_effect to the mhmkin function. The +possibility to do so was introduced in mkin version 1.2.2 +which is currently under development.

    +
    +f_saem_1 <- mhmkin(list(f_sep_1_const, f_sep_1_tc),
    +  no_random_effect = illparms(cyan_saem_full),
    +  cluster = cl)
    +
    +status(f_saem_1) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    sfo_path_1Fth, FOFth, FO
    fomc_path_1OKFth, FO
    dfop_path_1Fth, FOFth, FO
    sforb_path_1Fth, FOFth, FO
    hs_path_1Fth, FOFth, FO
    +

    The status information from the individual fits shows that all fits +completed successfully. The matrix entries Fth and FO indicate that the +Fisher Information Matrix could not be inverted for the fixed effects +(theta) and the random effects (Omega), respectively. For the affected +fits, ill-defined parameters cannot be determined using the +illparms function, because it relies on the Fisher +Information Matrix.

    +
    +illparms(f_saem_1) |> kable()
    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    sfo_path_1NANA
    fomc_path_1sd(log_k_J9Z38), sd(f_cyan_ilr_2), +sd(f_JCZ38_qlogis)NA
    dfop_path_1NANA
    sforb_path_1NANA
    hs_path_1NANA
    +

    The model comparison below suggests that the pathway fits using DFOP +or SFORB for the parent compound provide the best fit.

    +
    +anova(f_saem_1) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    sfo_path_1 const162692.82686.6-1330.4
    sfo_path_1 tc172657.72651.1-1311.9
    fomc_path_1 const182427.82420.8-1195.9
    fomc_path_1 tc192423.42416.0-1192.7
    dfop_path_1 const202403.22395.4-1181.6
    sforb_path_1 const202401.42393.6-1180.7
    hs_path_1 const202427.32419.5-1193.7
    dfop_path_1 tc202398.02390.2-1179.0
    sforb_path_1 tc202399.82392.0-1179.9
    hs_path_1 tc212422.32414.1-1190.2
    +

    For these two parent model, successful fits are shown below. Plots of +the fits with the other parent models are shown in the Appendix.

    +
    +plot(f_saem_1[["dfop_path_1", "tc"]])
    +
    +DFOP pathway fit with two-component error

    +DFOP pathway fit with two-component error +

    +
    +
    +plot(f_saem_1[["sforb_path_1", "tc"]])
    +
    +SFORB pathway fit with two-component error

    +SFORB pathway fit with two-component error +

    +
    +

    A closer graphical analysis of these Figures shows that the residues +of transformation product JCZ38 in the soils Tama and Nambsheim observed +at later time points are strongly and systematically underestimated.

    +
    +
    +

    Alternative pathway fits +

    +

    To improve the fit for JCZ38, a back-reaction from JSE76 to JCZ38 was +introduced in an alternative version of the transformation pathway, in +analogy to the back-reaction from K5A78 to K5A77. Both pairs of +transformation products are pairs of an organic acid with its +corresponding amide (Addendum 2014, p. 109). As FOMC provided the best +fit for the parent, and the biexponential models DFOP and SFORB provided +the best initial pathway fits, these three parent models are used in the +alternative pathway fits.

    +
    +cyan_path_2 <- list(
    +  fomc_path_2 = mkinmod(
    +    cyan = mkinsub("FOMC", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO", "JCZ38"),
    +    name = "fomc_path_2", quiet = TRUE,
    +    dll_dir = "cyan_dlls",
    +    overwrite = TRUE
    +  ),
    +  dfop_path_2 = mkinmod(
    +    cyan = mkinsub("DFOP", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO", "JCZ38"),
    +    name = "dfop_path_2", quiet = TRUE,
    +    dll_dir = "cyan_dlls",
    +    overwrite = TRUE
    +  ),
    +  sforb_path_2 = mkinmod(
    +    cyan = mkinsub("SFORB", c("JCZ38", "J9Z38")),
    +    JCZ38 = mkinsub("SFO", "JSE76"),
    +    J9Z38 = mkinsub("SFO"),
    +    JSE76 = mkinsub("SFO", "JCZ38"),
    +    name = "sforb_path_2", quiet = TRUE,
    +    dll_dir = "cyan_dlls",
    +    overwrite = TRUE
    +  )
    +)
    +f_sep_2_const <- mmkin(
    +  cyan_path_2,
    +  cyan_ds,
    +  error_model = "const",
    +  cluster = cl,
    +  quiet = TRUE)
    +
    +status(f_sep_2_const) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NambsheimTamaGross-UmstadtSassafrasLleida
    fomc_path_2OKOKOKCOK
    dfop_path_2OKOKOKCOK
    sforb_path_2OKOKOKCOK
    +

    Using constant variance, separate fits converge with the exception of +the fits to the Sassafras soil data.

    +
    +f_sep_2_tc <- update(f_sep_2_const, error_model = "tc")
    +status(f_sep_2_tc) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NambsheimTamaGross-UmstadtSassafrasLleida
    fomc_path_2OKCOKCOK
    dfop_path_2OKOKOKCOK
    sforb_path_2OKOKOKOKOK
    +

    Using the two-component error model, all separate fits converge with +the exception of the alternative pathway fit with DFOP used for the +parent and the Sassafras dataset.

    +
    +f_saem_2 <- mhmkin(list(f_sep_2_const, f_sep_2_tc),
    +  no_random_effect = illparms(cyan_saem_full[2:4, ]),
    +  cluster = cl)
    +
    +status(f_saem_2) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    fomc_path_2OKFO
    dfop_path_2OKOK
    sforb_path_2OKOK
    +

    The hierarchical fits for the alternative pathway completed +successfully.

    +
    +illparms(f_saem_2) |> kable()
    + +++++ + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    fomc_path_2sd(f_JCZ38_qlogis), sd(f_JSE76_qlogis)NA
    dfop_path_2sd(f_JCZ38_qlogis), sd(f_JSE76_qlogis)sd(f_JCZ38_qlogis), sd(f_JSE76_qlogis)
    sforb_path_2sd(f_JCZ38_qlogis), sd(f_JSE76_qlogis)sd(f_JCZ38_qlogis), sd(f_JSE76_qlogis)
    +

    In both fits, the random effects for the formation fractions for the +pathways from JCZ38 to JSE76, and for the reverse pathway from JSE76 to +JCZ38 are ill-defined.

    +
    +anova(f_saem_2) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    fomc_path_2 const202308.32300.5-1134.2
    fomc_path_2 tc212248.32240.1-1103.2
    dfop_path_2 const222289.62281.0-1122.8
    sforb_path_2 const222284.12275.5-1120.0
    dfop_path_2 tc222234.42225.8-1095.2
    sforb_path_2 tc222240.42231.8-1098.2
    +

    The variants using the biexponential models DFOP and SFORB for the +parent compound and the two-component error model give the lowest AIC +and BIC values and are plotted below. Compared with the original +pathway, the AIC and BIC values indicate a large improvement. This is +confirmed by the plots, which show that the metabolite JCZ38 is fitted +much better with this model.

    +
    +plot(f_saem_2[["fomc_path_2", "tc"]])
    +
    +FOMC pathway fit with two-component error, alternative pathway

    +FOMC pathway fit with two-component error, alternative pathway +

    +
    +
    +plot(f_saem_2[["dfop_path_2", "tc"]])
    +
    +DFOP pathway fit with two-component error, alternative pathway

    +DFOP pathway fit with two-component error, alternative pathway +

    +
    +
    +plot(f_saem_2[["sforb_path_2", "tc"]])
    +
    +SFORB pathway fit with two-component error, alternative pathway

    +SFORB pathway fit with two-component error, alternative pathway +

    +
    +
    +
    +

    Refinement of alternative pathway fits +

    +

    All ill-defined random effects that were identified in the parent +only fits and in the above pathway fits, are excluded for the final +evaluations below. For this purpose, a list of character vectors is +created below that can be indexed by row and column indices, and which +contains the degradation parameter names for which random effects should +be excluded for each of the hierarchical fits contained in +f_saem_2.

    +
    +no_ranef <- matrix(list(), nrow = 3, ncol = 2, dimnames = dimnames(f_saem_2))
    +no_ranef[["fomc_path_2", "const"]] <- c("log_beta", "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +no_ranef[["fomc_path_2", "tc"]] <- c("cyan_0", "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +no_ranef[["dfop_path_2", "const"]] <- c("cyan_0", "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +no_ranef[["dfop_path_2", "tc"]] <- c("cyan_0", "log_k1", "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +no_ranef[["sforb_path_2", "const"]] <- c("cyan_free_0",
    +  "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +no_ranef[["sforb_path_2", "tc"]] <- c("cyan_free_0", "log_k_cyan_free_bound",
    +  "f_JCZ38_qlogis", "f_JSE76_qlogis")
    +clusterExport(cl, "no_ranef")
    +
    +f_saem_3 <- update(f_saem_2,
    +  no_random_effect = no_ranef,
    +  cluster = cl)
    +
    +status(f_saem_3) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    fomc_path_2EFth
    dfop_path_2FthFth
    sforb_path_2FthFth
    +

    With the exception of the FOMC pathway fit with constant variance, +all updated fits completed successfully. However, the Fisher Information +Matrix for the fixed effects (Fth) could not be inverted, so no +confidence intervals for the optimised parameters are available.

    +
    +illparms(f_saem_3) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    fomc_path_2E
    dfop_path_2
    sforb_path_2
    +
    +anova(f_saem_3) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    fomc_path_2 tc192250.92243.5-1106.5
    dfop_path_2 const202281.72273.9-1120.8
    sforb_path_2 const202279.52271.7-1119.7
    dfop_path_2 tc202231.52223.7-1095.8
    sforb_path_2 tc202235.72227.9-1097.9
    +

    While the AIC and BIC values of the best fit (DFOP pathway fit with +two-component error) are lower than in the previous fits with the +alternative pathway, the practical value of these refined evaluations is +limited as no confidence intervals are obtained.

    +
    +
    +
    +

    Conclusion +

    +

    It was demonstrated that a relatively complex transformation pathway +with parallel formation of two primary metabolites and one secondary +metabolite can be fitted even if the data in the individual datasets are +quite different and partly only cover the formation phase.

    +

    The run times of the pathway fits were several hours, limiting the +practical feasibility of iterative refinements based on ill-defined +parameters and of alternative checks of parameter identifiability based +on multistart runs.

    +
    +
    +

    Acknowledgements +

    +

    The helpful comments by Janina Wöltjen of the German Environment +Agency are gratefully acknowledged.

    +
    +
    +

    Appendix +

    +
    +

    Plots of fits that were not refined further +

    +
    +plot(f_saem_1[["sfo_path_1", "tc"]])
    +
    +SFO pathway fit with two-component error

    +SFO pathway fit with two-component error +

    +
    +
    +plot(f_saem_1[["fomc_path_1", "tc"]])
    +
    +FOMC pathway fit with two-component error

    +FOMC pathway fit with two-component error +

    +
    +
    +plot(f_saem_1[["sforb_path_1", "tc"]])
    +
    +HS pathway fit with two-component error

    +HS pathway fit with two-component error +

    +
    +
    +
    +

    Hierarchical fit listings +

    +
    +

    Pathway 1 +

    + +Hierarchical SFO path 1 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:07:38 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - k_cyan * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * k_cyan * cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * k_cyan * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1088.473 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0     log_k_cyan    log_k_JCZ38    log_k_J9Z38    log_k_JSE76 
    +       95.3304        -3.8459        -3.1305        -5.0678        -5.3196 
    +  f_cyan_ilr_1   f_cyan_ilr_2 f_JCZ38_qlogis 
    +        0.8158        22.5404        10.4289 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_cyan log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_0          4.797     0.0000       0.000       0.000      0.0000
    +log_k_cyan      0.000     0.9619       0.000       0.000      0.0000
    +log_k_JCZ38     0.000     0.0000       2.139       0.000      0.0000
    +log_k_J9Z38     0.000     0.0000       0.000       1.639      0.0000
    +log_k_JSE76     0.000     0.0000       0.000       0.000      0.7894
    +f_cyan_ilr_1    0.000     0.0000       0.000       0.000      0.0000
    +f_cyan_ilr_2    0.000     0.0000       0.000       0.000      0.0000
    +f_JCZ38_qlogis  0.000     0.0000       0.000       0.000      0.0000
    +               f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis
    +cyan_0               0.0000        0.000           0.00
    +log_k_cyan           0.0000        0.000           0.00
    +log_k_JCZ38          0.0000        0.000           0.00
    +log_k_J9Z38          0.0000        0.000           0.00
    +log_k_JSE76          0.0000        0.000           0.00
    +f_cyan_ilr_1         0.7714        0.000           0.00
    +f_cyan_ilr_2         0.0000        8.684           0.00
    +f_JCZ38_qlogis       0.0000        0.000          13.48
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2693 2687  -1330
    +
    +Optimised parameters:
    +                     est. lower upper
    +cyan_0            95.0946    NA    NA
    +log_k_cyan        -3.8544    NA    NA
    +log_k_JCZ38       -3.0402    NA    NA
    +log_k_J9Z38       -5.0109    NA    NA
    +log_k_JSE76       -5.2857    NA    NA
    +f_cyan_ilr_1       0.8069    NA    NA
    +f_cyan_ilr_2      16.6623    NA    NA
    +f_JCZ38_qlogis     1.3602    NA    NA
    +a.1                4.8326    NA    NA
    +SD.log_k_cyan      0.5842    NA    NA
    +SD.log_k_JCZ38     1.2680    NA    NA
    +SD.log_k_J9Z38     0.3626    NA    NA
    +SD.log_k_JSE76     0.5244    NA    NA
    +SD.f_cyan_ilr_1    0.2752    NA    NA
    +SD.f_cyan_ilr_2    2.3556    NA    NA
    +SD.f_JCZ38_qlogis  0.2400    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_cyan     0.5842    NA    NA
    +SD.log_k_JCZ38    1.2680    NA    NA
    +SD.log_k_J9Z38    0.3626    NA    NA
    +SD.log_k_JSE76    0.5244    NA    NA
    +SD.f_cyan_ilr_1   0.2752    NA    NA
    +SD.f_cyan_ilr_2   2.3556    NA    NA
    +SD.f_JCZ38_qlogis 0.2400    NA    NA
    +
    +Variance model:
    +     est. lower upper
    +a.1 4.833    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           95.094581    NA    NA
    +k_cyan            0.021186    NA    NA
    +k_JCZ38           0.047825    NA    NA
    +k_J9Z38           0.006665    NA    NA
    +k_JSE76           0.005063    NA    NA
    +f_cyan_to_JCZ38   0.757885    NA    NA
    +f_cyan_to_J9Z38   0.242115    NA    NA
    +f_JCZ38_to_JSE76  0.795792    NA    NA
    +
    +Resulting formation fractions:
    +                   ff
    +cyan_JCZ38  7.579e-01
    +cyan_J9Z38  2.421e-01
    +cyan_sink   5.877e-10
    +JCZ38_JSE76 7.958e-01
    +JCZ38_sink  2.042e-01
    +
    +Estimated disappearance times:
    +        DT50   DT90
    +cyan   32.72 108.68
    +JCZ38  14.49  48.15
    +J9Z38 103.99 345.46
    +JSE76 136.90 454.76
    +
    +
    +

    + +Hierarchical SFO path 1 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:08:17 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - k_cyan * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * k_cyan * cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * k_cyan * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1127.552 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0     log_k_cyan    log_k_JCZ38    log_k_J9Z38    log_k_JSE76 
    +       96.0039        -3.8907        -3.1276        -5.0069        -4.9367 
    +  f_cyan_ilr_1   f_cyan_ilr_2 f_JCZ38_qlogis 
    +        0.7937        20.0030        15.1336 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_cyan log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_0          4.859      0.000        0.00        0.00      0.0000
    +log_k_cyan      0.000      0.962        0.00        0.00      0.0000
    +log_k_JCZ38     0.000      0.000        2.04        0.00      0.0000
    +log_k_J9Z38     0.000      0.000        0.00        1.72      0.0000
    +log_k_JSE76     0.000      0.000        0.00        0.00      0.9076
    +f_cyan_ilr_1    0.000      0.000        0.00        0.00      0.0000
    +f_cyan_ilr_2    0.000      0.000        0.00        0.00      0.0000
    +f_JCZ38_qlogis  0.000      0.000        0.00        0.00      0.0000
    +               f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis
    +cyan_0               0.0000        0.000           0.00
    +log_k_cyan           0.0000        0.000           0.00
    +log_k_JCZ38          0.0000        0.000           0.00
    +log_k_J9Z38          0.0000        0.000           0.00
    +log_k_JSE76          0.0000        0.000           0.00
    +f_cyan_ilr_1         0.7598        0.000           0.00
    +f_cyan_ilr_2         0.0000        7.334           0.00
    +f_JCZ38_qlogis       0.0000        0.000          11.78
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2658 2651  -1312
    +
    +Optimised parameters:
    +                      est. lower upper
    +cyan_0            94.72923    NA    NA
    +log_k_cyan        -3.91670    NA    NA
    +log_k_JCZ38       -3.12917    NA    NA
    +log_k_J9Z38       -5.06070    NA    NA
    +log_k_JSE76       -5.09254    NA    NA
    +f_cyan_ilr_1       0.81116    NA    NA
    +f_cyan_ilr_2      39.97850    NA    NA
    +f_JCZ38_qlogis     3.09728    NA    NA
    +a.1                3.95044    NA    NA
    +b.1                0.07998    NA    NA
    +SD.log_k_cyan      0.58855    NA    NA
    +SD.log_k_JCZ38     1.29753    NA    NA
    +SD.log_k_J9Z38     0.62851    NA    NA
    +SD.log_k_JSE76     0.37235    NA    NA
    +SD.f_cyan_ilr_1    0.37346    NA    NA
    +SD.f_cyan_ilr_2    1.41667    NA    NA
    +SD.f_JCZ38_qlogis  1.81467    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_cyan     0.5886    NA    NA
    +SD.log_k_JCZ38    1.2975    NA    NA
    +SD.log_k_J9Z38    0.6285    NA    NA
    +SD.log_k_JSE76    0.3724    NA    NA
    +SD.f_cyan_ilr_1   0.3735    NA    NA
    +SD.f_cyan_ilr_2   1.4167    NA    NA
    +SD.f_JCZ38_qlogis 1.8147    NA    NA
    +
    +Variance model:
    +       est. lower upper
    +a.1 3.95044    NA    NA
    +b.1 0.07998    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           94.729229    NA    NA
    +k_cyan            0.019907    NA    NA
    +k_JCZ38           0.043754    NA    NA
    +k_J9Z38           0.006341    NA    NA
    +k_JSE76           0.006142    NA    NA
    +f_cyan_to_JCZ38   0.758991    NA    NA
    +f_cyan_to_J9Z38   0.241009    NA    NA
    +f_JCZ38_to_JSE76  0.956781    NA    NA
    +
    +Resulting formation fractions:
    +                 ff
    +cyan_JCZ38  0.75899
    +cyan_J9Z38  0.24101
    +cyan_sink   0.00000
    +JCZ38_JSE76 0.95678
    +JCZ38_sink  0.04322
    +
    +Estimated disappearance times:
    +        DT50   DT90
    +cyan   34.82 115.67
    +JCZ38  15.84  52.63
    +J9Z38 109.31 363.12
    +JSE76 112.85 374.87
    +
    +
    +

    + +Hierarchical FOMC path 1 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:09:12 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - (alpha/beta) * 1/((time/beta) + 1) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1182.258 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.2314        -3.3680        -5.1108        -5.9416         0.7144 
    +  f_cyan_ilr_2 f_JCZ38_qlogis      log_alpha       log_beta 
    +        7.3870        15.7604        -0.1791         2.9811 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.416       0.000         0.0       0.000       0.0000
    +log_k_JCZ38     0.000       2.439         0.0       0.000       0.0000
    +log_k_J9Z38     0.000       0.000         1.7       0.000       0.0000
    +log_k_JSE76     0.000       0.000         0.0       1.856       0.0000
    +f_cyan_ilr_1    0.000       0.000         0.0       0.000       0.7164
    +f_cyan_ilr_2    0.000       0.000         0.0       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000         0.0       0.000       0.0000
    +log_alpha       0.000       0.000         0.0       0.000       0.0000
    +log_beta        0.000       0.000         0.0       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_alpha log_beta
    +cyan_0                 0.00           0.00    0.0000   0.0000
    +log_k_JCZ38            0.00           0.00    0.0000   0.0000
    +log_k_J9Z38            0.00           0.00    0.0000   0.0000
    +log_k_JSE76            0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_1           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_2          12.33           0.00    0.0000   0.0000
    +f_JCZ38_qlogis         0.00          20.42    0.0000   0.0000
    +log_alpha              0.00           0.00    0.4144   0.0000
    +log_beta               0.00           0.00    0.0000   0.5077
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2428 2421  -1196
    +
    +Optimised parameters:
    +                      est.     lower    upper
    +cyan_0            101.0225 98.306270 103.7387
    +log_k_JCZ38        -3.3786 -4.770657  -1.9866
    +log_k_J9Z38        -5.2603 -5.902085  -4.6186
    +log_k_JSE76        -6.1427 -7.318336  -4.9671
    +f_cyan_ilr_1        0.7437  0.421215   1.0663
    +f_cyan_ilr_2        0.9108  0.267977   1.5537
    +f_JCZ38_qlogis      2.0487  0.524897   3.5724
    +log_alpha          -0.2268 -0.618049   0.1644
    +log_beta            2.8986  2.700701   3.0964
    +a.1                 3.4058  3.169913   3.6416
    +SD.cyan_0           2.5279  0.454190   4.6016
    +SD.log_k_JCZ38      1.5636  0.572824   2.5543
    +SD.log_k_J9Z38      0.5316 -0.004405   1.0677
    +SD.log_k_JSE76      0.9903  0.106325   1.8742
    +SD.f_cyan_ilr_1     0.3464  0.112066   0.5807
    +SD.f_cyan_ilr_2     0.2804 -0.393900   0.9546
    +SD.f_JCZ38_qlogis   0.9416 -0.152986   2.0362
    +SD.log_alpha        0.4273  0.161044   0.6936
    +
    +Correlation: 
    +               cyan_0  l__JCZ3 l__J9Z3 l__JSE7 f_cy__1 f_cy__2 f_JCZ38 log_lph
    +log_k_JCZ38    -0.0156                                                        
    +log_k_J9Z38    -0.0493  0.0073                                                
    +log_k_JSE76    -0.0329  0.0018  0.0069                                        
    +f_cyan_ilr_1   -0.0086  0.0180 -0.1406  0.0012                                
    +f_cyan_ilr_2   -0.2629  0.0779  0.2826  0.0274  0.0099                        
    +f_JCZ38_qlogis  0.0713 -0.0747 -0.0505  0.1169 -0.1022 -0.4893                
    +log_alpha      -0.0556  0.0120  0.0336  0.0193  0.0036  0.0840 -0.0489        
    +log_beta       -0.2898  0.0460  0.1305  0.0768  0.0190  0.4071 -0.1981  0.2772
    +
    +Random effects:
    +                    est.     lower  upper
    +SD.cyan_0         2.5279  0.454190 4.6016
    +SD.log_k_JCZ38    1.5636  0.572824 2.5543
    +SD.log_k_J9Z38    0.5316 -0.004405 1.0677
    +SD.log_k_JSE76    0.9903  0.106325 1.8742
    +SD.f_cyan_ilr_1   0.3464  0.112066 0.5807
    +SD.f_cyan_ilr_2   0.2804 -0.393900 0.9546
    +SD.f_JCZ38_qlogis 0.9416 -0.152986 2.0362
    +SD.log_alpha      0.4273  0.161044 0.6936
    +
    +Variance model:
    +     est. lower upper
    +a.1 3.406  3.17 3.642
    +
    +Backtransformed parameters:
    +                      est.     lower     upper
    +cyan_0           1.010e+02 9.831e+01 1.037e+02
    +k_JCZ38          3.409e-02 8.475e-03 1.372e-01
    +k_J9Z38          5.194e-03 2.734e-03 9.867e-03
    +k_JSE76          2.149e-03 6.633e-04 6.963e-03
    +f_cyan_to_JCZ38  6.481e-01        NA        NA
    +f_cyan_to_J9Z38  2.264e-01        NA        NA
    +f_JCZ38_to_JSE76 8.858e-01 6.283e-01 9.727e-01
    +alpha            7.971e-01 5.390e-01 1.179e+00
    +beta             1.815e+01 1.489e+01 2.212e+01
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.6481
    +cyan_J9Z38  0.2264
    +cyan_sink   0.1255
    +JCZ38_JSE76 0.8858
    +JCZ38_sink  0.1142
    +
    +Estimated disappearance times:
    +        DT50    DT90 DT50back
    +cyan   25.15  308.01    92.72
    +JCZ38  20.33   67.54       NA
    +J9Z38 133.46  443.35       NA
    +JSE76 322.53 1071.42       NA
    +
    +
    +

    + +Hierarchical FOMC path 1 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:09:18 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - (alpha/beta) * 1/((time/beta) + 1) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1188.041 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +     101.13827       -3.32493       -5.08921       -5.93478        0.71330 
    +  f_cyan_ilr_2 f_JCZ38_qlogis      log_alpha       log_beta 
    +      10.05989       12.79248       -0.09621        3.10646 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.643       0.000       0.000        0.00       0.0000
    +log_k_JCZ38     0.000       2.319       0.000        0.00       0.0000
    +log_k_J9Z38     0.000       0.000       1.731        0.00       0.0000
    +log_k_JSE76     0.000       0.000       0.000        1.86       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000        0.00       0.7186
    +f_cyan_ilr_2    0.000       0.000       0.000        0.00       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000        0.00       0.0000
    +log_alpha       0.000       0.000       0.000        0.00       0.0000
    +log_beta        0.000       0.000       0.000        0.00       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_alpha log_beta
    +cyan_0                 0.00           0.00    0.0000   0.0000
    +log_k_JCZ38            0.00           0.00    0.0000   0.0000
    +log_k_J9Z38            0.00           0.00    0.0000   0.0000
    +log_k_JSE76            0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_1           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_2          12.49           0.00    0.0000   0.0000
    +f_JCZ38_qlogis         0.00          20.19    0.0000   0.0000
    +log_alpha              0.00           0.00    0.3142   0.0000
    +log_beta               0.00           0.00    0.0000   0.7331
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2423 2416  -1193
    +
    +Optimised parameters:
    +                       est. lower upper
    +cyan_0            100.57649    NA    NA
    +log_k_JCZ38        -3.46250    NA    NA
    +log_k_J9Z38        -5.24442    NA    NA
    +log_k_JSE76        -5.75229    NA    NA
    +f_cyan_ilr_1        0.68480    NA    NA
    +f_cyan_ilr_2        0.61670    NA    NA
    +f_JCZ38_qlogis     87.97407    NA    NA
    +log_alpha          -0.15699    NA    NA
    +log_beta            3.01540    NA    NA
    +a.1                 3.11518    NA    NA
    +b.1                 0.04445    NA    NA
    +SD.log_k_JCZ38      1.40732    NA    NA
    +SD.log_k_J9Z38      0.56510    NA    NA
    +SD.log_k_JSE76      0.72067    NA    NA
    +SD.f_cyan_ilr_1     0.31199    NA    NA
    +SD.f_cyan_ilr_2     0.36894    NA    NA
    +SD.f_JCZ38_qlogis   6.92892    NA    NA
    +SD.log_alpha        0.25662    NA    NA
    +SD.log_beta         0.35845    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_JCZ38    1.4073    NA    NA
    +SD.log_k_J9Z38    0.5651    NA    NA
    +SD.log_k_JSE76    0.7207    NA    NA
    +SD.f_cyan_ilr_1   0.3120    NA    NA
    +SD.f_cyan_ilr_2   0.3689    NA    NA
    +SD.f_JCZ38_qlogis 6.9289    NA    NA
    +SD.log_alpha      0.2566    NA    NA
    +SD.log_beta       0.3585    NA    NA
    +
    +Variance model:
    +       est. lower upper
    +a.1 3.11518    NA    NA
    +b.1 0.04445    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.006e+02    NA    NA
    +k_JCZ38          3.135e-02    NA    NA
    +k_J9Z38          5.277e-03    NA    NA
    +k_JSE76          3.175e-03    NA    NA
    +f_cyan_to_JCZ38  5.991e-01    NA    NA
    +f_cyan_to_J9Z38  2.275e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +alpha            8.547e-01    NA    NA
    +beta             2.040e+01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.5991
    +cyan_J9Z38  0.2275
    +cyan_sink   0.1734
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back
    +cyan   25.50 281.29    84.68
    +JCZ38  22.11  73.44       NA
    +J9Z38 131.36 436.35       NA
    +JSE76 218.28 725.11       NA
    +
    +
    +

    + +Hierarchical DFOP path 1 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:10:30 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1260.905 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      102.0644        -3.4008        -5.0024        -5.8613         0.6855 
    +  f_cyan_ilr_2 f_JCZ38_qlogis         log_k1         log_k2       g_qlogis 
    +        1.2365        13.7245        -1.8641        -4.5063        -0.6468 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          4.466       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       2.382       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.595       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       1.245       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6852
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_k1          0.000       0.000       0.000       0.000       0.0000
    +log_k2          0.000       0.000       0.000       0.000       0.0000
    +g_qlogis        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_k1 log_k2 g_qlogis
    +cyan_0                 0.00           0.00 0.0000 0.0000    0.000
    +log_k_JCZ38            0.00           0.00 0.0000 0.0000    0.000
    +log_k_J9Z38            0.00           0.00 0.0000 0.0000    0.000
    +log_k_JSE76            0.00           0.00 0.0000 0.0000    0.000
    +f_cyan_ilr_1           0.00           0.00 0.0000 0.0000    0.000
    +f_cyan_ilr_2           1.28           0.00 0.0000 0.0000    0.000
    +f_JCZ38_qlogis         0.00          16.11 0.0000 0.0000    0.000
    +log_k1                 0.00           0.00 0.9866 0.0000    0.000
    +log_k2                 0.00           0.00 0.0000 0.5953    0.000
    +g_qlogis               0.00           0.00 0.0000 0.0000    1.583
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2403 2395  -1182
    +
    +Optimised parameters:
    +                      est. lower upper
    +cyan_0            102.6079    NA    NA
    +log_k_JCZ38        -3.4855    NA    NA
    +log_k_J9Z38        -5.1686    NA    NA
    +log_k_JSE76        -5.6697    NA    NA
    +f_cyan_ilr_1        0.6714    NA    NA
    +f_cyan_ilr_2        0.4986    NA    NA
    +f_JCZ38_qlogis     55.4760    NA    NA
    +log_k1             -1.8409    NA    NA
    +log_k2             -4.4915    NA    NA
    +g_qlogis           -0.6403    NA    NA
    +a.1                 3.2387    NA    NA
    +SD.log_k_JCZ38      1.4524    NA    NA
    +SD.log_k_J9Z38      0.5151    NA    NA
    +SD.log_k_JSE76      0.6514    NA    NA
    +SD.f_cyan_ilr_1     0.3023    NA    NA
    +SD.f_cyan_ilr_2     0.2959    NA    NA
    +SD.f_JCZ38_qlogis   1.9984    NA    NA
    +SD.log_k1           0.5188    NA    NA
    +SD.log_k2           0.3894    NA    NA
    +SD.g_qlogis         0.8579    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_JCZ38    1.4524    NA    NA
    +SD.log_k_J9Z38    0.5151    NA    NA
    +SD.log_k_JSE76    0.6514    NA    NA
    +SD.f_cyan_ilr_1   0.3023    NA    NA
    +SD.f_cyan_ilr_2   0.2959    NA    NA
    +SD.f_JCZ38_qlogis 1.9984    NA    NA
    +SD.log_k1         0.5188    NA    NA
    +SD.log_k2         0.3894    NA    NA
    +SD.g_qlogis       0.8579    NA    NA
    +
    +Variance model:
    +     est. lower upper
    +a.1 3.239    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.026e+02    NA    NA
    +k_JCZ38          3.064e-02    NA    NA
    +k_J9Z38          5.692e-03    NA    NA
    +k_JSE76          3.449e-03    NA    NA
    +f_cyan_to_JCZ38  5.798e-01    NA    NA
    +f_cyan_to_J9Z38  2.243e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +k1               1.587e-01    NA    NA
    +k2               1.120e-02    NA    NA
    +g                3.452e-01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.5798
    +cyan_J9Z38  0.2243
    +cyan_sink   0.1958
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   25.21 167.73    50.49   4.368   61.87
    +JCZ38  22.62  75.15       NA      NA      NA
    +J9Z38 121.77 404.50       NA      NA      NA
    +JSE76 200.98 667.64       NA      NA      NA
    +
    +
    +

    + +Hierarchical DFOP path 1 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:16:28 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1617.774 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.3964        -3.3626        -4.9792        -5.8727         0.6814 
    +  f_cyan_ilr_2 f_JCZ38_qlogis         log_k1         log_k2       g_qlogis 
    +        6.7799        13.7245        -1.9222        -4.5035        -0.7172 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.317       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       2.272       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.633       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       1.271       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6838
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_k1          0.000       0.000       0.000       0.000       0.0000
    +log_k2          0.000       0.000       0.000       0.000       0.0000
    +g_qlogis        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_k1 log_k2 g_qlogis
    +cyan_0                 0.00           0.00 0.0000 0.0000    0.000
    +log_k_JCZ38            0.00           0.00 0.0000 0.0000    0.000
    +log_k_J9Z38            0.00           0.00 0.0000 0.0000    0.000
    +log_k_JSE76            0.00           0.00 0.0000 0.0000    0.000
    +f_cyan_ilr_1           0.00           0.00 0.0000 0.0000    0.000
    +f_cyan_ilr_2          11.77           0.00 0.0000 0.0000    0.000
    +f_JCZ38_qlogis         0.00          16.11 0.0000 0.0000    0.000
    +log_k1                 0.00           0.00 0.9496 0.0000    0.000
    +log_k2                 0.00           0.00 0.0000 0.5846    0.000
    +g_qlogis               0.00           0.00 0.0000 0.0000    1.719
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2398 2390  -1179
    +
    +Optimised parameters:
    +                      est. lower upper
    +cyan_0            100.8076    NA    NA
    +log_k_JCZ38        -3.4684    NA    NA
    +log_k_J9Z38        -5.0844    NA    NA
    +log_k_JSE76        -5.5743    NA    NA
    +f_cyan_ilr_1        0.6669    NA    NA
    +f_cyan_ilr_2        0.7912    NA    NA
    +f_JCZ38_qlogis     84.1825    NA    NA
    +log_k1             -2.1671    NA    NA
    +log_k2             -4.5447    NA    NA
    +g_qlogis           -0.5631    NA    NA
    +a.1                 2.9627    NA    NA
    +b.1                 0.0444    NA    NA
    +SD.log_k_JCZ38      1.4044    NA    NA
    +SD.log_k_J9Z38      0.6410    NA    NA
    +SD.log_k_JSE76      0.5391    NA    NA
    +SD.f_cyan_ilr_1     0.3203    NA    NA
    +SD.f_cyan_ilr_2     0.5038    NA    NA
    +SD.f_JCZ38_qlogis   3.5865    NA    NA
    +SD.log_k2           0.3119    NA    NA
    +SD.g_qlogis         0.8276    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_JCZ38    1.4044    NA    NA
    +SD.log_k_J9Z38    0.6410    NA    NA
    +SD.log_k_JSE76    0.5391    NA    NA
    +SD.f_cyan_ilr_1   0.3203    NA    NA
    +SD.f_cyan_ilr_2   0.5038    NA    NA
    +SD.f_JCZ38_qlogis 3.5865    NA    NA
    +SD.log_k2         0.3119    NA    NA
    +SD.g_qlogis       0.8276    NA    NA
    +
    +Variance model:
    +      est. lower upper
    +a.1 2.9627    NA    NA
    +b.1 0.0444    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.008e+02    NA    NA
    +k_JCZ38          3.117e-02    NA    NA
    +k_J9Z38          6.193e-03    NA    NA
    +k_JSE76          3.794e-03    NA    NA
    +f_cyan_to_JCZ38  6.149e-01    NA    NA
    +f_cyan_to_J9Z38  2.395e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +k1               1.145e-01    NA    NA
    +k2               1.062e-02    NA    NA
    +g                3.628e-01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.6149
    +cyan_J9Z38  0.2395
    +cyan_sink   0.1456
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   26.26 174.32    52.47   6.053   65.25
    +JCZ38  22.24  73.88       NA      NA      NA
    +J9Z38 111.93 371.82       NA      NA      NA
    +JSE76 182.69 606.88       NA      NA      NA
    +
    +
    +

    + +Hierarchical SFORB path 1 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:10:49 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1279.472 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +             102.0643               -2.8987               -2.7077 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +              -3.4717               -3.4008               -5.0024 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +              -5.8613                0.6855                1.2366 
    +       f_JCZ38_qlogis 
    +              13.7418 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 4.466          0.0000                 0.000
    +log_k_cyan_free             0.000          0.6158                 0.000
    +log_k_cyan_free_bound       0.000          0.0000                 1.463
    +log_k_cyan_bound_free       0.000          0.0000                 0.000
    +log_k_JCZ38                 0.000          0.0000                 0.000
    +log_k_J9Z38                 0.000          0.0000                 0.000
    +log_k_JSE76                 0.000          0.0000                 0.000
    +f_cyan_ilr_1                0.000          0.0000                 0.000
    +f_cyan_ilr_2                0.000          0.0000                 0.000
    +f_JCZ38_qlogis              0.000          0.0000                 0.000
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000       0.000       0.000       0.000
    +log_k_cyan_free                       0.000       0.000       0.000       0.000
    +log_k_cyan_free_bound                 0.000       0.000       0.000       0.000
    +log_k_cyan_bound_free                 1.058       0.000       0.000       0.000
    +log_k_JCZ38                           0.000       2.382       0.000       0.000
    +log_k_J9Z38                           0.000       0.000       1.595       0.000
    +log_k_JSE76                           0.000       0.000       0.000       1.245
    +f_cyan_ilr_1                          0.000       0.000       0.000       0.000
    +f_cyan_ilr_2                          0.000       0.000       0.000       0.000
    +f_JCZ38_qlogis                        0.000       0.000       0.000       0.000
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis
    +cyan_free_0                 0.0000         0.00           0.00
    +log_k_cyan_free             0.0000         0.00           0.00
    +log_k_cyan_free_bound       0.0000         0.00           0.00
    +log_k_cyan_bound_free       0.0000         0.00           0.00
    +log_k_JCZ38                 0.0000         0.00           0.00
    +log_k_J9Z38                 0.0000         0.00           0.00
    +log_k_JSE76                 0.0000         0.00           0.00
    +f_cyan_ilr_1                0.6852         0.00           0.00
    +f_cyan_ilr_2                0.0000         1.28           0.00
    +f_JCZ38_qlogis              0.0000         0.00          16.14
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2401 2394  -1181
    +
    +Optimised parameters:
    +                             est. lower upper
    +cyan_free_0              102.7803    NA    NA
    +log_k_cyan_free           -2.8068    NA    NA
    +log_k_cyan_free_bound     -2.5714    NA    NA
    +log_k_cyan_bound_free     -3.4426    NA    NA
    +log_k_JCZ38               -3.4994    NA    NA
    +log_k_J9Z38               -5.1148    NA    NA
    +log_k_JSE76               -5.6335    NA    NA
    +f_cyan_ilr_1               0.6597    NA    NA
    +f_cyan_ilr_2               0.5132    NA    NA
    +f_JCZ38_qlogis            37.2090    NA    NA
    +a.1                        3.2367    NA    NA
    +SD.log_k_cyan_free         0.3161    NA    NA
    +SD.log_k_cyan_free_bound   0.8103    NA    NA
    +SD.log_k_cyan_bound_free   0.5554    NA    NA
    +SD.log_k_JCZ38             1.4858    NA    NA
    +SD.log_k_J9Z38             0.5859    NA    NA
    +SD.log_k_JSE76             0.6195    NA    NA
    +SD.f_cyan_ilr_1            0.3118    NA    NA
    +SD.f_cyan_ilr_2            0.3344    NA    NA
    +SD.f_JCZ38_qlogis          0.5518    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                           est. lower upper
    +SD.log_k_cyan_free       0.3161    NA    NA
    +SD.log_k_cyan_free_bound 0.8103    NA    NA
    +SD.log_k_cyan_bound_free 0.5554    NA    NA
    +SD.log_k_JCZ38           1.4858    NA    NA
    +SD.log_k_J9Z38           0.5859    NA    NA
    +SD.log_k_JSE76           0.6195    NA    NA
    +SD.f_cyan_ilr_1          0.3118    NA    NA
    +SD.f_cyan_ilr_2          0.3344    NA    NA
    +SD.f_JCZ38_qlogis        0.5518    NA    NA
    +
    +Variance model:
    +     est. lower upper
    +a.1 3.237    NA    NA
    +
    +Backtransformed parameters:
    +                          est. lower upper
    +cyan_free_0          1.028e+02    NA    NA
    +k_cyan_free          6.040e-02    NA    NA
    +k_cyan_free_bound    7.643e-02    NA    NA
    +k_cyan_bound_free    3.198e-02    NA    NA
    +k_JCZ38              3.022e-02    NA    NA
    +k_J9Z38              6.007e-03    NA    NA
    +k_JSE76              3.576e-03    NA    NA
    +f_cyan_free_to_JCZ38 5.787e-01    NA    NA
    +f_cyan_free_to_J9Z38 2.277e-01    NA    NA
    +f_JCZ38_to_JSE76     1.000e+00    NA    NA
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    +0.15646 0.01235 0.33341 
    +
    +Resulting formation fractions:
    +                    ff
    +cyan_free_JCZ38 0.5787
    +cyan_free_J9Z38 0.2277
    +cyan_free_sink  0.1936
    +cyan_free       1.0000
    +JCZ38_JSE76     1.0000
    +JCZ38_sink      0.0000
    +
    +Estimated disappearance times:
    +        DT50  DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   24.48 153.7    46.26         4.43        56.15
    +JCZ38  22.94  76.2       NA           NA           NA
    +J9Z38 115.39 383.3       NA           NA           NA
    +JSE76 193.84 643.9       NA           NA           NA
    +
    +
    +

    + +Hierarchical SFORB path 1 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:17:00 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1649.941 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +             101.3964               -2.9881               -2.7949 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +              -3.4376               -3.3626               -4.9792 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +              -5.8727                0.6814                6.8139 
    +       f_JCZ38_qlogis 
    +              13.7419 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 5.317          0.0000                 0.000
    +log_k_cyan_free             0.000          0.7301                 0.000
    +log_k_cyan_free_bound       0.000          0.0000                 1.384
    +log_k_cyan_bound_free       0.000          0.0000                 0.000
    +log_k_JCZ38                 0.000          0.0000                 0.000
    +log_k_J9Z38                 0.000          0.0000                 0.000
    +log_k_JSE76                 0.000          0.0000                 0.000
    +f_cyan_ilr_1                0.000          0.0000                 0.000
    +f_cyan_ilr_2                0.000          0.0000                 0.000
    +f_JCZ38_qlogis              0.000          0.0000                 0.000
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000       0.000       0.000       0.000
    +log_k_cyan_free                       0.000       0.000       0.000       0.000
    +log_k_cyan_free_bound                 0.000       0.000       0.000       0.000
    +log_k_cyan_bound_free                 1.109       0.000       0.000       0.000
    +log_k_JCZ38                           0.000       2.272       0.000       0.000
    +log_k_J9Z38                           0.000       0.000       1.633       0.000
    +log_k_JSE76                           0.000       0.000       0.000       1.271
    +f_cyan_ilr_1                          0.000       0.000       0.000       0.000
    +f_cyan_ilr_2                          0.000       0.000       0.000       0.000
    +f_JCZ38_qlogis                        0.000       0.000       0.000       0.000
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis
    +cyan_free_0                 0.0000         0.00           0.00
    +log_k_cyan_free             0.0000         0.00           0.00
    +log_k_cyan_free_bound       0.0000         0.00           0.00
    +log_k_cyan_bound_free       0.0000         0.00           0.00
    +log_k_JCZ38                 0.0000         0.00           0.00
    +log_k_J9Z38                 0.0000         0.00           0.00
    +log_k_JSE76                 0.0000         0.00           0.00
    +f_cyan_ilr_1                0.6838         0.00           0.00
    +f_cyan_ilr_2                0.0000        11.84           0.00
    +f_JCZ38_qlogis              0.0000         0.00          16.14
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2400 2392  -1180
    +
    +Optimised parameters:
    +                              est. lower upper
    +cyan_free_0              100.69983    NA    NA
    +log_k_cyan_free           -3.11584    NA    NA
    +log_k_cyan_free_bound     -3.15216    NA    NA
    +log_k_cyan_bound_free     -3.65986    NA    NA
    +log_k_JCZ38               -3.47811    NA    NA
    +log_k_J9Z38               -5.08835    NA    NA
    +log_k_JSE76               -5.55514    NA    NA
    +f_cyan_ilr_1               0.66764    NA    NA
    +f_cyan_ilr_2               0.78329    NA    NA
    +f_JCZ38_qlogis            25.35245    NA    NA
    +a.1                        2.99088    NA    NA
    +b.1                        0.04346    NA    NA
    +SD.log_k_cyan_free         0.48797    NA    NA
    +SD.log_k_cyan_bound_free   0.27243    NA    NA
    +SD.log_k_JCZ38             1.42450    NA    NA
    +SD.log_k_J9Z38             0.63496    NA    NA
    +SD.log_k_JSE76             0.55951    NA    NA
    +SD.f_cyan_ilr_1            0.32687    NA    NA
    +SD.f_cyan_ilr_2            0.48056    NA    NA
    +SD.f_JCZ38_qlogis          0.43818    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                           est. lower upper
    +SD.log_k_cyan_free       0.4880    NA    NA
    +SD.log_k_cyan_bound_free 0.2724    NA    NA
    +SD.log_k_JCZ38           1.4245    NA    NA
    +SD.log_k_J9Z38           0.6350    NA    NA
    +SD.log_k_JSE76           0.5595    NA    NA
    +SD.f_cyan_ilr_1          0.3269    NA    NA
    +SD.f_cyan_ilr_2          0.4806    NA    NA
    +SD.f_JCZ38_qlogis        0.4382    NA    NA
    +
    +Variance model:
    +       est. lower upper
    +a.1 2.99088    NA    NA
    +b.1 0.04346    NA    NA
    +
    +Backtransformed parameters:
    +                          est. lower upper
    +cyan_free_0          1.007e+02    NA    NA
    +k_cyan_free          4.434e-02    NA    NA
    +k_cyan_free_bound    4.276e-02    NA    NA
    +k_cyan_bound_free    2.574e-02    NA    NA
    +k_JCZ38              3.087e-02    NA    NA
    +k_J9Z38              6.168e-03    NA    NA
    +k_JSE76              3.868e-03    NA    NA
    +f_cyan_free_to_JCZ38 6.143e-01    NA    NA
    +f_cyan_free_to_J9Z38 2.389e-01    NA    NA
    +f_JCZ38_to_JSE76     1.000e+00    NA    NA
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    +0.10161 0.01123 0.36636 
    +
    +Resulting formation fractions:
    +                       ff
    +cyan_free_JCZ38 6.143e-01
    +cyan_free_J9Z38 2.389e-01
    +cyan_free_sink  1.468e-01
    +cyan_free       1.000e+00
    +JCZ38_JSE76     1.000e+00
    +JCZ38_sink      9.763e-12
    +
    +Estimated disappearance times:
    +        DT50  DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   25.91 164.4    49.49        6.822        61.72
    +JCZ38  22.46  74.6       NA           NA           NA
    +J9Z38 112.37 373.3       NA           NA           NA
    +JSE76 179.22 595.4       NA           NA           NA
    +
    +
    +

    + +Hierarchical HS path 1 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:11:04 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ifelse(time <= tb, k1, k2) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ifelse(time <= tb, k1, k2) * cyan -
    +           k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ifelse(time <= tb, k1, k2) * cyan -
    +           k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1294.259 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      102.8738        -3.4490        -4.9348        -5.5989         0.6469 
    +  f_cyan_ilr_2 f_JCZ38_qlogis         log_k1         log_k2         log_tb 
    +        1.2854         9.7193        -2.9084        -4.1810         1.7813 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.409        0.00        0.00       0.000       0.0000
    +log_k_JCZ38     0.000        2.33        0.00       0.000       0.0000
    +log_k_J9Z38     0.000        0.00        1.59       0.000       0.0000
    +log_k_JSE76     0.000        0.00        0.00       1.006       0.0000
    +f_cyan_ilr_1    0.000        0.00        0.00       0.000       0.6371
    +f_cyan_ilr_2    0.000        0.00        0.00       0.000       0.0000
    +f_JCZ38_qlogis  0.000        0.00        0.00       0.000       0.0000
    +log_k1          0.000        0.00        0.00       0.000       0.0000
    +log_k2          0.000        0.00        0.00       0.000       0.0000
    +log_tb          0.000        0.00        0.00       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_k1 log_k2 log_tb
    +cyan_0                0.000           0.00 0.0000 0.0000 0.0000
    +log_k_JCZ38           0.000           0.00 0.0000 0.0000 0.0000
    +log_k_J9Z38           0.000           0.00 0.0000 0.0000 0.0000
    +log_k_JSE76           0.000           0.00 0.0000 0.0000 0.0000
    +f_cyan_ilr_1          0.000           0.00 0.0000 0.0000 0.0000
    +f_cyan_ilr_2          2.167           0.00 0.0000 0.0000 0.0000
    +f_JCZ38_qlogis        0.000          10.22 0.0000 0.0000 0.0000
    +log_k1                0.000           0.00 0.7003 0.0000 0.0000
    +log_k2                0.000           0.00 0.0000 0.8928 0.0000
    +log_tb                0.000           0.00 0.0000 0.0000 0.6774
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2427 2420  -1194
    +
    +Optimised parameters:
    +                       est. lower upper
    +cyan_0            101.84849    NA    NA
    +log_k_JCZ38        -3.47365    NA    NA
    +log_k_J9Z38        -5.10562    NA    NA
    +log_k_JSE76        -5.60318    NA    NA
    +f_cyan_ilr_1        0.66127    NA    NA
    +f_cyan_ilr_2        0.60283    NA    NA
    +f_JCZ38_qlogis     45.06408    NA    NA
    +log_k1             -3.10124    NA    NA
    +log_k2             -4.39028    NA    NA
    +log_tb              2.32256    NA    NA
    +a.1                 3.32683    NA    NA
    +SD.log_k_JCZ38      1.41427    NA    NA
    +SD.log_k_J9Z38      0.54767    NA    NA
    +SD.log_k_JSE76      0.62147    NA    NA
    +SD.f_cyan_ilr_1     0.30189    NA    NA
    +SD.f_cyan_ilr_2     0.34960    NA    NA
    +SD.f_JCZ38_qlogis   0.04644    NA    NA
    +SD.log_k1           0.39534    NA    NA
    +SD.log_k2           0.43468    NA    NA
    +SD.log_tb           0.60781    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                     est. lower upper
    +SD.log_k_JCZ38    1.41427    NA    NA
    +SD.log_k_J9Z38    0.54767    NA    NA
    +SD.log_k_JSE76    0.62147    NA    NA
    +SD.f_cyan_ilr_1   0.30189    NA    NA
    +SD.f_cyan_ilr_2   0.34960    NA    NA
    +SD.f_JCZ38_qlogis 0.04644    NA    NA
    +SD.log_k1         0.39534    NA    NA
    +SD.log_k2         0.43468    NA    NA
    +SD.log_tb         0.60781    NA    NA
    +
    +Variance model:
    +     est. lower upper
    +a.1 3.327    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.018e+02    NA    NA
    +k_JCZ38          3.100e-02    NA    NA
    +k_J9Z38          6.063e-03    NA    NA
    +k_JSE76          3.686e-03    NA    NA
    +f_cyan_to_JCZ38  5.910e-01    NA    NA
    +f_cyan_to_J9Z38  2.320e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +k1               4.499e-02    NA    NA
    +k2               1.240e-02    NA    NA
    +tb               1.020e+01    NA    NA
    +
    +Resulting formation fractions:
    +               ff
    +cyan_JCZ38  0.591
    +cyan_J9Z38  0.232
    +cyan_sink   0.177
    +JCZ38_JSE76 1.000
    +JCZ38_sink  0.000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   29.09 158.91    47.84   15.41   55.91
    +JCZ38  22.36  74.27       NA      NA      NA
    +J9Z38 114.33 379.80       NA      NA      NA
    +JSE76 188.04 624.66       NA      NA      NA
    +
    +
    +

    + +Hierarchical HS path 1 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:11:24 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ifelse(time <= tb, k1, k2) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ifelse(time <= tb, k1, k2) * cyan -
    +           k_JCZ38 * JCZ38
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ifelse(time <= tb, k1, k2) * cyan -
    +           k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1313.805 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +       101.168         -3.358         -4.941         -5.794          0.676 
    +  f_cyan_ilr_2 f_JCZ38_qlogis         log_k1         log_k2         log_tb 
    +         5.740         13.863         -3.147         -4.262          2.173 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0           5.79       0.000       0.000       0.000       0.0000
    +log_k_JCZ38      0.00       2.271       0.000       0.000       0.0000
    +log_k_J9Z38      0.00       0.000       1.614       0.000       0.0000
    +log_k_JSE76      0.00       0.000       0.000       1.264       0.0000
    +f_cyan_ilr_1     0.00       0.000       0.000       0.000       0.6761
    +f_cyan_ilr_2     0.00       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis   0.00       0.000       0.000       0.000       0.0000
    +log_k1           0.00       0.000       0.000       0.000       0.0000
    +log_k2           0.00       0.000       0.000       0.000       0.0000
    +log_tb           0.00       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis log_k1 log_k2 log_tb
    +cyan_0                0.000           0.00 0.0000 0.0000  0.000
    +log_k_JCZ38           0.000           0.00 0.0000 0.0000  0.000
    +log_k_J9Z38           0.000           0.00 0.0000 0.0000  0.000
    +log_k_JSE76           0.000           0.00 0.0000 0.0000  0.000
    +f_cyan_ilr_1          0.000           0.00 0.0000 0.0000  0.000
    +f_cyan_ilr_2          9.572           0.00 0.0000 0.0000  0.000
    +f_JCZ38_qlogis        0.000          19.19 0.0000 0.0000  0.000
    +log_k1                0.000           0.00 0.8705 0.0000  0.000
    +log_k2                0.000           0.00 0.0000 0.9288  0.000
    +log_tb                0.000           0.00 0.0000 0.0000  1.065
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2422 2414  -1190
    +
    +Optimised parameters:
    +                      est. lower upper
    +cyan_0            100.9521    NA    NA
    +log_k_JCZ38        -3.4629    NA    NA
    +log_k_J9Z38        -5.0346    NA    NA
    +log_k_JSE76        -5.5722    NA    NA
    +f_cyan_ilr_1        0.6560    NA    NA
    +f_cyan_ilr_2        0.7983    NA    NA
    +f_JCZ38_qlogis     42.7949    NA    NA
    +log_k1             -3.1721    NA    NA
    +log_k2             -4.4039    NA    NA
    +log_tb              2.3994    NA    NA
    +a.1                 3.0586    NA    NA
    +b.1                 0.0380    NA    NA
    +SD.log_k_JCZ38      1.3754    NA    NA
    +SD.log_k_J9Z38      0.6703    NA    NA
    +SD.log_k_JSE76      0.5876    NA    NA
    +SD.f_cyan_ilr_1     0.3272    NA    NA
    +SD.f_cyan_ilr_2     0.5300    NA    NA
    +SD.f_JCZ38_qlogis   6.4465    NA    NA
    +SD.log_k1           0.4135    NA    NA
    +SD.log_k2           0.4182    NA    NA
    +SD.log_tb           0.6035    NA    NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_JCZ38    1.3754    NA    NA
    +SD.log_k_J9Z38    0.6703    NA    NA
    +SD.log_k_JSE76    0.5876    NA    NA
    +SD.f_cyan_ilr_1   0.3272    NA    NA
    +SD.f_cyan_ilr_2   0.5300    NA    NA
    +SD.f_JCZ38_qlogis 6.4465    NA    NA
    +SD.log_k1         0.4135    NA    NA
    +SD.log_k2         0.4182    NA    NA
    +SD.log_tb         0.6035    NA    NA
    +
    +Variance model:
    +     est. lower upper
    +a.1 3.059    NA    NA
    +b.1 0.038    NA    NA
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.010e+02    NA    NA
    +k_JCZ38          3.134e-02    NA    NA
    +k_J9Z38          6.509e-03    NA    NA
    +k_JSE76          3.802e-03    NA    NA
    +f_cyan_to_JCZ38  6.127e-01    NA    NA
    +f_cyan_to_J9Z38  2.423e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +k1               4.191e-02    NA    NA
    +k2               1.223e-02    NA    NA
    +tb               1.102e+01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.6127
    +cyan_J9Z38  0.2423
    +cyan_sink   0.1449
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   29.94 161.54    48.63   16.54   56.68
    +JCZ38  22.12  73.47       NA      NA      NA
    +J9Z38 106.50 353.77       NA      NA      NA
    +JSE76 182.30 605.60       NA      NA      NA
    +
    +
    +

    +
    +
    +

    Pathway 2 +

    + +Hierarchical FOMC path 2 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:34:28 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - (alpha/beta) * 1/((time/beta) + 1) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_JCZ38 * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1030.246 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.8173        -1.8998        -5.1449        -2.5415         0.6705 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis      log_alpha       log_beta 
    +        4.4669        16.1281        13.3327        -0.2314         2.8738 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.742       0.000       0.000        0.00       0.0000
    +log_k_JCZ38     0.000       1.402       0.000        0.00       0.0000
    +log_k_J9Z38     0.000       0.000       1.718        0.00       0.0000
    +log_k_JSE76     0.000       0.000       0.000        3.57       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000        0.00       0.5926
    +f_cyan_ilr_2    0.000       0.000       0.000        0.00       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000        0.00       0.0000
    +f_JSE76_qlogis  0.000       0.000       0.000        0.00       0.0000
    +log_alpha       0.000       0.000       0.000        0.00       0.0000
    +log_beta        0.000       0.000       0.000        0.00       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_alpha log_beta
    +cyan_0                 0.00           0.00           0.00    0.0000   0.0000
    +log_k_JCZ38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_J9Z38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_JSE76            0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_1           0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_2          10.56           0.00           0.00    0.0000   0.0000
    +f_JCZ38_qlogis         0.00          12.04           0.00    0.0000   0.0000
    +f_JSE76_qlogis         0.00           0.00          15.26    0.0000   0.0000
    +log_alpha              0.00           0.00           0.00    0.4708   0.0000
    +log_beta               0.00           0.00           0.00    0.0000   0.4432
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2308 2301  -1134
    +
    +Optimised parameters:
    +                      est.    lower     upper
    +cyan_0            101.9586 99.22024 104.69700
    +log_k_JCZ38        -2.4861 -3.17661  -1.79560
    +log_k_J9Z38        -5.3926 -6.08842  -4.69684
    +log_k_JSE76        -3.1193 -4.12904  -2.10962
    +f_cyan_ilr_1        0.7368  0.42085   1.05276
    +f_cyan_ilr_2        0.6196  0.06052   1.17861
    +f_JCZ38_qlogis      4.8970 -4.68003  14.47398
    +f_JSE76_qlogis      4.4066 -1.02087   9.83398
    +log_alpha          -0.3021 -0.68264   0.07838
    +log_beta            2.7438  2.57970   2.90786
    +a.1                 2.9008  2.69920   3.10245
    +SD.cyan_0           2.7081  0.64216   4.77401
    +SD.log_k_JCZ38      0.7043  0.19951   1.20907
    +SD.log_k_J9Z38      0.6248  0.05790   1.19180
    +SD.log_k_JSE76      1.0750  0.33157   1.81839
    +SD.f_cyan_ilr_1     0.3429  0.11688   0.56892
    +SD.f_cyan_ilr_2     0.4774  0.09381   0.86097
    +SD.f_JCZ38_qlogis   1.5565 -7.83970  10.95279
    +SD.f_JSE76_qlogis   1.6871 -1.25577   4.63000
    +SD.log_alpha        0.4216  0.15913   0.68405
    +
    +Correlation: 
    +               cyan_0  l__JCZ3 l__J9Z3 l__JSE7 f_cy__1 f_cy__2 f_JCZ38 f_JSE76
    +log_k_JCZ38    -0.0167                                                        
    +log_k_J9Z38    -0.0307  0.0057                                                
    +log_k_JSE76    -0.0032  0.1358  0.0009                                        
    +f_cyan_ilr_1   -0.0087  0.0206 -0.1158 -0.0009                                
    +f_cyan_ilr_2   -0.1598  0.0690  0.1770  0.0002 -0.0007                        
    +f_JCZ38_qlogis  0.0966 -0.1132 -0.0440  0.0182 -0.1385 -0.4583                
    +f_JSE76_qlogis -0.0647  0.1157  0.0333 -0.0026  0.1110  0.3620 -0.8586        
    +log_alpha      -0.0389  0.0113  0.0209  0.0021  0.0041  0.0451 -0.0605  0.0412
    +log_beta       -0.2508  0.0533  0.0977  0.0098  0.0220  0.2741 -0.2934  0.1999
    +               log_lph
    +log_k_JCZ38           
    +log_k_J9Z38           
    +log_k_JSE76           
    +f_cyan_ilr_1          
    +f_cyan_ilr_2          
    +f_JCZ38_qlogis        
    +f_JSE76_qlogis        
    +log_alpha             
    +log_beta        0.2281
    +
    +Random effects:
    +                    est.    lower   upper
    +SD.cyan_0         2.7081  0.64216  4.7740
    +SD.log_k_JCZ38    0.7043  0.19951  1.2091
    +SD.log_k_J9Z38    0.6248  0.05790  1.1918
    +SD.log_k_JSE76    1.0750  0.33157  1.8184
    +SD.f_cyan_ilr_1   0.3429  0.11688  0.5689
    +SD.f_cyan_ilr_2   0.4774  0.09381  0.8610
    +SD.f_JCZ38_qlogis 1.5565 -7.83970 10.9528
    +SD.f_JSE76_qlogis 1.6871 -1.25577  4.6300
    +SD.log_alpha      0.4216  0.15913  0.6840
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.901 2.699 3.102
    +
    +Backtransformed parameters:
    +                      est.     lower     upper
    +cyan_0           101.95862 99.220240 1.047e+02
    +k_JCZ38            0.08323  0.041727 1.660e-01
    +k_J9Z38            0.00455  0.002269 9.124e-03
    +k_JSE76            0.04419  0.016098 1.213e-01
    +f_cyan_to_JCZ38    0.61318        NA        NA
    +f_cyan_to_J9Z38    0.21630        NA        NA
    +f_JCZ38_to_JSE76   0.99259  0.009193 1.000e+00
    +f_JSE76_to_JCZ38   0.98795  0.264857 9.999e-01
    +alpha              0.73924  0.505281 1.082e+00
    +beta              15.54568 13.193194 1.832e+01
    +
    +Resulting formation fractions:
    +                  ff
    +cyan_JCZ38  0.613182
    +cyan_J9Z38  0.216298
    +cyan_sink   0.170519
    +JCZ38_JSE76 0.992586
    +JCZ38_sink  0.007414
    +JSE76_JCZ38 0.987950
    +JSE76_sink  0.012050
    +
    +Estimated disappearance times:
    +         DT50   DT90 DT50back
    +cyan   24.157 334.68    100.7
    +JCZ38   8.328  27.66       NA
    +J9Z38 152.341 506.06       NA
    +JSE76  15.687  52.11       NA
    +
    +
    +

    + +Hierarchical FOMC path 2 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:37:36 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - (alpha/beta) * 1/((time/beta) + 1) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_JCZ38 * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1217.619 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.9028        -1.9055        -5.0249        -2.5646         0.6807 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis      log_alpha       log_beta 
    +        4.8883        16.0676         9.3923        -0.1346         3.0364 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          6.321       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       1.392       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.561       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       3.614       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6339
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +f_JSE76_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_alpha       0.000       0.000       0.000       0.000       0.0000
    +log_beta        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_alpha log_beta
    +cyan_0                 0.00           0.00           0.00    0.0000   0.0000
    +log_k_JCZ38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_J9Z38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_JSE76            0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_1           0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_2          10.41           0.00           0.00    0.0000   0.0000
    +f_JCZ38_qlogis         0.00          12.24           0.00    0.0000   0.0000
    +f_JSE76_qlogis         0.00           0.00          15.13    0.0000   0.0000
    +log_alpha              0.00           0.00           0.00    0.3701   0.0000
    +log_beta               0.00           0.00           0.00    0.0000   0.5662
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2248 2240  -1103
    +
    +Optimised parameters:
    +                       est.      lower      upper
    +cyan_0            101.55545  9.920e+01  1.039e+02
    +log_k_JCZ38        -2.37354 -2.928e+00 -1.819e+00
    +log_k_J9Z38        -5.14736 -5.960e+00 -4.335e+00
    +log_k_JSE76        -3.07802 -4.243e+00 -1.913e+00
    +f_cyan_ilr_1        0.71263  3.655e-01  1.060e+00
    +f_cyan_ilr_2        0.95202  2.701e-01  1.634e+00
    +f_JCZ38_qlogis      3.58473  1.251e+00  5.919e+00
    +f_JSE76_qlogis     19.03623 -1.037e+07  1.037e+07
    +log_alpha          -0.15297 -4.490e-01  1.431e-01
    +log_beta            2.99230  2.706e+00  3.278e+00
    +a.1                 2.04816         NA         NA
    +b.1                 0.06886         NA         NA
    +SD.log_k_JCZ38      0.56174         NA         NA
    +SD.log_k_J9Z38      0.86509         NA         NA
    +SD.log_k_JSE76      1.28450         NA         NA
    +SD.f_cyan_ilr_1     0.38705         NA         NA
    +SD.f_cyan_ilr_2     0.54153         NA         NA
    +SD.f_JCZ38_qlogis   1.65311         NA         NA
    +SD.f_JSE76_qlogis   7.51468         NA         NA
    +SD.log_alpha        0.31586         NA         NA
    +SD.log_beta         0.24696         NA         NA
    +
    +Correlation is not available
    +
    +Random effects:
    +                    est. lower upper
    +SD.log_k_JCZ38    0.5617    NA    NA
    +SD.log_k_J9Z38    0.8651    NA    NA
    +SD.log_k_JSE76    1.2845    NA    NA
    +SD.f_cyan_ilr_1   0.3870    NA    NA
    +SD.f_cyan_ilr_2   0.5415    NA    NA
    +SD.f_JCZ38_qlogis 1.6531    NA    NA
    +SD.f_JSE76_qlogis 7.5147    NA    NA
    +SD.log_alpha      0.3159    NA    NA
    +SD.log_beta       0.2470    NA    NA
    +
    +Variance model:
    +       est. lower upper
    +a.1 2.04816    NA    NA
    +b.1 0.06886    NA    NA
    +
    +Backtransformed parameters:
    +                      est.    lower    upper
    +cyan_0           1.016e+02 99.20301 103.9079
    +k_JCZ38          9.315e-02  0.05349   0.1622
    +k_J9Z38          5.815e-03  0.00258   0.0131
    +k_JSE76          4.605e-02  0.01436   0.1477
    +f_cyan_to_JCZ38  6.438e-01       NA       NA
    +f_cyan_to_J9Z38  2.350e-01       NA       NA
    +f_JCZ38_to_JSE76 9.730e-01  0.77745   0.9973
    +f_JSE76_to_JCZ38 1.000e+00  0.00000   1.0000
    +alpha            8.582e-01  0.63824   1.1538
    +beta             1.993e+01 14.97621  26.5262
    +
    +Resulting formation fractions:
    +                   ff
    +cyan_JCZ38  6.438e-01
    +cyan_J9Z38  2.350e-01
    +cyan_sink   1.212e-01
    +JCZ38_JSE76 9.730e-01
    +JCZ38_sink  2.700e-02
    +JSE76_JCZ38 1.000e+00
    +JSE76_sink  5.403e-09
    +
    +Estimated disappearance times:
    +         DT50   DT90 DT50back
    +cyan   24.771 271.70    81.79
    +JCZ38   7.441  24.72       NA
    +J9Z38 119.205 395.99       NA
    +JSE76  15.052  50.00       NA
    +
    +
    +

    + +Hierarchical DFOP path 2 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:38:34 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38 +
    +           f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1276.128 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      102.4358        -2.3107        -5.3123        -3.7120         0.6753 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis         log_k1         log_k2 
    +        1.1462        12.4095        12.3630        -1.9317        -4.4557 
    +      g_qlogis 
    +       -0.5648 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          4.594      0.0000       0.000         0.0       0.0000
    +log_k_JCZ38     0.000      0.7966       0.000         0.0       0.0000
    +log_k_J9Z38     0.000      0.0000       1.561         0.0       0.0000
    +log_k_JSE76     0.000      0.0000       0.000         0.8       0.0000
    +f_cyan_ilr_1    0.000      0.0000       0.000         0.0       0.6349
    +f_cyan_ilr_2    0.000      0.0000       0.000         0.0       0.0000
    +f_JCZ38_qlogis  0.000      0.0000       0.000         0.0       0.0000
    +f_JSE76_qlogis  0.000      0.0000       0.000         0.0       0.0000
    +log_k1          0.000      0.0000       0.000         0.0       0.0000
    +log_k2          0.000      0.0000       0.000         0.0       0.0000
    +g_qlogis        0.000      0.0000       0.000         0.0       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_k1 log_k2
    +cyan_0                0.000           0.00            0.0  0.000 0.0000
    +log_k_JCZ38           0.000           0.00            0.0  0.000 0.0000
    +log_k_J9Z38           0.000           0.00            0.0  0.000 0.0000
    +log_k_JSE76           0.000           0.00            0.0  0.000 0.0000
    +f_cyan_ilr_1          0.000           0.00            0.0  0.000 0.0000
    +f_cyan_ilr_2          1.797           0.00            0.0  0.000 0.0000
    +f_JCZ38_qlogis        0.000          13.85            0.0  0.000 0.0000
    +f_JSE76_qlogis        0.000           0.00           14.1  0.000 0.0000
    +log_k1                0.000           0.00            0.0  1.106 0.0000
    +log_k2                0.000           0.00            0.0  0.000 0.6141
    +g_qlogis              0.000           0.00            0.0  0.000 0.0000
    +               g_qlogis
    +cyan_0            0.000
    +log_k_JCZ38       0.000
    +log_k_J9Z38       0.000
    +log_k_JSE76       0.000
    +f_cyan_ilr_1      0.000
    +f_cyan_ilr_2      0.000
    +f_JCZ38_qlogis    0.000
    +f_JSE76_qlogis    0.000
    +log_k1            0.000
    +log_k2            0.000
    +g_qlogis          1.595
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2290 2281  -1123
    +
    +Optimised parameters:
    +                      est.     lower    upper
    +cyan_0            102.6903 101.44420 103.9365
    +log_k_JCZ38        -2.4018  -2.98058  -1.8230
    +log_k_J9Z38        -5.1865  -5.92931  -4.4437
    +log_k_JSE76        -3.0784  -4.25226  -1.9045
    +f_cyan_ilr_1        0.7157   0.37625   1.0551
    +f_cyan_ilr_2        0.7073   0.20136   1.2132
    +f_JCZ38_qlogis      4.6797   0.43240   8.9269
    +f_JSE76_qlogis      5.0080  -1.01380  11.0299
    +log_k1             -1.9620  -2.62909  -1.2949
    +log_k2             -4.4894  -4.94958  -4.0292
    +g_qlogis           -0.4658  -1.34443   0.4129
    +a.1                 2.7158   2.52576   2.9059
    +SD.log_k_JCZ38      0.5818   0.15679   1.0067
    +SD.log_k_J9Z38      0.7421   0.16751   1.3167
    +SD.log_k_JSE76      1.2841   0.43247   2.1356
    +SD.f_cyan_ilr_1     0.3748   0.13040   0.6192
    +SD.f_cyan_ilr_2     0.4550   0.08396   0.8261
    +SD.f_JCZ38_qlogis   2.0862  -0.73390   4.9062
    +SD.f_JSE76_qlogis   1.9585  -3.14773   7.0647
    +SD.log_k1           0.7389   0.25761   1.2201
    +SD.log_k2           0.5132   0.18143   0.8450
    +SD.g_qlogis         0.9870   0.35773   1.6164
    +
    +Correlation: 
    +               cyan_0  l__JCZ3 l__J9Z3 l__JSE7 f_cy__1 f_cy__2 f_JCZ38 f_JSE76
    +log_k_JCZ38    -0.0170                                                        
    +log_k_J9Z38    -0.0457  0.0016                                                
    +log_k_JSE76    -0.0046  0.1183  0.0005                                        
    +f_cyan_ilr_1    0.0079  0.0072 -0.0909  0.0003                                
    +f_cyan_ilr_2   -0.3114  0.0343  0.1542  0.0023 -0.0519                        
    +f_JCZ38_qlogis  0.0777 -0.0601 -0.0152  0.0080 -0.0520 -0.2524                
    +f_JSE76_qlogis -0.0356  0.0817  0.0073  0.0051  0.0388  0.1959 -0.6236        
    +log_k1          0.0848 -0.0028  0.0010 -0.0010 -0.0014 -0.0245  0.0121 -0.0177
    +log_k2          0.0274 -0.0001  0.0075  0.0000 -0.0023 -0.0060  0.0000 -0.0130
    +g_qlogis        0.0159  0.0002 -0.0095  0.0002  0.0029 -0.0140 -0.0001  0.0149
    +               log_k1  log_k2 
    +log_k_JCZ38                   
    +log_k_J9Z38                   
    +log_k_JSE76                   
    +f_cyan_ilr_1                  
    +f_cyan_ilr_2                  
    +f_JCZ38_qlogis                
    +f_JSE76_qlogis                
    +log_k1                        
    +log_k2          0.0280        
    +g_qlogis       -0.0278 -0.0310
    +
    +Random effects:
    +                    est.    lower  upper
    +SD.log_k_JCZ38    0.5818  0.15679 1.0067
    +SD.log_k_J9Z38    0.7421  0.16751 1.3167
    +SD.log_k_JSE76    1.2841  0.43247 2.1356
    +SD.f_cyan_ilr_1   0.3748  0.13040 0.6192
    +SD.f_cyan_ilr_2   0.4550  0.08396 0.8261
    +SD.f_JCZ38_qlogis 2.0862 -0.73390 4.9062
    +SD.f_JSE76_qlogis 1.9585 -3.14773 7.0647
    +SD.log_k1         0.7389  0.25761 1.2201
    +SD.log_k2         0.5132  0.18143 0.8450
    +SD.g_qlogis       0.9870  0.35773 1.6164
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.716 2.526 2.906
    +
    +Backtransformed parameters:
    +                      est.     lower     upper
    +cyan_0           1.027e+02 1.014e+02 103.93649
    +k_JCZ38          9.056e-02 5.076e-02   0.16154
    +k_J9Z38          5.591e-03 2.660e-03   0.01175
    +k_JSE76          4.603e-02 1.423e-02   0.14890
    +f_cyan_to_JCZ38  6.184e-01        NA        NA
    +f_cyan_to_J9Z38  2.248e-01        NA        NA
    +f_JCZ38_to_JSE76 9.908e-01 6.064e-01   0.99987
    +f_JSE76_to_JCZ38 9.934e-01 2.662e-01   0.99998
    +k1               1.406e-01 7.214e-02   0.27393
    +k2               1.123e-02 7.086e-03   0.01779
    +g                3.856e-01 2.068e-01   0.60177
    +
    +Resulting formation fractions:
    +                  ff
    +cyan_JCZ38  0.618443
    +cyan_J9Z38  0.224770
    +cyan_sink   0.156787
    +JCZ38_JSE76 0.990803
    +JCZ38_sink  0.009197
    +JSE76_JCZ38 0.993360
    +JSE76_sink  0.006640
    +
    +Estimated disappearance times:
    +         DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   21.674 161.70    48.68   4.931   61.74
    +JCZ38   7.654  25.43       NA      NA      NA
    +J9Z38 123.966 411.81       NA      NA      NA
    +JSE76  15.057  50.02       NA      NA      NA
    +
    +
    +

    + +Hierarchical DFOP path 2 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:45:32 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38 +
    +           f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1693.767 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.7523        -1.5948        -5.0119        -2.2723         0.6719 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis         log_k1         log_k2 
    +        5.1681        12.8238        12.4130        -2.0057        -4.5526 
    +      g_qlogis 
    +       -0.5805 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.627       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       2.327       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.664       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       4.566       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6519
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +f_JSE76_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_k1          0.000       0.000       0.000       0.000       0.0000
    +log_k2          0.000       0.000       0.000       0.000       0.0000
    +g_qlogis        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_k1 log_k2
    +cyan_0                  0.0           0.00           0.00 0.0000 0.0000
    +log_k_JCZ38             0.0           0.00           0.00 0.0000 0.0000
    +log_k_J9Z38             0.0           0.00           0.00 0.0000 0.0000
    +log_k_JSE76             0.0           0.00           0.00 0.0000 0.0000
    +f_cyan_ilr_1            0.0           0.00           0.00 0.0000 0.0000
    +f_cyan_ilr_2           10.1           0.00           0.00 0.0000 0.0000
    +f_JCZ38_qlogis          0.0          13.99           0.00 0.0000 0.0000
    +f_JSE76_qlogis          0.0           0.00          14.15 0.0000 0.0000
    +log_k1                  0.0           0.00           0.00 0.8452 0.0000
    +log_k2                  0.0           0.00           0.00 0.0000 0.5968
    +g_qlogis                0.0           0.00           0.00 0.0000 0.0000
    +               g_qlogis
    +cyan_0            0.000
    +log_k_JCZ38       0.000
    +log_k_J9Z38       0.000
    +log_k_JSE76       0.000
    +f_cyan_ilr_1      0.000
    +f_cyan_ilr_2      0.000
    +f_JCZ38_qlogis    0.000
    +f_JSE76_qlogis    0.000
    +log_k1            0.000
    +log_k2            0.000
    +g_qlogis          1.691
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2234 2226  -1095
    +
    +Optimised parameters:
    +                       est.      lower      upper
    +cyan_0            101.10667  9.903e+01  103.18265
    +log_k_JCZ38        -2.49437 -3.297e+00   -1.69221
    +log_k_J9Z38        -5.08171 -5.875e+00   -4.28846
    +log_k_JSE76        -3.20072 -4.180e+00   -2.22163
    +f_cyan_ilr_1        0.71059  3.639e-01    1.05727
    +f_cyan_ilr_2        1.15398  2.981e-01    2.00984
    +f_JCZ38_qlogis      3.18027  1.056e+00    5.30452
    +f_JSE76_qlogis      5.61578 -2.505e+01   36.28077
    +log_k1             -2.38875 -2.517e+00   -2.26045
    +log_k2             -4.67246 -4.928e+00   -4.41715
    +g_qlogis           -0.28231 -1.135e+00    0.57058
    +a.1                 2.08190  1.856e+00    2.30785
    +b.1                 0.06114  5.015e-02    0.07214
    +SD.log_k_JCZ38      0.84622  2.637e-01    1.42873
    +SD.log_k_J9Z38      0.84564  2.566e-01    1.43464
    +SD.log_k_JSE76      1.04385  3.242e-01    1.76351
    +SD.f_cyan_ilr_1     0.38568  1.362e-01    0.63514
    +SD.f_cyan_ilr_2     0.68046  7.166e-02    1.28925
    +SD.f_JCZ38_qlogis   1.25244 -4.213e-02    2.54700
    +SD.f_JSE76_qlogis   0.28202 -1.515e+03 1515.87968
    +SD.log_k2           0.25749  7.655e-02    0.43843
    +SD.g_qlogis         0.94535  3.490e-01    1.54174
    +
    +Correlation: 
    +               cyan_0  l__JCZ3 l__J9Z3 l__JSE7 f_cy__1 f_cy__2 f_JCZ38 f_JSE76
    +log_k_JCZ38    -0.0086                                                        
    +log_k_J9Z38    -0.0363 -0.0007                                                
    +log_k_JSE76     0.0015  0.1210 -0.0017                                        
    +f_cyan_ilr_1   -0.0048  0.0095 -0.0572  0.0030                                
    +f_cyan_ilr_2   -0.4788  0.0328  0.1143  0.0027 -0.0316                        
    +f_JCZ38_qlogis  0.0736 -0.0664 -0.0137  0.0145 -0.0444 -0.2175                
    +f_JSE76_qlogis -0.0137  0.0971  0.0035  0.0009  0.0293  0.1333 -0.6767        
    +log_k1          0.2345 -0.0350 -0.0099 -0.0113 -0.0126 -0.1652  0.1756 -0.2161
    +log_k2          0.0440 -0.0133  0.0199 -0.0040 -0.0097 -0.0119  0.0604 -0.1306
    +g_qlogis        0.0438  0.0078 -0.0123  0.0029  0.0046 -0.0363 -0.0318  0.0736
    +               log_k1  log_k2 
    +log_k_JCZ38                   
    +log_k_J9Z38                   
    +log_k_JSE76                   
    +f_cyan_ilr_1                  
    +f_cyan_ilr_2                  
    +f_JCZ38_qlogis                
    +f_JSE76_qlogis                
    +log_k1                        
    +log_k2          0.3198        
    +g_qlogis       -0.1666 -0.0954
    +
    +Random effects:
    +                    est.      lower     upper
    +SD.log_k_JCZ38    0.8462  2.637e-01    1.4287
    +SD.log_k_J9Z38    0.8456  2.566e-01    1.4346
    +SD.log_k_JSE76    1.0439  3.242e-01    1.7635
    +SD.f_cyan_ilr_1   0.3857  1.362e-01    0.6351
    +SD.f_cyan_ilr_2   0.6805  7.166e-02    1.2893
    +SD.f_JCZ38_qlogis 1.2524 -4.213e-02    2.5470
    +SD.f_JSE76_qlogis 0.2820 -1.515e+03 1515.8797
    +SD.log_k2         0.2575  7.655e-02    0.4384
    +SD.g_qlogis       0.9453  3.490e-01    1.5417
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 2.08190 1.85595 2.30785
    +b.1 0.06114 0.05015 0.07214
    +
    +Backtransformed parameters:
    +                      est.     lower     upper
    +cyan_0           1.011e+02 9.903e+01 103.18265
    +k_JCZ38          8.255e-02 3.701e-02   0.18411
    +k_J9Z38          6.209e-03 2.809e-03   0.01373
    +k_JSE76          4.073e-02 1.530e-02   0.10843
    +f_cyan_to_JCZ38  6.608e-01        NA        NA
    +f_cyan_to_J9Z38  2.419e-01        NA        NA
    +f_JCZ38_to_JSE76 9.601e-01 7.419e-01   0.99506
    +f_JSE76_to_JCZ38 9.964e-01 1.322e-11   1.00000
    +k1               9.174e-02 8.070e-02   0.10430
    +k2               9.349e-03 7.243e-03   0.01207
    +g                4.299e-01 2.432e-01   0.63890
    +
    +Resulting formation fractions:
    +                  ff
    +cyan_JCZ38  0.660808
    +cyan_J9Z38  0.241904
    +cyan_sink   0.097288
    +JCZ38_JSE76 0.960085
    +JCZ38_sink  0.039915
    +JSE76_JCZ38 0.996373
    +JSE76_sink  0.003627
    +
    +Estimated disappearance times:
    +         DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   24.359 186.18    56.05   7.555   74.14
    +JCZ38   8.397  27.89       NA      NA      NA
    +J9Z38 111.631 370.83       NA      NA      NA
    +JSE76  17.017  56.53       NA      NA      NA
    +
    +
    +

    + +Hierarchical SFORB path 2 fit with constant variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:38:37 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1279.102 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +             102.4394               -2.7673               -2.8942 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +              -3.6201               -2.3107               -5.3123 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +              -3.7120                0.6754                1.1448 
    +       f_JCZ38_qlogis        f_JSE76_qlogis 
    +              13.2672               13.3538 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 4.589          0.0000                  0.00
    +log_k_cyan_free             0.000          0.4849                  0.00
    +log_k_cyan_free_bound       0.000          0.0000                  1.62
    +log_k_cyan_bound_free       0.000          0.0000                  0.00
    +log_k_JCZ38                 0.000          0.0000                  0.00
    +log_k_J9Z38                 0.000          0.0000                  0.00
    +log_k_JSE76                 0.000          0.0000                  0.00
    +f_cyan_ilr_1                0.000          0.0000                  0.00
    +f_cyan_ilr_2                0.000          0.0000                  0.00
    +f_JCZ38_qlogis              0.000          0.0000                  0.00
    +f_JSE76_qlogis              0.000          0.0000                  0.00
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000      0.0000       0.000         0.0
    +log_k_cyan_free                       0.000      0.0000       0.000         0.0
    +log_k_cyan_free_bound                 0.000      0.0000       0.000         0.0
    +log_k_cyan_bound_free                 1.197      0.0000       0.000         0.0
    +log_k_JCZ38                           0.000      0.7966       0.000         0.0
    +log_k_J9Z38                           0.000      0.0000       1.561         0.0
    +log_k_JSE76                           0.000      0.0000       0.000         0.8
    +f_cyan_ilr_1                          0.000      0.0000       0.000         0.0
    +f_cyan_ilr_2                          0.000      0.0000       0.000         0.0
    +f_JCZ38_qlogis                        0.000      0.0000       0.000         0.0
    +f_JSE76_qlogis                        0.000      0.0000       0.000         0.0
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis
    +cyan_free_0                 0.0000        0.000           0.00           0.00
    +log_k_cyan_free             0.0000        0.000           0.00           0.00
    +log_k_cyan_free_bound       0.0000        0.000           0.00           0.00
    +log_k_cyan_bound_free       0.0000        0.000           0.00           0.00
    +log_k_JCZ38                 0.0000        0.000           0.00           0.00
    +log_k_J9Z38                 0.0000        0.000           0.00           0.00
    +log_k_JSE76                 0.0000        0.000           0.00           0.00
    +f_cyan_ilr_1                0.6349        0.000           0.00           0.00
    +f_cyan_ilr_2                0.0000        1.797           0.00           0.00
    +f_JCZ38_qlogis              0.0000        0.000          13.84           0.00
    +f_JSE76_qlogis              0.0000        0.000           0.00          14.66
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2284 2275  -1120
    +
    +Optimised parameters:
    +                             est.      lower      upper
    +cyan_free_0              102.7730  1.015e+02  1.041e+02
    +log_k_cyan_free           -2.8530 -3.167e+00 -2.539e+00
    +log_k_cyan_free_bound     -2.7326 -3.543e+00 -1.922e+00
    +log_k_cyan_bound_free     -3.5582 -4.126e+00 -2.990e+00
    +log_k_JCZ38               -2.3810 -2.921e+00 -1.841e+00
    +log_k_J9Z38               -5.2301 -5.963e+00 -4.497e+00
    +log_k_JSE76               -3.0286 -4.286e+00 -1.771e+00
    +f_cyan_ilr_1               0.7081  3.733e-01  1.043e+00
    +f_cyan_ilr_2               0.5847  7.846e-03  1.162e+00
    +f_JCZ38_qlogis             9.5676 -1.323e+03  1.342e+03
    +f_JSE76_qlogis             3.7042  7.254e-02  7.336e+00
    +a.1                        2.7222  2.532e+00  2.913e+00
    +SD.log_k_cyan_free         0.3338  1.086e-01  5.589e-01
    +SD.log_k_cyan_free_bound   0.8888  3.023e-01  1.475e+00
    +SD.log_k_cyan_bound_free   0.6220  2.063e-01  1.038e+00
    +SD.log_k_JCZ38             0.5221  1.334e-01  9.108e-01
    +SD.log_k_J9Z38             0.7104  1.371e-01  1.284e+00
    +SD.log_k_JSE76             1.3837  4.753e-01  2.292e+00
    +SD.f_cyan_ilr_1            0.3620  1.248e-01  5.992e-01
    +SD.f_cyan_ilr_2            0.4259  8.145e-02  7.704e-01
    +SD.f_JCZ38_qlogis          3.5332 -1.037e+05  1.037e+05
    +SD.f_JSE76_qlogis          1.6990 -2.771e-01  3.675e+00
    +
    +Correlation: 
    +                      cyn_f_0 lg_k_c_ lg_k_cyn_f_ lg_k_cyn_b_ l__JCZ3 l__J9Z3
    +log_k_cyan_free        0.2126                                                
    +log_k_cyan_free_bound  0.0894  0.0871                                        
    +log_k_cyan_bound_free  0.0033  0.0410  0.0583                                
    +log_k_JCZ38           -0.0708 -0.0280 -0.0147      0.0019                    
    +log_k_J9Z38           -0.0535 -0.0138  0.0012      0.0148      0.0085        
    +log_k_JSE76           -0.0066 -0.0030 -0.0021     -0.0005      0.1090  0.0010
    +f_cyan_ilr_1          -0.0364 -0.0157 -0.0095     -0.0015      0.0458 -0.0960
    +f_cyan_ilr_2          -0.3814 -0.1104 -0.0423      0.0146      0.1540  0.1526
    +f_JCZ38_qlogis         0.2507  0.0969  0.0482     -0.0097     -0.2282 -0.0363
    +f_JSE76_qlogis        -0.1648 -0.0710 -0.0443     -0.0087      0.2002  0.0226
    +                      l__JSE7 f_cy__1 f_cy__2 f_JCZ38
    +log_k_cyan_free                                      
    +log_k_cyan_free_bound                                
    +log_k_cyan_bound_free                                
    +log_k_JCZ38                                          
    +log_k_J9Z38                                          
    +log_k_JSE76                                          
    +f_cyan_ilr_1           0.0001                        
    +f_cyan_ilr_2           0.0031  0.0586                
    +f_JCZ38_qlogis         0.0023 -0.1867 -0.6255        
    +f_JSE76_qlogis         0.0082  0.1356  0.4519 -0.7951
    +
    +Random effects:
    +                           est.      lower     upper
    +SD.log_k_cyan_free       0.3338  1.086e-01 5.589e-01
    +SD.log_k_cyan_free_bound 0.8888  3.023e-01 1.475e+00
    +SD.log_k_cyan_bound_free 0.6220  2.063e-01 1.038e+00
    +SD.log_k_JCZ38           0.5221  1.334e-01 9.108e-01
    +SD.log_k_J9Z38           0.7104  1.371e-01 1.284e+00
    +SD.log_k_JSE76           1.3837  4.753e-01 2.292e+00
    +SD.f_cyan_ilr_1          0.3620  1.248e-01 5.992e-01
    +SD.f_cyan_ilr_2          0.4259  8.145e-02 7.704e-01
    +SD.f_JCZ38_qlogis        3.5332 -1.037e+05 1.037e+05
    +SD.f_JSE76_qlogis        1.6990 -2.771e-01 3.675e+00
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.722 2.532 2.913
    +
    +Backtransformed parameters:
    +                          est.     lower     upper
    +cyan_free_0          1.028e+02 1.015e+02 104.06475
    +k_cyan_free          5.767e-02 4.213e-02   0.07894
    +k_cyan_free_bound    6.505e-02 2.892e-02   0.14633
    +k_cyan_bound_free    2.849e-02 1.614e-02   0.05028
    +k_JCZ38              9.246e-02 5.390e-02   0.15859
    +k_J9Z38              5.353e-03 2.572e-03   0.01114
    +k_JSE76              4.838e-02 1.376e-02   0.17009
    +f_cyan_free_to_JCZ38 6.011e-01 5.028e-01   0.83792
    +f_cyan_free_to_J9Z38 2.208e-01 5.028e-01   0.83792
    +f_JCZ38_to_JSE76     9.999e-01 0.000e+00   1.00000
    +f_JSE76_to_JCZ38     9.760e-01 5.181e-01   0.99935
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    +0.13942 0.01178 0.35948 
    +
    +Resulting formation fractions:
    +                       ff
    +cyan_free_JCZ38 6.011e-01
    +cyan_free_J9Z38 2.208e-01
    +cyan_free_sink  1.780e-01
    +cyan_free       1.000e+00
    +JCZ38_JSE76     9.999e-01
    +JCZ38_sink      6.996e-05
    +JSE76_JCZ38     9.760e-01
    +JSE76_sink      2.403e-02
    +
    +Estimated disappearance times:
    +         DT50   DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   23.390 157.60    47.44        4.971        58.82
    +JCZ38   7.497  24.90       NA           NA           NA
    +J9Z38 129.482 430.13       NA           NA           NA
    +JSE76  14.326  47.59       NA           NA           NA
    +
    +
    +

    + +Hierarchical SFORB path 2 fit with two-component error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 10:46:02 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1723.343 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +              101.751                -2.837                -3.016 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +               -3.660                -2.299                -5.313 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +               -3.699                 0.672                 5.873 
    +       f_JCZ38_qlogis        f_JSE76_qlogis 
    +               13.216                13.338 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 5.629           0.000                 0.000
    +log_k_cyan_free             0.000           0.446                 0.000
    +log_k_cyan_free_bound       0.000           0.000                 1.449
    +log_k_cyan_bound_free       0.000           0.000                 0.000
    +log_k_JCZ38                 0.000           0.000                 0.000
    +log_k_J9Z38                 0.000           0.000                 0.000
    +log_k_JSE76                 0.000           0.000                 0.000
    +f_cyan_ilr_1                0.000           0.000                 0.000
    +f_cyan_ilr_2                0.000           0.000                 0.000
    +f_JCZ38_qlogis              0.000           0.000                 0.000
    +f_JSE76_qlogis              0.000           0.000                 0.000
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000      0.0000       0.000      0.0000
    +log_k_cyan_free                       0.000      0.0000       0.000      0.0000
    +log_k_cyan_free_bound                 0.000      0.0000       0.000      0.0000
    +log_k_cyan_bound_free                 1.213      0.0000       0.000      0.0000
    +log_k_JCZ38                           0.000      0.7801       0.000      0.0000
    +log_k_J9Z38                           0.000      0.0000       1.575      0.0000
    +log_k_JSE76                           0.000      0.0000       0.000      0.8078
    +f_cyan_ilr_1                          0.000      0.0000       0.000      0.0000
    +f_cyan_ilr_2                          0.000      0.0000       0.000      0.0000
    +f_JCZ38_qlogis                        0.000      0.0000       0.000      0.0000
    +f_JSE76_qlogis                        0.000      0.0000       0.000      0.0000
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis
    +cyan_free_0                 0.0000         0.00           0.00           0.00
    +log_k_cyan_free             0.0000         0.00           0.00           0.00
    +log_k_cyan_free_bound       0.0000         0.00           0.00           0.00
    +log_k_cyan_bound_free       0.0000         0.00           0.00           0.00
    +log_k_JCZ38                 0.0000         0.00           0.00           0.00
    +log_k_J9Z38                 0.0000         0.00           0.00           0.00
    +log_k_JSE76                 0.0000         0.00           0.00           0.00
    +f_cyan_ilr_1                0.6519         0.00           0.00           0.00
    +f_cyan_ilr_2                0.0000        10.78           0.00           0.00
    +f_JCZ38_qlogis              0.0000         0.00          13.96           0.00
    +f_JSE76_qlogis              0.0000         0.00           0.00          14.69
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2240 2232  -1098
    +
    +Optimised parameters:
    +                              est.     lower    upper
    +cyan_free_0              101.10205  98.99221 103.2119
    +log_k_cyan_free           -3.16929  -3.61395  -2.7246
    +log_k_cyan_free_bound     -3.38259  -3.63022  -3.1350
    +log_k_cyan_bound_free     -3.81075  -4.13888  -3.4826
    +log_k_JCZ38               -2.42057  -3.00756  -1.8336
    +log_k_J9Z38               -5.07501  -5.85138  -4.2986
    +log_k_JSE76               -3.12442  -4.21277  -2.0361
    +f_cyan_ilr_1               0.70577   0.35788   1.0537
    +f_cyan_ilr_2               1.14824   0.15810   2.1384
    +f_JCZ38_qlogis             3.52245   0.43257   6.6123
    +f_JSE76_qlogis             5.65140 -21.22295  32.5257
    +a.1                        2.07062   1.84329   2.2980
    +b.1                        0.06227   0.05124   0.0733
    +SD.log_k_cyan_free         0.49468   0.18566   0.8037
    +SD.log_k_cyan_bound_free   0.28972   0.07188   0.5076
    +SD.log_k_JCZ38             0.58852   0.16800   1.0090
    +SD.log_k_J9Z38             0.82500   0.24730   1.4027
    +SD.log_k_JSE76             1.19201   0.40313   1.9809
    +SD.f_cyan_ilr_1            0.38534   0.13640   0.6343
    +SD.f_cyan_ilr_2            0.72463   0.10076   1.3485
    +SD.f_JCZ38_qlogis          1.38223  -0.20997   2.9744
    +SD.f_JSE76_qlogis          2.07989 -72.53027  76.6901
    +
    +Correlation: 
    +                      cyn_f_0 lg_k_c_ lg_k_cyn_f_ lg_k_cyn_b_ l__JCZ3 l__J9Z3
    +log_k_cyan_free        0.1117                                                
    +log_k_cyan_free_bound  0.1763  0.1828                                        
    +log_k_cyan_bound_free  0.0120  0.0593  0.5030                                
    +log_k_JCZ38           -0.0459 -0.0230 -0.0931     -0.0337                    
    +log_k_J9Z38           -0.0381 -0.0123 -0.0139      0.0237      0.0063        
    +log_k_JSE76           -0.0044 -0.0038 -0.0175     -0.0072      0.1120  0.0003
    +f_cyan_ilr_1          -0.0199 -0.0087 -0.0407     -0.0233      0.0268 -0.0552
    +f_cyan_ilr_2          -0.4806 -0.1015 -0.2291     -0.0269      0.1156  0.1113
    +f_JCZ38_qlogis         0.1805  0.0825  0.3085      0.0963     -0.1674 -0.0314
    +f_JSE76_qlogis        -0.1586 -0.0810 -0.3560     -0.1563      0.2025  0.0278
    +                      l__JSE7 f_cy__1 f_cy__2 f_JCZ38
    +log_k_cyan_free                                      
    +log_k_cyan_free_bound                                
    +log_k_cyan_bound_free                                
    +log_k_JCZ38                                          
    +log_k_J9Z38                                          
    +log_k_JSE76                                          
    +f_cyan_ilr_1           0.0024                        
    +f_cyan_ilr_2           0.0087  0.0172                
    +f_JCZ38_qlogis        -0.0016 -0.1047 -0.4656        
    +f_JSE76_qlogis         0.0119  0.1034  0.4584 -0.8137
    +
    +Random effects:
    +                           est.     lower   upper
    +SD.log_k_cyan_free       0.4947   0.18566  0.8037
    +SD.log_k_cyan_bound_free 0.2897   0.07188  0.5076
    +SD.log_k_JCZ38           0.5885   0.16800  1.0090
    +SD.log_k_J9Z38           0.8250   0.24730  1.4027
    +SD.log_k_JSE76           1.1920   0.40313  1.9809
    +SD.f_cyan_ilr_1          0.3853   0.13640  0.6343
    +SD.f_cyan_ilr_2          0.7246   0.10076  1.3485
    +SD.f_JCZ38_qlogis        1.3822  -0.20997  2.9744
    +SD.f_JSE76_qlogis        2.0799 -72.53027 76.6901
    +
    +Variance model:
    +       est.   lower  upper
    +a.1 2.07062 1.84329 2.2980
    +b.1 0.06227 0.05124 0.0733
    +
    +Backtransformed parameters:
    +                          est.     lower     upper
    +cyan_free_0          1.011e+02 9.899e+01 103.21190
    +k_cyan_free          4.203e-02 2.695e-02   0.06557
    +k_cyan_free_bound    3.396e-02 2.651e-02   0.04350
    +k_cyan_bound_free    2.213e-02 1.594e-02   0.03073
    +k_JCZ38              8.887e-02 4.941e-02   0.15984
    +k_J9Z38              6.251e-03 2.876e-03   0.01359
    +k_JSE76              4.396e-02 1.481e-02   0.13054
    +f_cyan_free_to_JCZ38 6.590e-01 5.557e-01   0.95365
    +f_cyan_free_to_J9Z38 2.429e-01 5.557e-01   0.95365
    +f_JCZ38_to_JSE76     9.713e-01 6.065e-01   0.99866
    +f_JSE76_to_JCZ38     9.965e-01 6.067e-10   1.00000
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    +0.08749 0.01063 0.40855 
    +
    +Resulting formation fractions:
    +                     ff
    +cyan_free_JCZ38 0.65905
    +cyan_free_J9Z38 0.24291
    +cyan_free_sink  0.09805
    +cyan_free       1.00000
    +JCZ38_JSE76     0.97132
    +JCZ38_sink      0.02868
    +JSE76_JCZ38     0.99650
    +JSE76_sink      0.00350
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   24.91 167.16    50.32        7.922        65.19
    +JCZ38   7.80  25.91       NA           NA           NA
    +J9Z38 110.89 368.36       NA           NA           NA
    +JSE76  15.77  52.38       NA           NA           NA
    +
    +
    +

    +
    +
    +

    Pathway 2, refined fits +

    + +Hierarchical FOMC path 2 fit with reduced random effects, two-component +error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:18:41 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - (alpha/beta) * 1/((time/beta) + 1) * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_JCZ38 * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * (alpha/beta) * 1/((time/beta) + 1) *
    +           cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1957.271 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.9028        -1.9055        -5.0249        -2.5646         0.6807 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis      log_alpha       log_beta 
    +        4.8883        16.0676         9.3923        -0.1346         3.0364 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          6.321       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       1.392       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.561       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       3.614       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6339
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +f_JSE76_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_alpha       0.000       0.000       0.000       0.000       0.0000
    +log_beta        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_alpha log_beta
    +cyan_0                 0.00           0.00           0.00    0.0000   0.0000
    +log_k_JCZ38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_J9Z38            0.00           0.00           0.00    0.0000   0.0000
    +log_k_JSE76            0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_1           0.00           0.00           0.00    0.0000   0.0000
    +f_cyan_ilr_2          10.41           0.00           0.00    0.0000   0.0000
    +f_JCZ38_qlogis         0.00          12.24           0.00    0.0000   0.0000
    +f_JSE76_qlogis         0.00           0.00          15.13    0.0000   0.0000
    +log_alpha              0.00           0.00           0.00    0.3701   0.0000
    +log_beta               0.00           0.00           0.00    0.0000   0.5662
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2251 2244  -1106
    +
    +Optimised parameters:
    +                      est.   lower   upper
    +cyan_0           101.05768      NA      NA
    +log_k_JCZ38       -2.73252      NA      NA
    +log_k_J9Z38       -5.07399      NA      NA
    +log_k_JSE76       -3.52863      NA      NA
    +f_cyan_ilr_1       0.72176      NA      NA
    +f_cyan_ilr_2       1.34610      NA      NA
    +f_JCZ38_qlogis     2.08337      NA      NA
    +f_JSE76_qlogis  1590.31880      NA      NA
    +log_alpha         -0.09336      NA      NA
    +log_beta           3.10191      NA      NA
    +a.1                2.08557 1.85439 2.31675
    +b.1                0.06998 0.05800 0.08197
    +SD.log_k_JCZ38     1.20053 0.43329 1.96777
    +SD.log_k_J9Z38     0.85854 0.26708 1.45000
    +SD.log_k_JSE76     0.62528 0.16061 1.08995
    +SD.f_cyan_ilr_1    0.35190 0.12340 0.58039
    +SD.f_cyan_ilr_2    0.85385 0.15391 1.55378
    +SD.log_alpha       0.28971 0.08718 0.49225
    +SD.log_beta        0.31614 0.05938 0.57290
    +
    +Correlation is not available
    +
    +Random effects:
    +                  est.   lower  upper
    +SD.log_k_JCZ38  1.2005 0.43329 1.9678
    +SD.log_k_J9Z38  0.8585 0.26708 1.4500
    +SD.log_k_JSE76  0.6253 0.16061 1.0900
    +SD.f_cyan_ilr_1 0.3519 0.12340 0.5804
    +SD.f_cyan_ilr_2 0.8538 0.15391 1.5538
    +SD.log_alpha    0.2897 0.08718 0.4923
    +SD.log_beta     0.3161 0.05938 0.5729
    +
    +Variance model:
    +       est. lower   upper
    +a.1 2.08557 1.854 2.31675
    +b.1 0.06998 0.058 0.08197
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.011e+02    NA    NA
    +k_JCZ38          6.506e-02    NA    NA
    +k_J9Z38          6.257e-03    NA    NA
    +k_JSE76          2.935e-02    NA    NA
    +f_cyan_to_JCZ38  6.776e-01    NA    NA
    +f_cyan_to_J9Z38  2.442e-01    NA    NA
    +f_JCZ38_to_JSE76 8.893e-01    NA    NA
    +f_JSE76_to_JCZ38 1.000e+00    NA    NA
    +alpha            9.109e-01    NA    NA
    +beta             2.224e+01    NA    NA
    +
    +Resulting formation fractions:
    +                 ff
    +cyan_JCZ38  0.67761
    +cyan_J9Z38  0.24417
    +cyan_sink   0.07822
    +JCZ38_JSE76 0.88928
    +JCZ38_sink  0.11072
    +JSE76_JCZ38 1.00000
    +JSE76_sink  0.00000
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back
    +cyan   25.36 256.37    77.18
    +JCZ38  10.65  35.39       NA
    +J9Z38 110.77 367.98       NA
    +JSE76  23.62  78.47       NA
    +
    +
    +

    + +Hierarchical DFOP path 2 fit with reduced random effects, constant +variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:16:32 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38 +
    +           f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1828.403 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      102.4358        -2.3107        -5.3123        -3.7120         0.6753 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis         log_k1         log_k2 
    +        1.1462        12.4095        12.3630        -1.9317        -4.4557 
    +      g_qlogis 
    +       -0.5648 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          4.594      0.0000       0.000         0.0       0.0000
    +log_k_JCZ38     0.000      0.7966       0.000         0.0       0.0000
    +log_k_J9Z38     0.000      0.0000       1.561         0.0       0.0000
    +log_k_JSE76     0.000      0.0000       0.000         0.8       0.0000
    +f_cyan_ilr_1    0.000      0.0000       0.000         0.0       0.6349
    +f_cyan_ilr_2    0.000      0.0000       0.000         0.0       0.0000
    +f_JCZ38_qlogis  0.000      0.0000       0.000         0.0       0.0000
    +f_JSE76_qlogis  0.000      0.0000       0.000         0.0       0.0000
    +log_k1          0.000      0.0000       0.000         0.0       0.0000
    +log_k2          0.000      0.0000       0.000         0.0       0.0000
    +g_qlogis        0.000      0.0000       0.000         0.0       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_k1 log_k2
    +cyan_0                0.000           0.00            0.0  0.000 0.0000
    +log_k_JCZ38           0.000           0.00            0.0  0.000 0.0000
    +log_k_J9Z38           0.000           0.00            0.0  0.000 0.0000
    +log_k_JSE76           0.000           0.00            0.0  0.000 0.0000
    +f_cyan_ilr_1          0.000           0.00            0.0  0.000 0.0000
    +f_cyan_ilr_2          1.797           0.00            0.0  0.000 0.0000
    +f_JCZ38_qlogis        0.000          13.85            0.0  0.000 0.0000
    +f_JSE76_qlogis        0.000           0.00           14.1  0.000 0.0000
    +log_k1                0.000           0.00            0.0  1.106 0.0000
    +log_k2                0.000           0.00            0.0  0.000 0.6141
    +g_qlogis              0.000           0.00            0.0  0.000 0.0000
    +               g_qlogis
    +cyan_0            0.000
    +log_k_JCZ38       0.000
    +log_k_J9Z38       0.000
    +log_k_JSE76       0.000
    +f_cyan_ilr_1      0.000
    +f_cyan_ilr_2      0.000
    +f_JCZ38_qlogis    0.000
    +f_JSE76_qlogis    0.000
    +log_k1            0.000
    +log_k2            0.000
    +g_qlogis          1.595
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2282 2274  -1121
    +
    +Optimised parameters:
    +                     est.   lower  upper
    +cyan_0           102.5254      NA     NA
    +log_k_JCZ38       -2.9358      NA     NA
    +log_k_J9Z38       -5.1424      NA     NA
    +log_k_JSE76       -3.6458      NA     NA
    +f_cyan_ilr_1       0.6957      NA     NA
    +f_cyan_ilr_2       0.6635      NA     NA
    +f_JCZ38_qlogis  4984.8163      NA     NA
    +f_JSE76_qlogis     1.9415      NA     NA
    +log_k1            -1.9456      NA     NA
    +log_k2            -4.4705      NA     NA
    +g_qlogis          -0.5117      NA     NA
    +a.1                2.7455 2.55392 2.9370
    +SD.log_k_JCZ38     1.3163 0.47635 2.1563
    +SD.log_k_J9Z38     0.7162 0.16133 1.2711
    +SD.log_k_JSE76     0.6457 0.15249 1.1390
    +SD.f_cyan_ilr_1    0.3424 0.11714 0.5677
    +SD.f_cyan_ilr_2    0.4524 0.09709 0.8077
    +SD.log_k1          0.7353 0.25445 1.2161
    +SD.log_k2          0.5137 0.18206 0.8453
    +SD.g_qlogis        0.9857 0.35651 1.6148
    +
    +Correlation is not available
    +
    +Random effects:
    +                  est.   lower  upper
    +SD.log_k_JCZ38  1.3163 0.47635 2.1563
    +SD.log_k_J9Z38  0.7162 0.16133 1.2711
    +SD.log_k_JSE76  0.6457 0.15249 1.1390
    +SD.f_cyan_ilr_1 0.3424 0.11714 0.5677
    +SD.f_cyan_ilr_2 0.4524 0.09709 0.8077
    +SD.log_k1       0.7353 0.25445 1.2161
    +SD.log_k2       0.5137 0.18206 0.8453
    +SD.g_qlogis     0.9857 0.35651 1.6148
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.745 2.554 2.937
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.025e+02    NA    NA
    +k_JCZ38          5.309e-02    NA    NA
    +k_J9Z38          5.844e-03    NA    NA
    +k_JSE76          2.610e-02    NA    NA
    +f_cyan_to_JCZ38  6.079e-01    NA    NA
    +f_cyan_to_J9Z38  2.272e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +f_JSE76_to_JCZ38 8.745e-01    NA    NA
    +k1               1.429e-01    NA    NA
    +k2               1.144e-02    NA    NA
    +g                3.748e-01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.6079
    +cyan_J9Z38  0.2272
    +cyan_sink   0.1649
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +JSE76_JCZ38 0.8745
    +JSE76_sink  0.1255
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   22.29 160.20    48.22    4.85   60.58
    +JCZ38  13.06  43.37       NA      NA      NA
    +J9Z38 118.61 394.02       NA      NA      NA
    +JSE76  26.56  88.22       NA      NA      NA
    +
    +
    +

    + +Hierarchical DFOP path 2 fit with reduced random effects, two-component +error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:28 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * cyan
    +d_JCZ38/dt = + f_cyan_to_JCZ38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_JCZ38 * JCZ38 +
    +           f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_to_J9Z38 * ((k1 * g * exp(-k1 * time) + k2 * (1 -
    +           g) * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
    +           exp(-k2 * time))) * cyan - k_J9Z38 * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 2183.989 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +        cyan_0    log_k_JCZ38    log_k_J9Z38    log_k_JSE76   f_cyan_ilr_1 
    +      101.7523        -1.5948        -5.0119        -2.2723         0.6719 
    +  f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis         log_k1         log_k2 
    +        5.1681        12.8238        12.4130        -2.0057        -4.5526 
    +      g_qlogis 
    +       -0.5805 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +               cyan_0 log_k_JCZ38 log_k_J9Z38 log_k_JSE76 f_cyan_ilr_1
    +cyan_0          5.627       0.000       0.000       0.000       0.0000
    +log_k_JCZ38     0.000       2.327       0.000       0.000       0.0000
    +log_k_J9Z38     0.000       0.000       1.664       0.000       0.0000
    +log_k_JSE76     0.000       0.000       0.000       4.566       0.0000
    +f_cyan_ilr_1    0.000       0.000       0.000       0.000       0.6519
    +f_cyan_ilr_2    0.000       0.000       0.000       0.000       0.0000
    +f_JCZ38_qlogis  0.000       0.000       0.000       0.000       0.0000
    +f_JSE76_qlogis  0.000       0.000       0.000       0.000       0.0000
    +log_k1          0.000       0.000       0.000       0.000       0.0000
    +log_k2          0.000       0.000       0.000       0.000       0.0000
    +g_qlogis        0.000       0.000       0.000       0.000       0.0000
    +               f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis log_k1 log_k2
    +cyan_0                  0.0           0.00           0.00 0.0000 0.0000
    +log_k_JCZ38             0.0           0.00           0.00 0.0000 0.0000
    +log_k_J9Z38             0.0           0.00           0.00 0.0000 0.0000
    +log_k_JSE76             0.0           0.00           0.00 0.0000 0.0000
    +f_cyan_ilr_1            0.0           0.00           0.00 0.0000 0.0000
    +f_cyan_ilr_2           10.1           0.00           0.00 0.0000 0.0000
    +f_JCZ38_qlogis          0.0          13.99           0.00 0.0000 0.0000
    +f_JSE76_qlogis          0.0           0.00          14.15 0.0000 0.0000
    +log_k1                  0.0           0.00           0.00 0.8452 0.0000
    +log_k2                  0.0           0.00           0.00 0.0000 0.5968
    +g_qlogis                0.0           0.00           0.00 0.0000 0.0000
    +               g_qlogis
    +cyan_0            0.000
    +log_k_JCZ38       0.000
    +log_k_J9Z38       0.000
    +log_k_JSE76       0.000
    +f_cyan_ilr_1      0.000
    +f_cyan_ilr_2      0.000
    +f_JCZ38_qlogis    0.000
    +f_JSE76_qlogis    0.000
    +log_k1            0.000
    +log_k2            0.000
    +g_qlogis          1.691
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2232 2224  -1096
    +
    +Optimised parameters:
    +                     est.   lower   upper
    +cyan_0          101.20051      NA      NA
    +log_k_JCZ38      -2.93542      NA      NA
    +log_k_J9Z38      -5.03151      NA      NA
    +log_k_JSE76      -3.67679      NA      NA
    +f_cyan_ilr_1      0.67290      NA      NA
    +f_cyan_ilr_2      0.99787      NA      NA
    +f_JCZ38_qlogis  348.32484      NA      NA
    +f_JSE76_qlogis    1.87846      NA      NA
    +log_k1           -2.32738      NA      NA
    +log_k2           -4.61295      NA      NA
    +g_qlogis         -0.38342      NA      NA
    +a.1               2.06184 1.83746 2.28622
    +b.1               0.06329 0.05211 0.07447
    +SD.log_k_JCZ38    1.29042 0.47468 2.10617
    +SD.log_k_J9Z38    0.84235 0.25903 1.42566
    +SD.log_k_JSE76    0.56930 0.13934 0.99926
    +SD.f_cyan_ilr_1   0.35183 0.12298 0.58068
    +SD.f_cyan_ilr_2   0.77269 0.17908 1.36631
    +SD.log_k2         0.28549 0.09210 0.47888
    +SD.g_qlogis       0.93830 0.34568 1.53093
    +
    +Correlation is not available
    +
    +Random effects:
    +                  est.  lower  upper
    +SD.log_k_JCZ38  1.2904 0.4747 2.1062
    +SD.log_k_J9Z38  0.8423 0.2590 1.4257
    +SD.log_k_JSE76  0.5693 0.1393 0.9993
    +SD.f_cyan_ilr_1 0.3518 0.1230 0.5807
    +SD.f_cyan_ilr_2 0.7727 0.1791 1.3663
    +SD.log_k2       0.2855 0.0921 0.4789
    +SD.g_qlogis     0.9383 0.3457 1.5309
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 2.06184 1.83746 2.28622
    +b.1 0.06329 0.05211 0.07447
    +
    +Backtransformed parameters:
    +                      est. lower upper
    +cyan_0           1.012e+02    NA    NA
    +k_JCZ38          5.311e-02    NA    NA
    +k_J9Z38          6.529e-03    NA    NA
    +k_JSE76          2.530e-02    NA    NA
    +f_cyan_to_JCZ38  6.373e-01    NA    NA
    +f_cyan_to_J9Z38  2.461e-01    NA    NA
    +f_JCZ38_to_JSE76 1.000e+00    NA    NA
    +f_JSE76_to_JCZ38 8.674e-01    NA    NA
    +k1               9.755e-02    NA    NA
    +k2               9.922e-03    NA    NA
    +g                4.053e-01    NA    NA
    +
    +Resulting formation fractions:
    +                ff
    +cyan_JCZ38  0.6373
    +cyan_J9Z38  0.2461
    +cyan_sink   0.1167
    +JCZ38_JSE76 1.0000
    +JCZ38_sink  0.0000
    +JSE76_JCZ38 0.8674
    +JSE76_sink  0.1326
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_k1 DT50_k2
    +cyan   24.93 179.68    54.09   7.105   69.86
    +JCZ38  13.05  43.36       NA      NA      NA
    +J9Z38 106.16 352.67       NA      NA      NA
    +JSE76  27.39  91.00       NA      NA      NA
    +
    +
    +

    + +Hierarchical SFORB path 2 fit with reduced random effects, constant +variance + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:17:37 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 1893.29 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +             102.4394               -2.7673               -2.8942 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +              -3.6201               -2.3107               -5.3123 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +              -3.7120                0.6754                1.1448 
    +       f_JCZ38_qlogis        f_JSE76_qlogis 
    +              13.2672               13.3538 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 4.589          0.0000                  0.00
    +log_k_cyan_free             0.000          0.4849                  0.00
    +log_k_cyan_free_bound       0.000          0.0000                  1.62
    +log_k_cyan_bound_free       0.000          0.0000                  0.00
    +log_k_JCZ38                 0.000          0.0000                  0.00
    +log_k_J9Z38                 0.000          0.0000                  0.00
    +log_k_JSE76                 0.000          0.0000                  0.00
    +f_cyan_ilr_1                0.000          0.0000                  0.00
    +f_cyan_ilr_2                0.000          0.0000                  0.00
    +f_JCZ38_qlogis              0.000          0.0000                  0.00
    +f_JSE76_qlogis              0.000          0.0000                  0.00
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000      0.0000       0.000         0.0
    +log_k_cyan_free                       0.000      0.0000       0.000         0.0
    +log_k_cyan_free_bound                 0.000      0.0000       0.000         0.0
    +log_k_cyan_bound_free                 1.197      0.0000       0.000         0.0
    +log_k_JCZ38                           0.000      0.7966       0.000         0.0
    +log_k_J9Z38                           0.000      0.0000       1.561         0.0
    +log_k_JSE76                           0.000      0.0000       0.000         0.8
    +f_cyan_ilr_1                          0.000      0.0000       0.000         0.0
    +f_cyan_ilr_2                          0.000      0.0000       0.000         0.0
    +f_JCZ38_qlogis                        0.000      0.0000       0.000         0.0
    +f_JSE76_qlogis                        0.000      0.0000       0.000         0.0
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis
    +cyan_free_0                 0.0000        0.000           0.00           0.00
    +log_k_cyan_free             0.0000        0.000           0.00           0.00
    +log_k_cyan_free_bound       0.0000        0.000           0.00           0.00
    +log_k_cyan_bound_free       0.0000        0.000           0.00           0.00
    +log_k_JCZ38                 0.0000        0.000           0.00           0.00
    +log_k_J9Z38                 0.0000        0.000           0.00           0.00
    +log_k_JSE76                 0.0000        0.000           0.00           0.00
    +f_cyan_ilr_1                0.6349        0.000           0.00           0.00
    +f_cyan_ilr_2                0.0000        1.797           0.00           0.00
    +f_JCZ38_qlogis              0.0000        0.000          13.84           0.00
    +f_JSE76_qlogis              0.0000        0.000           0.00          14.66
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2279 2272  -1120
    +
    +Optimised parameters:
    +                              est.   lower  upper
    +cyan_free_0               102.5621      NA     NA
    +log_k_cyan_free            -2.8531      NA     NA
    +log_k_cyan_free_bound      -2.6916      NA     NA
    +log_k_cyan_bound_free      -3.5032      NA     NA
    +log_k_JCZ38                -2.9436      NA     NA
    +log_k_J9Z38                -5.1140      NA     NA
    +log_k_JSE76                -3.6472      NA     NA
    +f_cyan_ilr_1                0.6887      NA     NA
    +f_cyan_ilr_2                0.6874      NA     NA
    +f_JCZ38_qlogis           4063.6389      NA     NA
    +f_JSE76_qlogis              1.9556      NA     NA
    +a.1                         2.7460 2.55451 2.9376
    +SD.log_k_cyan_free          0.3131 0.09841 0.5277
    +SD.log_k_cyan_free_bound    0.8850 0.29909 1.4710
    +SD.log_k_cyan_bound_free    0.6167 0.20391 1.0295
    +SD.log_k_JCZ38              1.3555 0.49101 2.2200
    +SD.log_k_J9Z38              0.7200 0.16166 1.2783
    +SD.log_k_JSE76              0.6252 0.14619 1.1042
    +SD.f_cyan_ilr_1             0.3386 0.11447 0.5627
    +SD.f_cyan_ilr_2             0.4699 0.09810 0.8417
    +
    +Correlation is not available
    +
    +Random effects:
    +                           est.   lower  upper
    +SD.log_k_cyan_free       0.3131 0.09841 0.5277
    +SD.log_k_cyan_free_bound 0.8850 0.29909 1.4710
    +SD.log_k_cyan_bound_free 0.6167 0.20391 1.0295
    +SD.log_k_JCZ38           1.3555 0.49101 2.2200
    +SD.log_k_J9Z38           0.7200 0.16166 1.2783
    +SD.log_k_JSE76           0.6252 0.14619 1.1042
    +SD.f_cyan_ilr_1          0.3386 0.11447 0.5627
    +SD.f_cyan_ilr_2          0.4699 0.09810 0.8417
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.746 2.555 2.938
    +
    +Backtransformed parameters:
    +                          est. lower upper
    +cyan_free_0          1.026e+02    NA    NA
    +k_cyan_free          5.767e-02    NA    NA
    +k_cyan_free_bound    6.777e-02    NA    NA
    +k_cyan_bound_free    3.010e-02    NA    NA
    +k_JCZ38              5.267e-02    NA    NA
    +k_J9Z38              6.012e-03    NA    NA
    +k_JSE76              2.606e-02    NA    NA
    +f_cyan_free_to_JCZ38 6.089e-01    NA    NA
    +f_cyan_free_to_J9Z38 2.299e-01    NA    NA
    +f_JCZ38_to_JSE76     1.000e+00    NA    NA
    +f_JSE76_to_JCZ38     8.761e-01    NA    NA
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    + 0.1434  0.0121  0.3469 
    +
    +Resulting formation fractions:
    +                    ff
    +cyan_free_JCZ38 0.6089
    +cyan_free_J9Z38 0.2299
    +cyan_free_sink  0.1612
    +cyan_free       1.0000
    +JCZ38_JSE76     1.0000
    +JCZ38_sink      0.0000
    +JSE76_JCZ38     0.8761
    +JSE76_sink      0.1239
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   23.94 155.06    46.68        4.832        57.28
    +JCZ38  13.16  43.71       NA           NA           NA
    +J9Z38 115.30 383.02       NA           NA           NA
    +JSE76  26.59  88.35       NA           NA           NA
    +
    +
    +

    + +Hierarchical SFORB path 2 fit with reduced random effects, two-component +error + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:21:01 2023 
    +Date of summary: Sat Jan 28 11:22:29 2023 
    +
    +Equations:
    +d_cyan_free/dt = - k_cyan_free * cyan_free - k_cyan_free_bound *
    +           cyan_free + k_cyan_bound_free * cyan_bound
    +d_cyan_bound/dt = + k_cyan_free_bound * cyan_free - k_cyan_bound_free *
    +           cyan_bound
    +d_JCZ38/dt = + f_cyan_free_to_JCZ38 * k_cyan_free * cyan_free - k_JCZ38
    +           * JCZ38 + f_JSE76_to_JCZ38 * k_JSE76 * JSE76
    +d_J9Z38/dt = + f_cyan_free_to_J9Z38 * k_cyan_free * cyan_free - k_J9Z38
    +           * J9Z38
    +d_JSE76/dt = + f_JCZ38_to_JSE76 * k_JCZ38 * JCZ38 - k_JSE76 * JSE76
    +
    +Data:
    +433 observations of 4 variable(s) grouped in 5 datasets
    +
    +Model predictions using solution type deSolve 
    +
    +Fitted in 2097.842 s
    +Using 300, 100 iterations and 10 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +          cyan_free_0       log_k_cyan_free log_k_cyan_free_bound 
    +              101.751                -2.837                -3.016 
    +log_k_cyan_bound_free           log_k_JCZ38           log_k_J9Z38 
    +               -3.660                -2.299                -5.313 
    +          log_k_JSE76          f_cyan_ilr_1          f_cyan_ilr_2 
    +               -3.699                 0.672                 5.873 
    +       f_JCZ38_qlogis        f_JSE76_qlogis 
    +               13.216                13.338 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +                      cyan_free_0 log_k_cyan_free log_k_cyan_free_bound
    +cyan_free_0                 5.629           0.000                 0.000
    +log_k_cyan_free             0.000           0.446                 0.000
    +log_k_cyan_free_bound       0.000           0.000                 1.449
    +log_k_cyan_bound_free       0.000           0.000                 0.000
    +log_k_JCZ38                 0.000           0.000                 0.000
    +log_k_J9Z38                 0.000           0.000                 0.000
    +log_k_JSE76                 0.000           0.000                 0.000
    +f_cyan_ilr_1                0.000           0.000                 0.000
    +f_cyan_ilr_2                0.000           0.000                 0.000
    +f_JCZ38_qlogis              0.000           0.000                 0.000
    +f_JSE76_qlogis              0.000           0.000                 0.000
    +                      log_k_cyan_bound_free log_k_JCZ38 log_k_J9Z38 log_k_JSE76
    +cyan_free_0                           0.000      0.0000       0.000      0.0000
    +log_k_cyan_free                       0.000      0.0000       0.000      0.0000
    +log_k_cyan_free_bound                 0.000      0.0000       0.000      0.0000
    +log_k_cyan_bound_free                 1.213      0.0000       0.000      0.0000
    +log_k_JCZ38                           0.000      0.7801       0.000      0.0000
    +log_k_J9Z38                           0.000      0.0000       1.575      0.0000
    +log_k_JSE76                           0.000      0.0000       0.000      0.8078
    +f_cyan_ilr_1                          0.000      0.0000       0.000      0.0000
    +f_cyan_ilr_2                          0.000      0.0000       0.000      0.0000
    +f_JCZ38_qlogis                        0.000      0.0000       0.000      0.0000
    +f_JSE76_qlogis                        0.000      0.0000       0.000      0.0000
    +                      f_cyan_ilr_1 f_cyan_ilr_2 f_JCZ38_qlogis f_JSE76_qlogis
    +cyan_free_0                 0.0000         0.00           0.00           0.00
    +log_k_cyan_free             0.0000         0.00           0.00           0.00
    +log_k_cyan_free_bound       0.0000         0.00           0.00           0.00
    +log_k_cyan_bound_free       0.0000         0.00           0.00           0.00
    +log_k_JCZ38                 0.0000         0.00           0.00           0.00
    +log_k_J9Z38                 0.0000         0.00           0.00           0.00
    +log_k_JSE76                 0.0000         0.00           0.00           0.00
    +f_cyan_ilr_1                0.6519         0.00           0.00           0.00
    +f_cyan_ilr_2                0.0000        10.78           0.00           0.00
    +f_JCZ38_qlogis              0.0000         0.00          13.96           0.00
    +f_JSE76_qlogis              0.0000         0.00           0.00          14.69
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +   AIC  BIC logLik
    +  2236 2228  -1098
    +
    +Optimised parameters:
    +                              est.   lower   upper
    +cyan_free_0              100.72760      NA      NA
    +log_k_cyan_free           -3.18281      NA      NA
    +log_k_cyan_free_bound     -3.37924      NA      NA
    +log_k_cyan_bound_free     -3.77107      NA      NA
    +log_k_JCZ38               -2.92811      NA      NA
    +log_k_J9Z38               -5.02759      NA      NA
    +log_k_JSE76               -3.65835      NA      NA
    +f_cyan_ilr_1               0.67390      NA      NA
    +f_cyan_ilr_2               1.15106      NA      NA
    +f_JCZ38_qlogis           827.82299      NA      NA
    +f_JSE76_qlogis             1.83064      NA      NA
    +a.1                        2.06921 1.84443 2.29399
    +b.1                        0.06391 0.05267 0.07515
    +SD.log_k_cyan_free         0.50518 0.18962 0.82075
    +SD.log_k_cyan_bound_free   0.30991 0.08170 0.53813
    +SD.log_k_JCZ38             1.26661 0.46578 2.06744
    +SD.log_k_J9Z38             0.88272 0.27813 1.48730
    +SD.log_k_JSE76             0.53050 0.12561 0.93538
    +SD.f_cyan_ilr_1            0.35547 0.12461 0.58633
    +SD.f_cyan_ilr_2            0.91446 0.20131 1.62761
    +
    +Correlation is not available
    +
    +Random effects:
    +                           est.  lower  upper
    +SD.log_k_cyan_free       0.5052 0.1896 0.8207
    +SD.log_k_cyan_bound_free 0.3099 0.0817 0.5381
    +SD.log_k_JCZ38           1.2666 0.4658 2.0674
    +SD.log_k_J9Z38           0.8827 0.2781 1.4873
    +SD.log_k_JSE76           0.5305 0.1256 0.9354
    +SD.f_cyan_ilr_1          0.3555 0.1246 0.5863
    +SD.f_cyan_ilr_2          0.9145 0.2013 1.6276
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 2.06921 1.84443 2.29399
    +b.1 0.06391 0.05267 0.07515
    +
    +Backtransformed parameters:
    +                          est. lower upper
    +cyan_free_0          1.007e+02    NA    NA
    +k_cyan_free          4.147e-02    NA    NA
    +k_cyan_free_bound    3.407e-02    NA    NA
    +k_cyan_bound_free    2.303e-02    NA    NA
    +k_JCZ38              5.350e-02    NA    NA
    +k_J9Z38              6.555e-03    NA    NA
    +k_JSE76              2.578e-02    NA    NA
    +f_cyan_free_to_JCZ38 6.505e-01    NA    NA
    +f_cyan_free_to_J9Z38 2.508e-01    NA    NA
    +f_JCZ38_to_JSE76     1.000e+00    NA    NA
    +f_JSE76_to_JCZ38     8.618e-01    NA    NA
    +
    +Estimated Eigenvalues of SFORB model(s):
    +cyan_b1 cyan_b2  cyan_g 
    +0.08768 0.01089 0.39821 
    +
    +Resulting formation fractions:
    +                     ff
    +cyan_free_JCZ38 0.65053
    +cyan_free_J9Z38 0.25082
    +cyan_free_sink  0.09864
    +cyan_free       1.00000
    +JCZ38_JSE76     1.00000
    +JCZ38_sink      0.00000
    +JSE76_JCZ38     0.86184
    +JSE76_sink      0.13816
    +
    +Estimated disappearance times:
    +        DT50   DT90 DT50back DT50_cyan_b1 DT50_cyan_b2
    +cyan   25.32 164.79    49.61        7.906        63.64
    +JCZ38  12.96  43.04       NA           NA           NA
    +J9Z38 105.75 351.29       NA           NA           NA
    +JSE76  26.89  89.33       NA           NA           NA
    +
    +
    +

    +
    +
    +
    +

    Session info +

    +
    R version 4.2.2 Patched (2022-11-10 r83330)
    +Platform: x86_64-pc-linux-gnu (64-bit)
    +Running under: Debian GNU/Linux bookworm/sid
    +
    +Matrix products: default
    +BLAS:   /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
    +LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/libopenblas-r0.3.21.so
    +
    +locale:
    + [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
    + [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
    + [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
    + [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
    + [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    +[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       
    +
    +attached base packages:
    +[1] parallel  stats     graphics  grDevices utils     datasets  methods  
    +[8] base     
    +
    +other attached packages:
    +[1] saemix_3.2 npde_3.3   knitr_1.41 mkin_1.2.2
    +
    +loaded via a namespace (and not attached):
    + [1] mclust_6.0.0      lattice_0.20-45   prettyunits_1.1.1 ps_1.7.2         
    + [5] zoo_1.8-11        assertthat_0.2.1  rprojroot_2.0.3   digest_0.6.31    
    + [9] lmtest_0.9-40     utf8_1.2.2        R6_2.5.1          cellranger_1.1.0 
    +[13] evaluate_0.19     ggplot2_3.4.0     highr_0.9         pillar_1.8.1     
    +[17] rlang_1.0.6       readxl_1.4.1      callr_3.7.3       jquerylib_0.1.4  
    +[21] rmarkdown_2.19    pkgdown_2.0.7     textshaping_0.3.6 desc_1.4.2       
    +[25] stringr_1.5.0     munsell_0.5.0     compiler_4.2.2    xfun_0.35        
    +[29] pkgconfig_2.0.3   systemfonts_1.0.4 pkgbuild_1.4.0    htmltools_0.5.4  
    +[33] tidyselect_1.2.0  tibble_3.1.8      gridExtra_2.3     codetools_0.2-18 
    +[37] fansi_1.0.3       crayon_1.5.2      dplyr_1.0.10      grid_4.2.2       
    +[41] nlme_3.1-161      jsonlite_1.8.4    gtable_0.3.1      lifecycle_1.0.3  
    +[45] DBI_1.1.3         magrittr_2.0.3    scales_1.2.1      cli_3.5.0        
    +[49] stringi_1.7.8     cachem_1.0.6      fs_1.5.2          bslib_0.4.2      
    +[53] ragg_1.2.4        generics_0.1.3    vctrs_0.5.1       deSolve_1.34     
    +[57] tools_4.2.2       glue_1.6.2        purrr_1.0.0       processx_3.8.0   
    +[61] fastmap_1.1.0     yaml_2.3.6        inline_0.3.19     colorspace_2.0-3 
    +[65] memoise_2.0.1     sass_0.4.4       
    +
    +
    +

    Hardware info +

    +
    CPU model: AMD Ryzen 9 7950X 16-Core Processor
    +
    MemTotal:       64940452 kB
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-11-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 00000000..b969f2ff Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-12-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-12-1.png new file mode 100644 index 00000000..60393da3 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-13-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-13-1.png new file mode 100644 index 00000000..b9a410f7 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-17-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-17-1.png new file mode 100644 index 00000000..cf921dab Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-18-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 00000000..ff732730 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-19-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 00000000..e30011bc Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-6-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 00000000..4aad76df Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-7-1.png b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 00000000..e30011bc Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_cyan_pathway_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent.html b/docs/dev/articles/prebuilt/2022_dmta_parent.html new file mode 100644 index 00000000..89c9bfd8 --- /dev/null +++ b/docs/dev/articles/prebuilt/2022_dmta_parent.html @@ -0,0 +1,2204 @@ + + + + + + + +Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P • mkin + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Introduction +

    +

    The purpose of this document is to demonstrate how nonlinear +hierarchical models (NLHM) based on the parent degradation models SFO, +FOMC, DFOP and HS can be fitted with the mkin package.

    +

    It was assembled in the course of work package 1.1 of Project Number +173340 (Application of nonlinear hierarchical models to the kinetic +evaluation of chemical degradation data) of the German Environment +Agency carried out in 2022 and 2023.

    +

    The mkin package is used in version 1.2.2. It contains the test data +and the functions used in the evaluations. The saemix +package is used as a backend for fitting the NLHM, but is also loaded to +make the convergence plot function available.

    +

    This document is processed with the knitr package, which +also provides the kable function that is used to improve +the display of tabular data in R markdown documents. For parallel +processing, the parallel package is used.

    +
    +library(mkin)
    +library(knitr)
    +library(saemix)
    +library(parallel)
    +n_cores <- detectCores()
    +if (Sys.info()["sysname"] == "Windows") {
    +  cl <- makePSOCKcluster(n_cores)
    +} else {
    +  cl <- makeForkCluster(n_cores)
    +}
    +
    +
    +

    Data +

    +

    The test data are available in the mkin package as an object of class +mkindsg (mkin dataset group) under the identifier +dimethenamid_2018. The following preprocessing steps are +still necessary:

    +
      +
    • The data available for the enantiomer dimethenamid-P (DMTAP) are +renamed to have the same substance name as the data for the racemic +mixture dimethenamid (DMTA). The reason for this is that no difference +between their degradation behaviour was identified in the EU risk +assessment.
    • +
    • The data for transformation products and unnecessary columns are +discarded
    • +
    • The observation times of each dataset are multiplied with the +corresponding normalisation factor also available in the dataset, in +order to make it possible to describe all datasets with a single set of +parameters that are independent of temperature
    • +
    • Finally, datasets observed in the same soil (Elliot 1 +and Elliot 2) are combined, resulting in dimethenamid +(DMTA) data from six soils.
    • +
    +

    The following commented R code performs this preprocessing.

    +
    +# Apply a function to each of the seven datasets in the mkindsg object to create a list
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data                     # Get a dataset
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"              # Rename DMTAP to DMTA
    +  ds_i <- subset(ds_i, name == "DMTA", c("name", "time", "value")) # Select data
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]  # Normalise time
    +  ds_i                                                       # Return the dataset
    +})
    +
    +# Use dataset titles as names for the list elements
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +
    +# Combine data for Elliot soil to obtain a named list with six elements
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]]) #
    +dmta_ds[["Elliot 1"]] <- NULL
    +dmta_ds[["Elliot 2"]] <- NULL
    +

    The following tables show the 6 datasets.

    +
    +for (ds_name in names(dmta_ds)) {
    +    print(kable(mkin_long_to_wide(dmta_ds[[ds_name]]),
    +      caption = paste("Dataset", ds_name),
    +      label = paste0("tab:", ds_name), booktabs = TRUE))
    +    cat("\n\\clearpage\n")
    +}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Calke
    timeDMTA
    095.8
    098.7
    1460.5
    3039.1
    5915.2
    1204.8
    1204.6
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Borstel
    timeDMTA
    0.000000100.5
    0.00000099.6
    1.94129591.9
    1.94129591.3
    6.79453481.8
    6.79453482.1
    13.58906769.1
    13.58906768.0
    27.17813551.4
    27.17813551.4
    56.29756527.6
    56.29756526.8
    86.38764315.7
    86.38764315.3
    115.5070737.9
    115.5070738.1
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Flaach
    timeDMTA
    0.000000096.5
    0.000000096.8
    0.000000097.0
    0.623385682.9
    0.623385686.7
    0.623385687.4
    1.870156772.8
    1.870156769.9
    1.870156771.9
    4.363698951.4
    4.363698952.9
    4.363698948.6
    8.727397928.5
    8.727397927.3
    8.727397927.5
    13.091096814.8
    13.091096813.4
    13.091096814.4
    17.45479577.7
    17.45479577.3
    17.45479578.1
    26.18219362.0
    26.18219361.5
    26.18219361.9
    34.90959151.3
    34.90959151.0
    34.90959151.1
    43.63698930.9
    43.63698930.7
    43.63698930.7
    52.36438720.6
    52.36438720.4
    52.36438720.5
    74.80626740.4
    74.80626740.3
    74.80626740.3
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.2
    timeDMTA
    0.000000098.09
    0.000000098.77
    0.767892293.52
    0.767892292.03
    2.303676588.39
    2.303676587.18
    5.375245269.38
    5.375245271.06
    10.750490445.21
    10.750490446.81
    16.125735530.54
    16.125735530.07
    21.500980721.60
    21.500980720.41
    32.25147119.10
    32.25147119.70
    43.00196146.58
    43.00196146.31
    53.75245183.47
    53.75245183.52
    64.50294213.40
    64.50294213.67
    91.37916801.62
    91.37916801.62
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.3
    timeDMTA
    0.000000099.33
    0.000000097.44
    0.673393893.73
    0.673393893.77
    2.020181487.84
    2.020181489.82
    4.713756571.61
    4.713756571.42
    9.427513145.60
    9.427513145.42
    14.141269631.12
    14.141269631.68
    18.855026223.20
    18.855026224.13
    28.28253939.43
    28.28253939.82
    37.71005237.08
    37.71005238.64
    47.13756544.41
    47.13756544.78
    56.56507854.92
    56.56507855.08
    80.13386122.13
    80.13386122.23
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Elliot
    timeDMTA
    0.00000097.5
    0.000000100.7
    1.22847886.4
    1.22847888.5
    3.68543569.8
    3.68543577.1
    8.59934959.0
    8.59934954.2
    17.19869731.3
    17.19869733.5
    25.79804619.6
    25.79804620.9
    34.39739513.3
    34.39739515.8
    51.5960926.7
    51.5960928.7
    68.7947898.8
    68.7947898.7
    103.1921846.0
    103.1921844.4
    146.1889283.3
    146.1889282.8
    223.5830661.4
    223.5830661.8
    0.00000093.4
    0.000000103.2
    1.22847889.2
    1.22847886.6
    3.68543578.2
    3.68543578.1
    8.59934955.6
    8.59934953.0
    17.19869733.7
    17.19869733.2
    25.79804620.9
    25.79804619.9
    34.39739518.2
    34.39739512.7
    51.5960927.8
    51.5960929.0
    68.79478911.4
    68.7947899.0
    103.1921843.9
    103.1921844.4
    146.1889282.6
    146.1889283.4
    223.5830662.0
    223.5830661.7
    +
    +
    +

    Separate evaluations +

    +

    In order to obtain suitable starting parameters for the NLHM fits, +separate fits of the four models to the data for each soil are generated +using the mmkin function from the mkin +package. In a first step, constant variance is assumed. Convergence is +checked with the status function.

    +
    +deg_mods <- c("SFO", "FOMC", "DFOP", "HS")
    +f_sep_const <- mmkin(
    +  deg_mods,
    +  dmta_ds,
    +  error_model = "const",
    +  quiet = TRUE)
    +
    +status(f_sep_const) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    SFOOKOKOKOKOKOK
    FOMCOKOKOKOKOKOK
    DFOPOKOKOKOKOKOK
    HSOKOKOKCOKOK
    +

    In the table above, OK indicates convergence, and C indicates failure +to converge. All separate fits with constant variance converged, with +the sole exception of the HS fit to the BBA 2.2 data. To prepare for +fitting NLHM using the two-component error model, the separate fits are +updated assuming two-component error.

    +
    +f_sep_tc <- update(f_sep_const, error_model = "tc")
    +status(f_sep_tc) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    SFOOKOKOKOKOKOK
    FOMCOKOKOKOKCOK
    DFOPOKOKCOKCOK
    HSOKCOKOKOKOK
    +

    Using the two-component error model, the one fit that did not +converge with constant variance did converge, but other non-SFO fits +failed to converge.

    +
    +
    +

    Hierarchichal model fits +

    +

    The following code fits eight versions of hierarchical models to the +data, using SFO, FOMC, DFOP and HS for the parent compound, and using +either constant variance or two-component error for the error model. The +default parameter distribution model in mkin allows for variation of all +degradation parameters across the assumed population of soils. In other +words, each degradation parameter is associated with a random effect as +a first step. The mhmkin function makes it possible to fit +all eight versions in parallel (given a sufficient number of computing +cores being available) to save execution time.

    +

    Convergence plots and summaries for these fits are shown in the +appendix.

    +
    +f_saem <- mhmkin(list(f_sep_const, f_sep_tc), transformations = "saemix")
    +

    The output of the status function shows that all fits +terminated successfully.

    +
    +status(f_saem) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOOKOK
    FOMCOKOK
    DFOPOKOK
    HSOKOK
    +

    The AIC and BIC values show that the biphasic models DFOP and HS give +the best fits.

    +
    +anova(f_saem) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    SFO const5796.3795.3-393.2
    SFO tc6798.3797.1-393.2
    FOMC const7734.2732.7-360.1
    FOMC tc8720.4718.8-352.2
    DFOP const9711.8710.0-346.9
    HS const9714.0712.1-348.0
    DFOP tc10665.5663.4-322.8
    HS tc10667.1665.0-323.6
    +

    The DFOP model is preferred here, as it has a better mechanistic +basis for batch experiments with constant incubation conditions. Also, +it shows the lowest AIC and BIC values in the first set of fits when +combined with the two-component error model. Therefore, the DFOP model +was selected for further refinements of the fits with the aim to make +the model fully identifiable.

    +
    +

    Parameter identifiability based on the Fisher Information +Matrix +

    +

    Using the illparms function, ill-defined statistical +model parameters such as standard deviations of the degradation +parameters in the population and error model parameters can be +found.

    +
    +illparms(f_saem) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    SFOb.1
    FOMCsd(DMTA_0)
    DFOPsd(k2)sd(k2)
    HSsd(tb)
    +

    According to the illparms function, the fitted standard +deviation of the second kinetic rate constant k2 is +ill-defined in both DFOP fits. This suggests that different values would +be obtained for this standard deviation when using different starting +values.

    +

    The thus identified overparameterisation is addressed by removing the +random effect for k2 from the parameter model.

    +
    +f_saem_dfop_tc_no_ranef_k2 <- update(f_saem[["DFOP", "tc"]],
    +  no_random_effect = "k2")
    +

    For the resulting fit, it is checked whether there are still +ill-defined parameters,

    +
    +illparms(f_saem_dfop_tc_no_ranef_k2)
    +

    which is not the case. Below, the refined model is compared with the +previous best model. The model without random effect for k2 +is a reduced version of the previous model. Therefore, the models are +nested and can be compared using the likelihood ratio test. This is +achieved with the argument test = TRUE to the +anova function.

    +
    +anova(f_saem[["DFOP", "tc"]], f_saem_dfop_tc_no_ranef_k2, test = TRUE) |>
    +  kable(format.args = list(digits = 4))
    + ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLikChisqDfPr(>Chisq)
    f_saem_dfop_tc_no_ranef_k29663.8661.9-322.9NANANA
    f_saem[[“DFOP”, “tc”]]10665.5663.4-322.80.280910.5961
    +

    The AIC and BIC criteria are lower after removal of the ill-defined +random effect for k2. The p value of the likelihood ratio +test is much greater than 0.05, indicating that the model with the +higher likelihood (here the model with random effects for all +degradation parameters f_saem[["DFOP", "tc"]]) does not fit +significantly better than the model with the lower likelihood (the +reduced model f_saem_dfop_tc_no_ranef_k2).

    +

    Therefore, AIC, BIC and likelihood ratio test suggest the use of the +reduced model.

    +

    The convergence of the fit is checked visually.

    +
    +Convergence plot for the NLHM DFOP fit with two-component error and without a random effect on 'k2'

    +Convergence plot for the NLHM DFOP fit with two-component error and +without a random effect on ‘k2’ +

    +
    +

    All parameters appear to have converged to a satisfactory degree. The +final fit is plotted using the plot method from the mkin package.

    +
    +plot(f_saem_dfop_tc_no_ranef_k2)
    +
    +Plot of the final NLHM DFOP fit

    +Plot of the final NLHM DFOP fit +

    +
    +

    Finally, a summary report of the fit is produced.

    +
    +summary(f_saem_dfop_tc_no_ranef_k2)
    +
    saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:51 2023 
    +Date of summary: Sat Jan 28 11:22:52 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 3.74 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +   DMTA_0        k1        k2         g 
    +98.759266  0.087034  0.009933  0.930827 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.76  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  663.8 661.9 -322.9
    +
    +Optimised parameters:
    +               est.     lower     upper
    +DMTA_0    98.228939 96.285869 100.17201
    +k1         0.064063  0.033477   0.09465
    +k2         0.008297  0.005824   0.01077
    +g          0.953821  0.914328   0.99331
    +a.1        1.068479  0.869538   1.26742
    +b.1        0.029424  0.022406   0.03644
    +SD.DMTA_0  2.030437  0.404824   3.65605
    +SD.k1      0.594692  0.256660   0.93272
    +SD.g       1.006754  0.361327   1.65218
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0218                
    +k2  0.0556  0.0355        
    +g  -0.0516 -0.0284 -0.2800
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 2.0304 0.4048 3.6560
    +SD.k1     0.5947 0.2567 0.9327
    +SD.g      1.0068 0.3613 1.6522
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.06848 0.86954 1.26742
    +b.1 0.02942 0.02241 0.03644
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.45 41.4    12.46   10.82   83.54
    +
    +
    +

    Alternative check of parameter identifiability +

    +

    The parameter check used in the illparms function is +based on a quadratic approximation of the likelihood surface near its +optimum, which is calculated using the Fisher Information Matrix (FIM). +An alternative way to check parameter identifiability (Duchesne et al. 2021) based on a multistart +approach has recently been implemented in mkin.

    +

    The graph below shows boxplots of the parameters obtained in 50 runs +of the saem algorithm with different parameter combinations, sampled +from the range of the parameters obtained for the individual datasets +fitted separately using nonlinear regression.

    +
    +f_saem_dfop_tc_multi <- multistart(f_saem[["DFOP", "tc"]], n = 50, cores = 15)
    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_multi, lpos = "bottomright", ylim = c(0.3, 10), las = 2)
    +
    +Scaled parameters from the multistart runs, full model

    +Scaled parameters from the multistart runs, full model +

    +
    +

    The graph clearly confirms the lack of identifiability of the +variance of k2 in the full model. The overparameterisation +of the model also indicates a lack of identifiability of the variance of +parameter g.

    +

    The parameter boxplots of the multistart runs with the reduced model +shown below indicate that all runs give similar results, regardless of +the starting parameters.

    +
    +f_saem_dfop_tc_no_ranef_k2_multi <- multistart(f_saem_dfop_tc_no_ranef_k2,
    +  n = 50, cores = 15)
    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_no_ranef_k2_multi, ylim = c(0.5, 2), las = 2,
    +  lpos = "bottomright")
    +
    +Scaled parameters from the multistart runs, reduced model

    +Scaled parameters from the multistart runs, reduced model +

    +
    +

    When only the parameters of the top 25% of the fits are shown (based +on a feature introduced in mkin 1.2.2 currently under development), the +scatter is even less as shown below.

    +
    +par(mar = c(6.1, 4.1, 2.1, 2.1))
    +parplot(f_saem_dfop_tc_no_ranef_k2_multi, ylim = c(0.5, 2), las = 2, llquant = 0.25,
    +  lpos = "bottomright")
    +
    +Scaled parameters from the multistart runs, reduced model, fits with the top 25\% likelihood values

    +Scaled parameters from the multistart runs, reduced model, fits with the +top 25% likelihood values +

    +
    +
    +
    +
    +

    Conclusions +

    +

    Fitting the four parent degradation models SFO, FOMC, DFOP and HS as +part of hierarchical model fits with two different error models and +normal distributions of the transformed degradation parameters works +without technical problems. The biphasic models DFOP and HS gave the +best fit to the data, but the default parameter distribution model was +not fully identifiable. Removing the random effect for the second +kinetic rate constant of the DFOP model resulted in a reduced model that +was fully identifiable and showed the lowest values for the model +selection criteria AIC and BIC. The reliability of the identification of +all model parameters was confirmed using multiple starting values.

    +
    +
    +

    Acknowledgements +

    +

    The helpful comments by Janina Wöltjen of the German Environment +Agency are gratefully acknowledged.

    +
    +
    +

    References +

    +
    +
    +Duchesne, Ronan, Anissa Guillemin, Olivier Gandrillon, and Fabien +Crauste. 2021. “Practical Identifiability in the Frame of +Nonlinear Mixed Effects Models: The Example of the in Vitro +Erythropoiesis.” BMC Bioinformatics 22 (478). https://doi.org/10.1186/s12859-021-04373-4. +
    +
    +
    +
    +

    Appendix +

    +
    +

    Hierarchical model fit listings +

    + +Hierarchical mkin fit of the SFO model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:44 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - k_DMTA * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 0.982 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    + DMTA_0  k_DMTA 
    +97.2953  0.0566 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k_DMTA
    +DMTA_0   97.3      0
    +k_DMTA    0.0      1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  796.3 795.3 -393.2
    +
    +Optimised parameters:
    +              est.    lower   upper
    +DMTA_0    97.28130 95.71113 98.8515
    +k_DMTA     0.05665  0.02909  0.0842
    +a.1        2.66442  2.35579  2.9731
    +SD.DMTA_0  1.54776  0.15447  2.9411
    +SD.k_DMTA  0.60690  0.26248  0.9513
    +
    +Correlation: 
    +       DMTA_0
    +k_DMTA 0.0168
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 1.5478 0.1545 2.9411
    +SD.k_DMTA 0.6069 0.2625 0.9513
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.664 2.356 2.973
    +
    +Estimated disappearance times:
    +      DT50  DT90
    +DMTA 12.24 40.65
    +
    +
    +

    + +Hierarchical mkin fit of the SFO model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:46 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - k_DMTA * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.39 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +  DMTA_0   k_DMTA 
    +96.99175  0.05603 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k_DMTA
    +DMTA_0  96.99      0
    +k_DMTA   0.00      1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  798.3 797.1 -393.2
    +
    +Optimised parameters:
    +               est.     lower    upper
    +DMTA_0    97.271822 95.703157 98.84049
    +k_DMTA     0.056638  0.029110  0.08417
    +a.1        2.660081  2.230398  3.08976
    +b.1        0.001665 -0.006911  0.01024
    +SD.DMTA_0  1.545520  0.145035  2.94601
    +SD.k_DMTA  0.606422  0.262274  0.95057
    +
    +Correlation: 
    +       DMTA_0
    +k_DMTA 0.0169
    +
    +Random effects:
    +            est.  lower  upper
    +SD.DMTA_0 1.5455 0.1450 2.9460
    +SD.k_DMTA 0.6064 0.2623 0.9506
    +
    +Variance model:
    +        est.     lower   upper
    +a.1 2.660081  2.230398 3.08976
    +b.1 0.001665 -0.006911 0.01024
    +
    +Estimated disappearance times:
    +      DT50  DT90
    +DMTA 12.24 40.65
    +
    +
    +

    + +Hierarchical mkin fit of the FOMC model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:45 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - (alpha/beta) * 1/((time/beta) + 1) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 1.552 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    + DMTA_0   alpha    beta 
    + 98.292   9.909 156.341 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 alpha beta
    +DMTA_0  98.29     0    0
    +alpha    0.00     1    0
    +beta     0.00     0    1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  734.2 732.7 -360.1
    +
    +Optimised parameters:
    +              est.   lower   upper
    +DMTA_0     98.3435 96.9033  99.784
    +alpha       7.2007  2.5889  11.812
    +beta      112.8746 34.8816 190.868
    +a.1         2.0459  1.8054   2.286
    +SD.DMTA_0   1.4795  0.2717   2.687
    +SD.alpha    0.6396  0.1509   1.128
    +SD.beta     0.6874  0.1587   1.216
    +
    +Correlation: 
    +      DMTA_0  alpha  
    +alpha -0.1125        
    +beta  -0.1227  0.3632
    +
    +Random effects:
    +            est.  lower upper
    +SD.DMTA_0 1.4795 0.2717 2.687
    +SD.alpha  0.6396 0.1509 1.128
    +SD.beta   0.6874 0.1587 1.216
    +
    +Variance model:
    +     est. lower upper
    +a.1 2.046 1.805 2.286
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back
    +DMTA 11.41 42.53     12.8
    +
    +
    +

    + +Hierarchical mkin fit of the FOMC model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:46 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - (alpha/beta) * 1/((time/beta) + 1) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.764 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +DMTA_0  alpha   beta 
    +98.772  4.663 92.597 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 alpha beta
    +DMTA_0  98.77     0    0
    +alpha    0.00     1    0
    +beta     0.00     0    1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  720.4 718.8 -352.2
    +
    +Optimised parameters:
    +              est.    lower     upper
    +DMTA_0    98.99136 97.26011 100.72261
    +alpha      5.86312  2.57485   9.15138
    +beta      88.55571 29.20889 147.90254
    +a.1        1.51063  1.24384   1.77741
    +b.1        0.02824  0.02040   0.03609
    +SD.DMTA_0  1.57436 -0.04867   3.19739
    +SD.alpha   0.59871  0.17132   1.02611
    +SD.beta    0.72994  0.22849   1.23139
    +
    +Correlation: 
    +      DMTA_0  alpha  
    +alpha -0.1363        
    +beta  -0.1414  0.2542
    +
    +Random effects:
    +            est.    lower upper
    +SD.DMTA_0 1.5744 -0.04867 3.197
    +SD.alpha  0.5987  0.17132 1.026
    +SD.beta   0.7299  0.22849 1.231
    +
    +Variance model:
    +       est.  lower   upper
    +a.1 1.51063 1.2438 1.77741
    +b.1 0.02824 0.0204 0.03609
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back
    +DMTA 11.11 42.6    12.82
    +
    +
    +

    + +Hierarchical mkin fit of the DFOP model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:45 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 1.649 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2        g 
    +98.64383  0.09211  0.02999  0.76814 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.64  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC BIC logLik
    +  711.8 710 -346.9
    +
    +Optimised parameters:
    +               est.     lower    upper
    +DMTA_0    98.092481 96.573898 99.61106
    +k1         0.062499  0.030336  0.09466
    +k2         0.009065 -0.005133  0.02326
    +g          0.948967  0.862079  1.03586
    +a.1        1.821671  1.604774  2.03857
    +SD.DMTA_0  1.677785  0.472066  2.88350
    +SD.k1      0.634962  0.270788  0.99914
    +SD.k2      1.033498 -0.205994  2.27299
    +SD.g       1.710046  0.428642  2.99145
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0246                
    +k2  0.0491  0.0953        
    +g  -0.0552 -0.0889 -0.4795
    +
    +Random effects:
    +           est.   lower  upper
    +SD.DMTA_0 1.678  0.4721 2.8835
    +SD.k1     0.635  0.2708 0.9991
    +SD.k2     1.033 -0.2060 2.2730
    +SD.g      1.710  0.4286 2.9914
    +
    +Variance model:
    +     est. lower upper
    +a.1 1.822 1.605 2.039
    +
    +Estimated disappearance times:
    +      DT50 DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.79 42.8    12.88   11.09   76.46
    +
    +
    +

    + +Hierarchical mkin fit of the DFOP model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:46 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
    +           time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
    +           * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 3.288 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +   DMTA_0        k1        k2         g 
    +98.759266  0.087034  0.009933  0.930827 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 g
    +DMTA_0  98.76  0  0 0
    +k1       0.00  1  0 0
    +k2       0.00  0  1 0
    +g        0.00  0  0 1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC   BIC logLik
    +  665.5 663.4 -322.8
    +
    +Optimised parameters:
    +               est.     lower     upper
    +DMTA_0    98.377019 96.447952 100.30609
    +k1         0.064843  0.034607   0.09508
    +k2         0.008895  0.006368   0.01142
    +g          0.949696  0.903815   0.99558
    +a.1        1.065241  0.865754   1.26473
    +b.1        0.029340  0.022336   0.03634
    +SD.DMTA_0  2.007754  0.387982   3.62753
    +SD.k1      0.580473  0.250286   0.91066
    +SD.k2      0.006105 -4.920337   4.93255
    +SD.g       1.097149  0.412779   1.78152
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0235                
    +k2  0.0595  0.0424        
    +g  -0.0470 -0.0278 -0.2731
    +
    +Random effects:
    +              est.   lower  upper
    +SD.DMTA_0 2.007754  0.3880 3.6275
    +SD.k1     0.580473  0.2503 0.9107
    +SD.k2     0.006105 -4.9203 4.9325
    +SD.g      1.097149  0.4128 1.7815
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.06524 0.86575 1.26473
    +b.1 0.02934 0.02234 0.03634
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.36 41.32    12.44   10.69   77.92
    +
    +
    +

    + +Hierarchical mkin fit of the HS model with error model const + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:45 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - ifelse(time <= tb, k1, k2) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 2.006 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Constant variance 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2       tb 
    +97.82176  0.06931  0.02997 11.13945 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 tb
    +DMTA_0  97.82  0  0  0
    +k1       0.00  1  0  0
    +k2       0.00  0  1  0
    +tb       0.00  0  0  1
    +
    +Starting values for error model parameters:
    +a.1 
    +  1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +  AIC   BIC logLik
    +  714 712.1   -348
    +
    +Optimised parameters:
    +              est.    lower    upper
    +DMTA_0    98.16102 96.47747 99.84456
    +k1         0.07876  0.05261  0.10491
    +k2         0.02227  0.01706  0.02747
    +tb        13.99089 -7.40049 35.38228
    +a.1        1.82305  1.60700  2.03910
    +SD.DMTA_0  1.88413  0.56204  3.20622
    +SD.k1      0.34292  0.10482  0.58102
    +SD.k2      0.19851  0.01718  0.37985
    +SD.tb      1.68168  0.58064  2.78272
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0142                
    +k2  0.0001 -0.0025        
    +tb  0.0165 -0.1256 -0.0301
    +
    +Random effects:
    +            est.   lower  upper
    +SD.DMTA_0 1.8841 0.56204 3.2062
    +SD.k1     0.3429 0.10482 0.5810
    +SD.k2     0.1985 0.01718 0.3798
    +SD.tb     1.6817 0.58064 2.7827
    +
    +Variance model:
    +     est. lower upper
    +a.1 1.823 1.607 2.039
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 8.801 67.91    20.44   8.801   31.13
    +
    +
    +

    + +Hierarchical mkin fit of the HS model with error model tc + +
    
    +saemix version used for fitting:      3.2 
    +mkin version used for pre-fitting:  1.2.2 
    +R version used for fitting:         4.2.2 
    +Date of fit:     Sat Jan 28 11:22:46 2023 
    +Date of summary: Sat Jan 28 11:23:57 2023 
    +
    +Equations:
    +d_DMTA/dt = - ifelse(time <= tb, k1, k2) * DMTA
    +
    +Data:
    +155 observations of 1 variable(s) grouped in 6 datasets
    +
    +Model predictions using solution type analytical 
    +
    +Fitted in 3.267 s
    +Using 300, 100 iterations and 9 chains
    +
    +Variance model: Two-component variance function 
    +
    +Starting values for degradation parameters:
    +  DMTA_0       k1       k2       tb 
    +98.45190  0.07525  0.02576 19.19375 
    +
    +Fixed degradation parameter values:
    +None
    +
    +Starting values for random effects (square root of initial entries in omega):
    +       DMTA_0 k1 k2 tb
    +DMTA_0  98.45  0  0  0
    +k1       0.00  1  0  0
    +k2       0.00  0  1  0
    +tb       0.00  0  0  1
    +
    +Starting values for error model parameters:
    +a.1 b.1 
    +  1   1 
    +
    +Results:
    +
    +Likelihood computed by importance sampling
    +    AIC BIC logLik
    +  667.1 665 -323.6
    +
    +Optimised parameters:
    +              est.    lower    upper
    +DMTA_0    97.76570 95.81350 99.71791
    +k1         0.05855  0.03080  0.08630
    +k2         0.02337  0.01664  0.03010
    +tb        31.09638 29.38289 32.80987
    +a.1        1.08835  0.88590  1.29080
    +b.1        0.02964  0.02257  0.03671
    +SD.DMTA_0  2.04877  0.42607  3.67147
    +SD.k1      0.59166  0.25621  0.92711
    +SD.k2      0.30698  0.09561  0.51835
    +SD.tb      0.01274 -0.10914  0.13462
    +
    +Correlation: 
    +   DMTA_0  k1      k2     
    +k1  0.0160                
    +k2 -0.0070 -0.0024        
    +tb -0.0668 -0.0103 -0.2013
    +
    +Random effects:
    +             est.    lower  upper
    +SD.DMTA_0 2.04877  0.42607 3.6715
    +SD.k1     0.59166  0.25621 0.9271
    +SD.k2     0.30698  0.09561 0.5183
    +SD.tb     0.01274 -0.10914 0.1346
    +
    +Variance model:
    +       est.   lower   upper
    +a.1 1.08835 0.88590 1.29080
    +b.1 0.02964 0.02257 0.03671
    +
    +Estimated disappearance times:
    +      DT50  DT90 DT50back DT50_k1 DT50_k2
    +DMTA 11.84 51.71    15.57   11.84   29.66
    +
    +
    +

    +
    +
    +

    Hierarchical model convergence plots +

    +
    +Convergence plot for the NLHM SFO fit with constant variance

    +Convergence plot for the NLHM SFO fit with constant variance +

    +
    +
    +Convergence plot for the NLHM SFO fit with two-component error

    +Convergence plot for the NLHM SFO fit with two-component error +

    +
    +
    +Convergence plot for the NLHM FOMC fit with constant variance

    +Convergence plot for the NLHM FOMC fit with constant variance +

    +
    +
    +Convergence plot for the NLHM FOMC fit with two-component error

    +Convergence plot for the NLHM FOMC fit with two-component error +

    +
    +
    +Convergence plot for the NLHM DFOP fit with constant variance

    +Convergence plot for the NLHM DFOP fit with constant variance +

    +
    +
    +Convergence plot for the NLHM DFOP fit with two-component error

    +Convergence plot for the NLHM DFOP fit with two-component error +

    +
    +
    +Convergence plot for the NLHM HS fit with constant variance

    +Convergence plot for the NLHM HS fit with constant variance +

    +
    +
    +Convergence plot for the NLHM HS fit with two-component error

    +Convergence plot for the NLHM HS fit with two-component error +

    +
    +
    +
    +

    Session info +

    +
    R version 4.2.2 Patched (2022-11-10 r83330)
    +Platform: x86_64-pc-linux-gnu (64-bit)
    +Running under: Debian GNU/Linux bookworm/sid
    +
    +Matrix products: default
    +BLAS:   /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
    +LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/libopenblas-r0.3.21.so
    +
    +locale:
    + [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
    + [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
    + [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
    + [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
    + [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    +[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       
    +
    +attached base packages:
    +[1] parallel  stats     graphics  grDevices utils     datasets  methods  
    +[8] base     
    +
    +other attached packages:
    +[1] saemix_3.2 npde_3.3   knitr_1.41 mkin_1.2.2
    +
    +loaded via a namespace (and not attached):
    + [1] deSolve_1.34      zoo_1.8-11        tidyselect_1.2.0  xfun_0.35        
    + [5] bslib_0.4.2       purrr_1.0.0       lattice_0.20-45   colorspace_2.0-3 
    + [9] vctrs_0.5.1       generics_0.1.3    htmltools_0.5.4   yaml_2.3.6       
    +[13] utf8_1.2.2        rlang_1.0.6       pkgdown_2.0.7     jquerylib_0.1.4  
    +[17] pillar_1.8.1      glue_1.6.2        DBI_1.1.3         lifecycle_1.0.3  
    +[21] stringr_1.5.0     munsell_0.5.0     gtable_0.3.1      ragg_1.2.4       
    +[25] codetools_0.2-18  memoise_2.0.1     evaluate_0.19     fastmap_1.1.0    
    +[29] lmtest_0.9-40     fansi_1.0.3       highr_0.9         scales_1.2.1     
    +[33] cachem_1.0.6      desc_1.4.2        jsonlite_1.8.4    systemfonts_1.0.4
    +[37] fs_1.5.2          textshaping_0.3.6 gridExtra_2.3     ggplot2_3.4.0    
    +[41] digest_0.6.31     stringi_1.7.8     dplyr_1.0.10      grid_4.2.2       
    +[45] rprojroot_2.0.3   cli_3.5.0         tools_4.2.2       magrittr_2.0.3   
    +[49] sass_0.4.4        tibble_3.1.8      pkgconfig_2.0.3   assertthat_0.2.1 
    +[53] rmarkdown_2.19    R6_2.5.1          mclust_6.0.0      nlme_3.1-161     
    +[57] compiler_4.2.2   
    +
    +
    +

    Hardware info +

    +
    CPU model: AMD Ryzen 9 7950X 16-Core Processor
    +
    MemTotal:       64940452 kB
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png new file mode 100644 index 00000000..3f145074 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-const-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png new file mode 100644 index 00000000..e5457fc9 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png new file mode 100644 index 00000000..14707641 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-dfop-tc-no-ranef-k2-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png new file mode 100644 index 00000000..c7ed69a3 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-const-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png new file mode 100644 index 00000000..1a48524c Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-fomc-tc-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png new file mode 100644 index 00000000..0f3b1184 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-const-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png new file mode 100644 index 00000000..901a1579 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-hs-tc-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png new file mode 100644 index 00000000..a3e3a51f Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-const-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png new file mode 100644 index 00000000..b85691eb Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/convergence-saem-sfo-tc-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-full-par-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-full-par-1.png new file mode 100644 index 00000000..a42950f0 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-full-par-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-1.png new file mode 100644 index 00000000..caebc768 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png new file mode 100644 index 00000000..45ae57f1 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/multistart-reduced-par-llquant-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png new file mode 100644 index 00000000..1f8eb9f0 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_parent_files/figure-html/plot-saem-dfop-tc-no-ranef-k2-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway.html b/docs/dev/articles/prebuilt/2022_dmta_pathway.html new file mode 100644 index 00000000..2e89fb9d --- /dev/null +++ b/docs/dev/articles/prebuilt/2022_dmta_pathway.html @@ -0,0 +1,2022 @@ + + + + + + + +Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P • mkin + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Introduction +

    +

    The purpose of this document is to test demonstrate how nonlinear +hierarchical models (NLHM) based on the parent degradation models SFO, +FOMC, DFOP and HS, with parallel formation of two or more metabolites +can be fitted with the mkin package.

    +

    It was assembled in the course of work package 1.2 of Project Number +173340 (Application of nonlinear hierarchical models to the kinetic +evaluation of chemical degradation data) of the German Environment +Agency carried out in 2022 and 2023.

    +

    The mkin package is used in version 1.2.2, which is currently under +development. It contains the test data, and the functions used in the +evaluations. The saemix package is used as a backend for +fitting the NLHM, but is also loaded to make the convergence plot +function available.

    +

    This document is processed with the knitr package, which +also provides the kable function that is used to improve +the display of tabular data in R markdown documents. For parallel +processing, the parallel package is used.

    +
    +library(mkin)
    +library(knitr)
    +library(saemix)
    +library(parallel)
    +n_cores <- detectCores()
    +if (Sys.info()["sysname"] == "Windows") {
    +  cl <- makePSOCKcluster(n_cores)
    +} else {
    +  cl <- makeForkCluster(n_cores)
    +}
    +
    +
    +

    Data +

    +

    The test data are available in the mkin package as an object of class +mkindsg (mkin dataset group) under the identifier +dimethenamid_2018. The following preprocessing steps are +done in this document.

    +
      +
    • The data available for the enantiomer dimethenamid-P (DMTAP) are +renamed to have the same substance name as the data for the racemic +mixture dimethenamid (DMTA). The reason for this is that no difference +between their degradation behaviour was identified in the EU risk +assessment.
    • +
    • Unnecessary columns are discarded
    • +
    • The observation times of each dataset are multiplied with the +corresponding normalisation factor also available in the dataset, in +order to make it possible to describe all datasets with a single set of +parameters that are independent of temperature
    • +
    • Finally, datasets observed in the same soil (Elliot 1 +and Elliot 2) are combined, resulting in dimethenamid +(DMTA) data from six soils.
    • +
    +

    The following commented R code performs this preprocessing.

    +
    +# Apply a function to each of the seven datasets in the mkindsg object to create a list
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data                     # Get a dataset
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"              # Rename DMTAP to DMTA
    +  ds_i <- subset(ds_i, select = c("name", "time", "value")) # Select data
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]  # Normalise time
    +  ds_i                                                       # Return the dataset
    +})
    +
    +# Use dataset titles as names for the list elements
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +
    +# Combine data for Elliot soil to obtain a named list with six elements
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]]) #
    +dmta_ds[["Elliot 1"]] <- NULL
    +dmta_ds[["Elliot 2"]] <- NULL
    +

    The following tables show the 6 datasets.

    +
    +for (ds_name in names(dmta_ds)) {
    +  print(
    +    kable(mkin_long_to_wide(dmta_ds[[ds_name]]),
    +      caption = paste("Dataset", ds_name),
    +      booktabs = TRUE, row.names = FALSE))
    +    cat("\n\\clearpage\n")
    +}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Calke
    timeDMTAM23M27M31
    095.8NANANA
    098.7NANANA
    1460.54.11.52.0
    3039.15.32.42.1
    5915.26.03.22.2
    1204.84.33.81.8
    1204.64.13.72.1
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Borstel
    timeDMTAM23M27M31
    0.000000100.5NANANA
    0.00000099.6NANANA
    1.94129591.90.4NANA
    1.94129591.30.50.30.1
    6.79453481.81.20.81.0
    6.79453482.11.30.90.9
    13.58906769.12.81.42.0
    13.58906768.02.01.42.5
    27.17813551.42.92.74.3
    27.17813551.44.92.63.2
    56.29756527.612.24.44.3
    56.29756526.812.24.74.8
    86.38764315.712.25.45.0
    86.38764315.312.05.25.1
    115.5070737.910.45.44.3
    115.5070738.111.65.44.4
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Flaach
    timeDMTAM23M27M31
    0.000000096.5NANANA
    0.000000096.8NANANA
    0.000000097.0NANANA
    0.623385682.90.71.10.3
    0.623385686.70.71.10.3
    0.623385687.40.20.30.1
    1.870156772.82.22.60.7
    1.870156769.91.82.40.6
    1.870156771.91.62.30.7
    4.363698951.44.15.01.3
    4.363698952.94.25.91.2
    4.363698948.64.24.81.4
    8.727397928.57.58.52.4
    8.727397927.37.18.52.1
    8.727397927.57.58.32.3
    13.091096814.88.49.33.3
    13.091096813.46.88.72.4
    13.091096814.48.09.12.6
    17.45479577.77.28.64.0
    17.45479577.37.28.53.6
    17.45479578.16.98.93.3
    26.18219362.04.98.12.1
    26.18219361.54.37.71.7
    26.18219361.94.57.41.8
    34.90959151.33.85.91.6
    34.90959151.03.16.01.6
    34.90959151.13.15.91.4
    43.63698930.92.75.61.8
    43.63698930.72.35.21.5
    43.63698930.72.15.61.3
    52.36438720.61.64.31.2
    52.36438720.41.13.70.9
    52.36438720.51.33.91.1
    74.80626740.40.42.50.5
    74.80626740.30.42.40.5
    74.80626740.30.32.20.3
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.2
    timeDMTAM23M27M31
    0.000000098.09NANANA
    0.000000098.77NANANA
    0.767892293.520.360.420.36
    0.767892292.030.400.470.33
    2.303676588.391.030.710.55
    2.303676587.181.070.820.64
    5.375245269.383.602.191.94
    5.375245271.063.662.281.62
    10.750490445.216.975.454.22
    10.750490446.817.225.194.37
    16.125735530.548.658.816.31
    16.125735530.078.387.936.85
    21.500980721.609.1010.257.05
    21.500980720.418.6310.776.84
    32.25147119.107.6310.896.53
    32.25147119.708.0110.857.11
    43.00196146.586.4010.416.06
    43.00196146.316.3510.356.05
    53.75245183.475.359.925.50
    53.75245183.525.069.425.07
    64.50294213.405.149.154.94
    64.50294213.675.919.254.39
    91.37916801.623.357.143.64
    91.37916801.622.877.133.55
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset BBA 2.3
    timeDMTAM23M27M31
    0.000000099.33NANANA
    0.000000097.44NANANA
    0.673393893.730.180.500.47
    0.673393893.770.180.830.34
    2.020181487.840.521.251.00
    2.020181489.820.431.090.89
    4.713756571.611.193.283.58
    4.713756571.421.113.243.41
    9.427513145.602.267.178.74
    9.427513145.421.997.918.28
    14.141269631.122.8110.159.67
    14.141269631.682.839.558.95
    18.855026223.203.3912.0910.34
    18.855026224.133.5611.8910.00
    28.28253939.433.4913.327.89
    28.28253939.823.2812.058.13
    37.71005237.082.8010.045.06
    37.71005238.642.9710.785.54
    47.13756544.412.429.323.79
    47.13756544.782.519.624.11
    56.56507854.922.228.003.11
    56.56507855.081.958.452.98
    80.13386122.131.285.711.78
    80.13386122.230.993.331.55
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Dataset Elliot
    timeDMTAM23M27M31
    0.00000097.5NANANA
    0.000000100.7NANANA
    1.22847886.4NANANA
    1.22847888.5NANA1.5
    3.68543569.82.82.35.0
    3.68543577.11.72.12.4
    8.59934959.04.34.04.3
    8.59934954.25.83.45.0
    17.19869731.38.26.68.0
    17.19869733.55.26.97.7
    25.79804619.65.18.27.8
    25.79804620.96.18.86.5
    34.39739513.36.09.78.0
    34.39739515.86.08.87.4
    51.5960926.75.08.36.9
    51.5960928.74.29.29.0
    68.7947898.83.99.35.5
    68.7947898.72.98.56.1
    103.1921846.01.98.66.1
    103.1921844.41.56.04.0
    146.1889283.32.05.63.1
    146.1889282.82.34.52.9
    223.5830661.41.24.11.8
    223.5830661.81.93.92.6
    0.00000093.4NANANA
    0.000000103.2NANANA
    1.22847889.2NANA1.3
    1.22847886.6NANANA
    3.68543578.22.61.03.1
    3.68543578.12.42.62.3
    8.59934955.65.54.53.4
    8.59934953.05.64.64.3
    17.19869733.77.37.67.8
    17.19869733.26.56.78.7
    25.79804620.95.88.77.7
    25.79804619.97.77.66.5
    34.39739518.27.88.06.3
    34.39739512.77.38.68.7
    51.5960927.87.07.45.7
    51.5960929.06.37.24.2
    68.79478911.44.310.33.2
    68.7947899.03.89.44.2
    103.1921843.92.66.53.8
    103.1921844.42.86.94.0
    146.1889282.61.64.64.5
    146.1889283.41.14.54.5
    223.5830662.01.44.33.8
    223.5830661.71.34.22.3
    +
    +
    +

    Separate evaluations +

    +

    As a first step to obtain suitable starting parameters for the NLHM +fits, we do separate fits of several variants of the pathway model used +previously (Ranke et al. 2021), varying +the kinetic model for the parent compound. Because the SFORB model often +provides faster convergence than the DFOP model, and can sometimes be +fitted where the DFOP model results in errors, it is included in the set +of parent models tested here.

    +
    +if (!dir.exists("dmta_dlls")) dir.create("dmta_dlls")
    +m_sfo_path_1 <- mkinmod(
    +  DMTA = mkinsub("SFO", c("M23", "M27", "M31")),
    +  M23 = mkinsub("SFO"),
    +  M27 = mkinsub("SFO"),
    +  M31 = mkinsub("SFO", "M27", sink = FALSE),
    +  name = "m_sfo_path", dll_dir = "dmta_dlls",
    +  unload = TRUE, overwrite = TRUE,
    +  quiet = TRUE
    +)
    +m_fomc_path_1 <- mkinmod(
    +  DMTA = mkinsub("FOMC", c("M23", "M27", "M31")),
    +  M23 = mkinsub("SFO"),
    +  M27 = mkinsub("SFO"),
    +  M31 = mkinsub("SFO", "M27", sink = FALSE),
    +  name = "m_fomc_path", dll_dir = "dmta_dlls",
    +  unload = TRUE, overwrite = TRUE,
    +  quiet = TRUE
    +)
    +m_dfop_path_1 <- mkinmod(
    +  DMTA = mkinsub("DFOP", c("M23", "M27", "M31")),
    +  M23 = mkinsub("SFO"),
    +  M27 = mkinsub("SFO"),
    +  M31 = mkinsub("SFO", "M27", sink = FALSE),
    +  name = "m_dfop_path", dll_dir = "dmta_dlls",
    +  unload = TRUE, overwrite = TRUE,
    +  quiet = TRUE
    +)
    +m_sforb_path_1 <- mkinmod(
    +  DMTA = mkinsub("SFORB", c("M23", "M27", "M31")),
    +  M23 = mkinsub("SFO"),
    +  M27 = mkinsub("SFO"),
    +  M31 = mkinsub("SFO", "M27", sink = FALSE),
    +  name = "m_sforb_path", dll_dir = "dmta_dlls",
    +  unload = TRUE, overwrite = TRUE,
    +  quiet = TRUE
    +)
    +m_hs_path_1 <- mkinmod(
    +  DMTA = mkinsub("HS", c("M23", "M27", "M31")),
    +  M23 = mkinsub("SFO"),
    +  M27 = mkinsub("SFO"),
    +  M31 = mkinsub("SFO", "M27", sink = FALSE),
    +  name = "m_hs_path", dll_dir = "dmta_dlls",
    +  unload = TRUE, overwrite = TRUE,
    +  quiet = TRUE
    +)
    +deg_mods_1 <- list(
    +  sfo_path_1 = m_sfo_path_1,
    +  fomc_path_1 = m_fomc_path_1,
    +  dfop_path_1 = m_dfop_path_1,
    +  sforb_path_1 = m_sforb_path_1,
    +  hs_path_1 = m_hs_path_1)
    +
    +sep_1_const <- mmkin(
    +  deg_mods_1,
    +  dmta_ds,
    +  error_model = "const",
    +  quiet = TRUE)
    +
    +status(sep_1_const) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    sfo_path_1OKOKOKOKOKOK
    fomc_path_1OKOKOKOKOKOK
    dfop_path_1OKOKCOKOKOK
    sforb_path_1OKOKCOKOKOK
    hs_path_1CCCCCC
    +

    All separate pathway fits with SFO or FOMC for the parent and +constant variance converged (status OK). Most fits with DFOP or SFORB +for the parent converged as well. The fits with HS for the parent did +not converge with default settings.

    +
    +sep_1_tc <- update(sep_1_const, error_model = "tc")
    +status(sep_1_tc) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CalkeBorstelFlaachBBA 2.2BBA 2.3Elliot
    sfo_path_1OKOKOKOKOKOK
    fomc_path_1OKOKCOKOKC
    dfop_path_1OKCOKOKOKOK
    sforb_path_1OKCOKOKOKOK
    hs_path_1CCCCCOK
    +

    With the two-component error model, the set of fits with convergence +problems is slightly different, with convergence problems appearing for +different data sets when applying the DFOP and SFORB model and some +additional convergence problems when using the FOMC model for the +parent.

    +
    +
    +

    Hierarchichal model fits +

    +

    The following code fits two sets of the corresponding hierarchical +models to the data, one assuming constant variance, and one assuming +two-component error.

    +
    +saem_1 <- mhmkin(list(sep_1_const, sep_1_tc))
    +

    The run time for these fits was around two hours on five year old +hardware. After a recent hardware upgrade these fits complete in less +than twenty minutes.

    +
    +status(saem_1) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    sfo_path_1OKOK
    fomc_path_1OKOK
    dfop_path_1OKOK
    sforb_path_1OKOK
    hs_path_1OKOK
    +

    According to the status function, all fits terminated +successfully.

    +
    +anova(saem_1) |> kable(digits = 1)
    +
    Warning in FUN(X[[i]], ...): Could not obtain log likelihood with 'is' method
    +for sforb_path_1 const
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    sfo_path_1 const172291.82288.3-1128.9
    sfo_path_1 tc182276.32272.5-1120.1
    fomc_path_1 const192099.02095.0-1030.5
    fomc_path_1 tc201939.61935.5-949.8
    dfop_path_1 const212038.82034.4-998.4
    hs_path_1 const212024.22019.8-991.1
    dfop_path_1 tc221879.81875.2-917.9
    sforb_path_1 tc221832.91828.3-894.4
    hs_path_1 tc221831.41826.8-893.7
    +

    When the goodness-of-fit of the models is compared, a warning is +obtained, indicating that the likelihood of the pathway fit with SFORB +for the parent compound and constant variance could not be calculated +with importance sampling (method ‘is’). As this is the default method on +which all AIC and BIC comparisons are based, this variant is not +included in the model comparison table. Comparing the goodness-of-fit of +the remaining models, HS model model with two-component error provides +the best fit. However, for batch experiments performed with constant +conditions such as the experiments evaluated here, there is no reason to +assume a discontinuity, so the SFORB model is preferable from a +mechanistic viewpoint. In addition, the information criteria AIC and BIC +are very similar for HS and SFORB. Therefore, the SFORB model is +selected here for further refinements.

    +
    +

    Parameter identifiability based on the Fisher Information +Matrix +

    +

    Using the illparms function, ill-defined statistical +model parameters such as standard deviations of the degradation +parameters in the population and error model parameters can be +found.

    +
    +illparms(saem_1) |> kable()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    consttc
    sfo_path_1sd(DMTA_0)
    fomc_path_1sd(DMTA_0)
    dfop_path_1
    sforb_path_1sd(log_k_DMTA_bound_free)
    hs_path_1sd(log_tb)
    +

    When using constant variance, no ill-defined variance parameters are +identified with the illparms function in any of the +degradation models. When using the two-component error model, there is +one ill-defined variance parameter in all variants except for the +variant using DFOP for the parent compound.

    +

    For the selected combination of the SFORB pathway model with +two-component error, the random effect for the rate constant from +reversibly bound DMTA to the free DMTA (k_DMTA_bound_free) +is not well-defined. Therefore, the fit is updated without assuming a +random effect for this parameter.

    +
    +saem_sforb_path_1_tc_reduced <- update(saem_1[["sforb_path_1", "tc"]],
    +  no_random_effect = "log_k_DMTA_bound_free")
    +illparms(saem_sforb_path_1_tc_reduced)
    +

    As expected, no ill-defined parameters remain. The model comparison +below shows that the reduced model is preferable.

    +
    +anova(saem_1[["sforb_path_1", "tc"]], saem_sforb_path_1_tc_reduced) |> kable(digits = 1)
    + + + + + + + + + + + + + + + + + + + + + + + + +
    nparAICBICLik
    saem_sforb_path_1_tc_reduced211830.31825.9-894.2
    saem_1[[“sforb_path_1”, “tc”]]221832.91828.3-894.4
    +

    The convergence plot of the refined fit is shown below.

    +
    +plot(saem_sforb_path_1_tc_reduced$so, plot.type = "convergence")
    +

    +

    For some parameters, for example for f_DMTA_ilr_1 and +f_DMTA_ilr_2, i.e. for two of the parameters determining +the formation fractions of the parallel formation of the three +metabolites, some movement of the parameters is still visible in the +second phase of the algorithm. However, the amplitude of this movement +is in the range of the amplitude towards the end of the first phase. +Therefore, it is likely that an increase in iterations would not improve +the parameter estimates very much, and it is proposed that the fit is +acceptable. No numeric convergence criterion is implemented in +saemix.

    +
    +
    +

    Alternative check of parameter identifiability +

    +

    As an alternative check of parameter identifiability (Duchesne et al. 2021), multistart runs were +performed on the basis of the refined fit shown above.

    +
    +saem_sforb_path_1_tc_reduced_multi <- multistart(saem_sforb_path_1_tc_reduced,
    +  n = 32, cores = 10)
    +
    +print(saem_sforb_path_1_tc_reduced_multi)
    +
    <multistart> object with 32 fits:
    + E OK 
    +15 17 
    +OK: Fit terminated successfully
    +E: Error
    +

    Out of the 32 fits that were initiated, only 17 terminated without an +error. The reason for this is that the wide variation of starting +parameters in combination with the parameter variation that is used in +the SAEM algorithm leads to parameter combinations for the degradation +model that the numerical integration routine cannot cope with. Because +of this variation of initial parameters, some of the model fits take up +to two times more time than the original fit.

    +
    +par(mar = c(12.1, 4.1, 2.1, 2.1))
    +parplot(saem_sforb_path_1_tc_reduced_multi, ylim = c(0.5, 2), las = 2)
    +
    +Parameter boxplots for the multistart runs that succeeded

    +Parameter boxplots for the multistart runs that succeeded +

    +
    +

    However, visual analysis of the boxplot of the parameters obtained in +the successful fits confirms that the results are sufficiently +independent of the starting parameters, and there are no remaining +ill-defined parameters.

    +
    +
    +
    +

    Plots of selected fits +

    +

    The SFORB pathway fits with full and reduced parameter distribution +model are shown below.

    +
    +plot(saem_1[["sforb_path_1", "tc"]])
    +
    +SFORB pathway fit with two-component error

    +SFORB pathway fit with two-component error +

    +
    +
    +plot(saem_sforb_path_1_tc_reduced)
    +
    +SFORB pathway fit with two-component error, reduced parameter model

    +SFORB pathway fit with two-component error, reduced parameter model +

    +
    +

    Plots of the remaining fits and listings for all successful fits are +shown in the Appendix.

    +
    +
    +

    Conclusions +

    +

    Pathway fits with SFO, FOMC, DFOP, SFORB and HS models for the parent +compound could be successfully performed.

    +
    +
    +

    Acknowledgements +

    +

    The helpful comments by Janina Wöltjen of the German Environment +Agency on earlier versions of this document are gratefully +acknowledged.

    +
    +
    +

    References +

    +
    +
    +Duchesne, Ronan, Anissa Guillemin, Olivier Gandrillon, and Fabien +Crauste. 2021. “Practical Identifiability in the Frame of +Nonlinear Mixed Effects Models: The Example of the in Vitro +Erythropoiesis.” BMC Bioinformatics 22 (478). https://doi.org/10.1186/s12859-021-04373-4. +
    +
    +Ranke, Johannes, Janina Wöltjen, Jana Schmidt, and Emmanuelle Comets. +2021. “Taking Kinetic Evaluations of Degradation Data to the Next +Level with Nonlinear Mixed-Effects Models.” Environments +8 (8). https://doi.org/10.3390/environments8080071. +
    +
    +
    +
    +

    Appendix +

    +
    +

    Plots of hierarchical fits not selected for refinement +

    +
    +plot(saem_1[["sfo_path_1", "tc"]])
    +
    +SFO pathway fit with two-component error

    +SFO pathway fit with two-component error +

    +
    +
    +plot(saem_1[["fomc_path_1", "tc"]])
    +
    +FOMC pathway fit with two-component error

    +FOMC pathway fit with two-component error +

    +
    +
    +plot(saem_1[["sforb_path_1", "tc"]])
    +
    +HS pathway fit with two-component error

    +HS pathway fit with two-component error +

    +
    +
    +
    +

    Hierarchical model fit listings +

    +
    +

    Fits with random effects for all degradation parameters +

    + +
    +
    +

    Improved fit of the SFORB pathway model with two-component +error +

    + +
    +
    +
    +

    Session info +

    +
    R version 4.2.2 Patched (2022-11-10 r83330)
    +Platform: x86_64-pc-linux-gnu (64-bit)
    +Running under: Debian GNU/Linux bookworm/sid
    +
    +Matrix products: default
    +BLAS:   /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
    +LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/libopenblas-r0.3.21.so
    +
    +locale:
    + [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
    + [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
    + [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
    + [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
    + [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    +[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       
    +
    +attached base packages:
    +[1] parallel  stats     graphics  grDevices utils     datasets  methods  
    +[8] base     
    +
    +other attached packages:
    +[1] saemix_3.2 npde_3.3   knitr_1.41 mkin_1.2.2
    +
    +loaded via a namespace (and not attached):
    + [1] deSolve_1.34      zoo_1.8-11        tidyselect_1.2.0  xfun_0.35        
    + [5] bslib_0.4.2       purrr_1.0.0       lattice_0.20-45   colorspace_2.0-3 
    + [9] vctrs_0.5.1       generics_0.1.3    htmltools_0.5.4   yaml_2.3.6       
    +[13] pkgbuild_1.4.0    utf8_1.2.2        rlang_1.0.6       pkgdown_2.0.7    
    +[17] jquerylib_0.1.4   pillar_1.8.1      glue_1.6.2        DBI_1.1.3        
    +[21] lifecycle_1.0.3   stringr_1.5.0     munsell_0.5.0     gtable_0.3.1     
    +[25] ragg_1.2.4        codetools_0.2-18  memoise_2.0.1     evaluate_0.19    
    +[29] inline_0.3.19     callr_3.7.3       fastmap_1.1.0     ps_1.7.2         
    +[33] lmtest_0.9-40     fansi_1.0.3       highr_0.9         scales_1.2.1     
    +[37] cachem_1.0.6      desc_1.4.2        jsonlite_1.8.4    systemfonts_1.0.4
    +[41] fs_1.5.2          textshaping_0.3.6 gridExtra_2.3     ggplot2_3.4.0    
    +[45] digest_0.6.31     stringi_1.7.8     processx_3.8.0    dplyr_1.0.10     
    +[49] grid_4.2.2        rprojroot_2.0.3   cli_3.5.0         tools_4.2.2      
    +[53] magrittr_2.0.3    sass_0.4.4        tibble_3.1.8      crayon_1.5.2     
    +[57] pkgconfig_2.0.3   prettyunits_1.1.1 assertthat_0.2.1  rmarkdown_2.19   
    +[61] R6_2.5.1          mclust_6.0.0      nlme_3.1-161      compiler_4.2.2   
    +
    +
    +

    Hardware info +

    +
    CPU model: AMD Ryzen 9 7950X 16-Core Processor
    +
    MemTotal:       64940452 kB
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/saem-sforb-path-1-tc-reduced-convergence-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/saem-sforb-path-1-tc-reduced-convergence-1.png new file mode 100644 index 00000000..206c424d Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/saem-sforb-path-1-tc-reduced-convergence-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-2-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 00000000..0fe084d3 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-3-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 00000000..1c81601e Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-4-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 00000000..e0961dce Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-5-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 00000000..00db0c76 Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-6-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 00000000..ac5271ec Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-7-1.png b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 00000000..1c81601e Binary files /dev/null and b/docs/dev/articles/prebuilt/2022_dmta_pathway_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/dev/authors.html b/docs/dev/authors.html index 165e2400..4146fdf2 100644 --- a/docs/dev/authors.html +++ b/docs/dev/authors.html @@ -23,7 +23,7 @@