From 6211f3ef4995657798686d8d4ab43ed9406e8a08 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 12 May 2020 16:34:00 +0200 Subject: Update vignettes and docs --- GNUmakefile | 4 + R/nlme.mmkin.R | 1 - docs/articles/FOCUS_D.html | 12 +- docs/articles/FOCUS_L.html | 372 +++++++++++---------- .../figure-html/unnamed-chunk-15-1.png | Bin 38623 -> 38622 bytes .../figure-html/unnamed-chunk-6-1.png | Bin 23884 -> 23881 bytes docs/articles/index.html | 2 +- docs/articles/twa.html | 35 +- docs/articles/web_only/FOCUS_Z.html | 285 ++++++++-------- .../figure-html/FOCUS_2006_Z_fits_1-1.png | Bin 85185 -> 88629 bytes .../figure-html/FOCUS_2006_Z_fits_10-1.png | Bin 128361 -> 133233 bytes .../figure-html/FOCUS_2006_Z_fits_11-1.png | Bin 127413 -> 132503 bytes .../figure-html/FOCUS_2006_Z_fits_11a-1.png | Bin 95903 -> 99562 bytes .../figure-html/FOCUS_2006_Z_fits_11b-1.png | Bin 22086 -> 22624 bytes .../figure-html/FOCUS_2006_Z_fits_2-1.png | Bin 85869 -> 88629 bytes .../figure-html/FOCUS_2006_Z_fits_3-1.png | Bin 85461 -> 88213 bytes .../figure-html/FOCUS_2006_Z_fits_5-1.png | Bin 102008 -> 104162 bytes .../figure-html/FOCUS_2006_Z_fits_6-1.png | Bin 128536 -> 133001 bytes .../figure-html/FOCUS_2006_Z_fits_7-1.png | Bin 128135 -> 132462 bytes .../figure-html/FOCUS_2006_Z_fits_9-1.png | Bin 108179 -> 110760 bytes docs/articles/web_only/NAFTA_examples.html | 281 +++++++--------- .../NAFTA_examples_files/figure-html/p7-1.png | Bin 66710 -> 66709 bytes docs/articles/web_only/benchmarks.html | 189 +++++------ docs/articles/web_only/compiled_models.html | 172 +++++----- docs/news/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/reference/AIC.mmkin.html | 2 +- docs/reference/CAKE_export.html | 49 +-- docs/reference/DFOP.solution.html | 2 +- docs/reference/Extract.mmkin.html | 60 ++-- docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html | 48 +-- docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html | 48 +-- docs/reference/FOCUS_2006_HS_ref_A_to_F.html | 48 +-- docs/reference/FOCUS_2006_SFO_ref_A_to_F.html | 48 +-- docs/reference/FOCUS_2006_datasets.html | 48 +-- docs/reference/FOMC.solution.html | 2 +- docs/reference/HS.solution.html | 2 +- docs/reference/IORE.solution.html | 2 +- docs/reference/NAFTA_SOP_2015.html | 50 +-- docs/reference/NAFTA_SOP_Attachment.html | 52 +-- docs/reference/SFO.solution.html | 2 +- docs/reference/SFORB.solution.html | 2 +- docs/reference/aw.html | 48 +-- docs/reference/confint.mkinfit.html | 6 +- docs/reference/create_deg_func.html | 10 +- docs/reference/experimental_data_for_UBA-1.png | Bin 92900 -> 107146 bytes docs/reference/experimental_data_for_UBA.html | 50 +-- docs/reference/get_deg_func.html | 2 +- docs/reference/ilr.html | 2 +- docs/reference/loftest-3.png | Bin 65397 -> 78761 bytes docs/reference/loftest-4.png | Bin 64457 -> 76899 bytes docs/reference/loftest-5.png | Bin 63057 -> 75806 bytes docs/reference/loftest.html | 49 +-- docs/reference/logLik.mkinfit.html | 2 +- docs/reference/lrtest.mkinfit.html | 48 +-- docs/reference/max_twa_parent.html | 2 +- docs/reference/mkin_long_to_wide.html | 50 +-- docs/reference/mkin_wide_to_long.html | 50 +-- docs/reference/mkinds.html | 2 +- docs/reference/mkinerrmin.html | 50 +-- docs/reference/mkinerrplot.html | 2 +- docs/reference/mkinfit.html | 26 +- docs/reference/mkinmod.html | 4 +- docs/reference/mkinparplot.html | 2 +- docs/reference/mkinplot.html | 49 +-- docs/reference/mkinpredict.html | 6 +- docs/reference/mkinresplot.html | 2 +- docs/reference/mkinsub.html | 50 +-- docs/reference/mmkin.html | 6 +- docs/reference/nafta.html | 2 +- docs/reference/nlme.html | 2 +- docs/reference/nlme.mmkin.html | 4 +- docs/reference/nobs.mkinfit.html | 47 +-- docs/reference/parms.html | 48 +-- docs/reference/plot.mkinfit.html | 2 +- docs/reference/plot.mmkin.html | 2 +- docs/reference/plot.nafta.html | 52 +-- docs/reference/plot.nlme.mmkin.html | 2 +- docs/reference/print.mkinds.html | 46 +-- docs/reference/print.mkinmod.html | 47 +-- docs/reference/reexports.html | 47 +-- docs/reference/residuals.mkinfit.html | 47 +-- docs/reference/schaefer07_complex_case-1.png | Bin 55626 -> 67740 bytes docs/reference/schaefer07_complex_case.html | 63 ++-- docs/reference/sigma_twocomp.html | 2 +- docs/reference/summary.mkinfit.html | 10 +- docs/reference/synthetic_data_for_UBA_2014-1.png | Bin 62550 -> 70430 bytes docs/reference/synthetic_data_for_UBA_2014.html | 93 +++--- docs/reference/test_data_from_UBA_2014-1.png | Bin 52908 -> 59294 bytes docs/reference/test_data_from_UBA_2014-2.png | Bin 68111 -> 78194 bytes docs/reference/test_data_from_UBA_2014.html | 109 +++--- docs/reference/transform_odeparms.html | 2 +- docs/reference/update.mkinfit.html | 49 +-- man/nlme.mmkin.Rd | 2 +- vignettes/mkin_benchmarks.rda | Bin 882 -> 0 bytes vignettes/web_only/benchmarks.Rmd | 97 ++++-- vignettes/web_only/benchmarks.html | 179 +++++----- vignettes/web_only/compiled_models.Rmd | 54 +-- vignettes/web_only/compiled_models.html | 81 +++-- vignettes/web_only/mkin_benchmarks.rda | Bin 797 -> 885 bytes 100 files changed, 1767 insertions(+), 1662 deletions(-) delete mode 100644 vignettes/mkin_benchmarks.rda diff --git a/GNUmakefile b/GNUmakefile index 0c28f3c4..abc115af 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -103,6 +103,10 @@ pd: roxygen "$(RBIN)/Rscript" -e "pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)" git add -A +pd_release: roxygen + "$(RBIN)/Rscript" -e "pkgdown::build_site(run_dont_run = TRUE)" + git add -A + r-forge: git archive master > $(HOME)/git/mkin/mkin.tar;\ cd $(RFDIR) && rm -r `ls` && tar -xf $(HOME)/git/mkin/mkin.tar;\ diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R index 355c3e34..fdf64fbf 100644 --- a/R/nlme.mmkin.R +++ b/R/nlme.mmkin.R @@ -154,7 +154,6 @@ nlme.mmkin <- function(model, data = sys.frame(sys.parent()), #' @export #' @rdname nlme.mmkin #' @param x An nlme.mmkin object to print -#' @param data Should the data be printed? #' @param ... Further arguments as in the generic print.nlme.mmkin <- function(x, ...) { x$call$data <- "Not shown" diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index 0a9ddf4a..10b8f685 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -31,7 +31,7 @@ mkin - 0.9.50 + 0.9.50.2 @@ -97,7 +97,7 @@

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2020-05-11

+

2020-05-12

Source: vignettes/FOCUS_D.Rmd @@ -175,10 +175,10 @@

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

summary(fit)
-
## mkin version used for fitting:    0.9.50 
+
## mkin version used for fitting:    0.9.50.2 
 ## R version used for fitting:       4.0.0 
-## Date of fit:     Mon May 11 05:14:41 2020 
-## Date of summary: Mon May 11 05:14:41 2020 
+## Date of fit:     Tue May 12 15:31:36 2020 
+## Date of summary: Tue May 12 15:31:36 2020 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent * parent
@@ -186,7 +186,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 421 model solutions performed in 0.167 s
+## Fitted using 421 model solutions performed in 0.165 s
 ## 
 ## Error model: Constant variance 
 ## 
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 4033beba..742718cb 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -6,19 +6,19 @@
 
 
 Example evaluation of FOCUS Laboratory Data L1 to L3 • mkin
-
-
-
-
+
+
+
+
+
 
-
-
+
 
 
-
+
     
@@ -87,12 +94,12 @@
@@ -103,28 +110,28 @@

Laboratory Data L1

The following code defines example dataset L1 from the FOCUS kinetics report, p. 284:

-
library("mkin", quietly = TRUE)
-FOCUS_2006_L1 = data.frame(
-  t = rep(c(0, 1, 2, 3, 5, 7, 14, 21, 30), each = 2),
-  parent = c(88.3, 91.4, 85.6, 84.5, 78.9, 77.6,
-             72.0, 71.9, 50.3, 59.4, 47.0, 45.1,
-             27.7, 27.3, 10.0, 10.4, 2.9, 4.0))
-FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)
+
library("mkin", quietly = TRUE)
+FOCUS_2006_L1 = data.frame(
+  t = rep(c(0, 1, 2, 3, 5, 7, 14, 21, 30), each = 2),
+  parent = c(88.3, 91.4, 85.6, 84.5, 78.9, 77.6,
+             72.0, 71.9, 50.3, 59.4, 47.0, 45.1,
+             27.7, 27.3, 10.0, 10.4, 2.9, 4.0))
+FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

Here we use the assumptions of simple first order (SFO), the case of declining rate constant over time (FOMC) and the case of two different phases of the kinetics (DFOP). For a more detailed discussion of the models, please see the FOCUS kinetics report.

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:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:46 2019 
-## Date of summary: Fri Nov  1 10:10:46 2019 
+
m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
+summary(m.L1.SFO)
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:38 2020 
+## Date of summary: Tue May 12 15:31:38 2020 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 133 model solutions performed in 0.287 s
+## Fitted using 133 model solutions performed in 0.03 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -143,6 +150,11 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC     BIC    logLik
+##   93.88778 96.5589 -43.94389
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##                   Estimate Std. Error  Lower  Upper
 ## parent_0            92.470    1.28200 89.740 95.200
@@ -151,9 +163,9 @@
 ## 
 ## Parameter correlation:
 ##                     parent_0 log_k_parent_sink      sigma
-## parent_0           1.000e+00         6.186e-01 -1.712e-09
-## log_k_parent_sink  6.186e-01         1.000e+00 -3.237e-09
-## sigma             -1.712e-09        -3.237e-09  1.000e+00
+## parent_0           1.000e+00         6.186e-01 -1.516e-09
+## log_k_parent_sink  6.186e-01         1.000e+00 -3.124e-09
+## sigma             -1.516e-09        -3.124e-09  1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -169,10 +181,6 @@
 ## All data   3.424       2  7
 ## parent     3.424       2  7
 ## 
-## Resulting formation fractions:
-##             ff
-## parent_sink  1
-## 
 ## Estimated disappearance times:
 ##         DT50  DT90
 ## parent 7.249 24.08
@@ -198,26 +206,26 @@
 ##    30   parent      2.9     5.251  -2.3513
 ##    30   parent      4.0     5.251  -1.2513

A plot of the fit is obtained with the plot function for mkinfit objects.

-
plot(m.L1.SFO, show_errmin = TRUE, main = "FOCUS L1 - SFO")
+
plot(m.L1.SFO, show_errmin = TRUE, main = "FOCUS L1 - SFO")

The residual plot can be easily obtained by

-
mkinresplot(m.L1.SFO, ylab = "Observed", xlab = "Time")
+
mkinresplot(m.L1.SFO, ylab = "Observed", xlab = "Time")

For comparison, the FOMC model is fitted as well, and the \(\chi^2\) error level is checked.

-
m.L1.FOMC <- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE)
+
m.L1.FOMC <- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE)
## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation did not converge:
 ## false convergence (8)
-
plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")
+
plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")

-
summary(m.L1.FOMC, data = FALSE)
+
summary(m.L1.FOMC, data = FALSE)
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
-
## mkin version used for fitting:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:48 2019 
-## Date of summary: Fri Nov  1 10:10:48 2019 
+
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
+## doubtful
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:38 2020 
+## Date of summary: Tue May 12 15:31:38 2020 
 ## 
 ## 
 ## Warning: Optimisation did not converge:
@@ -229,7 +237,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 899 model solutions performed in 1.91 s
+## Fitted using 380 model solutions performed in 0.081 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -250,29 +258,34 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   95.88778 99.44927 -43.94389
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##           Estimate Std. Error  Lower  Upper
-## parent_0     92.47     1.2800 89.730 95.220
-## log_alpha    10.58        NaN    NaN    NaN
-## log_beta     12.93        NaN    NaN    NaN
-## sigma         2.78     0.4507  1.813  3.747
+## parent_0     92.47     1.2820 89.720 95.220
+## log_alpha    16.92        NaN    NaN    NaN
+## log_beta     19.26        NaN    NaN    NaN
+## sigma         2.78     0.4501  1.814  3.745
 ## 
 ## Parameter correlation:
-##           parent_0 log_alpha log_beta   sigma
-## parent_0   1.00000       NaN      NaN 0.01452
-## log_alpha      NaN         1      NaN     NaN
-## log_beta       NaN       NaN        1     NaN
-## sigma      0.01452       NaN      NaN 1.00000
+##           parent_0 log_alpha log_beta    sigma
+## parent_0  1.000000       NaN      NaN 0.002218
+## log_alpha      NaN         1      NaN      NaN
+## log_beta       NaN       NaN        1      NaN
+## sigma     0.002218       NaN      NaN 1.000000
 ## 
 ## 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     92.47 72.13000 1.052e-19 89.730 95.220
-## alpha     39440.00  0.02397 4.906e-01     NA     NA
-## beta     412500.00  0.02397 4.906e-01     NA     NA
-## sigma         2.78  6.00000 1.628e-05  1.813  3.747
+##           Estimate t value Pr(>t)  Lower  Upper
+## parent_0 9.247e+01      NA     NA 89.720 95.220
+## alpha    2.223e+07      NA     NA     NA     NA
+## beta     2.325e+08      NA     NA     NA     NA
+## sigma    2.780e+00      NA     NA  1.814  3.745
 ## 
 ## FOCUS Chi2 error levels in percent:
 ##          err.min n.optim df
@@ -280,8 +293,8 @@
 ## parent     3.619       3  6
 ## 
 ## Estimated disappearance times:
-##         DT50  DT90 DT50back
-## parent 7.249 24.08    7.249
+## DT50 DT90 DT50back +## parent 7.25 24.08 7.25

We get a warning that the default optimisation algorithm Port did not converge, which is an indication that the model is overparameterised, i.e. contains too many parameters that are ill-defined as a consequence.

And in fact, due to the higher number of parameters, and the lower number of degrees of freedom of the fit, the \(\chi^2\) error level is actually higher for the FOMC model (3.6%) than for the SFO model (3.4%). Additionally, the parameters log_alpha and log_beta internally fitted in the model have excessive confidence intervals, that span more than 25 orders of magnitude (!) when backtransformed to the scale of alpha and beta. Also, the t-test for significant difference from zero does not indicate such a significant difference, with p-values greater than 0.1, and finally, the parameter correlation of log_alpha and log_beta is 1.000, clearly indicating that the model is overparameterised.

The \(\chi^2\) error levels reported in Appendix 3 and Appendix 7 to the FOCUS kinetics report are rounded to integer percentages and partly deviate by one percentage point from the results calculated by mkin. The reason for this is not known. However, mkin gives the same \(\chi^2\) error levels as the kinfit package and the calculation routines of the kinfit package have been extensively compared to the results obtained by the KinGUI software, as documented in the kinfit package vignette. KinGUI was the first widely used standard package in this field. Also, the calculation of \(\chi^2\) error levels was compared with KinGUII, CAKE and DegKin manager in a project sponsored by the German Umweltbundesamt (Ranke 2014).

@@ -290,19 +303,19 @@

Laboratory Data L2

The following code defines example dataset L2 from the FOCUS kinetics report, p. 287:

- +
FOCUS_2006_L2 = data.frame(
+  t = rep(c(0, 1, 3, 7, 14, 28), each = 2),
+  parent = c(96.1, 91.8, 41.4, 38.7,
+             19.3, 22.3, 4.6, 4.6,
+             2.6, 1.2, 0.3, 0.6))
+FOCUS_2006_L2_mkin <- mkin_wide_to_long(FOCUS_2006_L2)

SFO fit for L2

Again, the SFO model is fitted and the result is plotted. The residual plot can be obtained simply by adding the argument show_residuals to the plot command.

-
m.L2.SFO <- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
-plot(m.L2.SFO, show_residuals = TRUE, show_errmin = TRUE,
-     main = "FOCUS L2 - SFO")
+
m.L2.SFO <- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
+plot(m.L2.SFO, show_residuals = TRUE, show_errmin = TRUE,
+     main = "FOCUS L2 - SFO")

The \(\chi^2\) error level of 14% suggests that the model does not fit very well. This is also obvious from the plots of the fit, in which we have included the residual plot.

In the FOCUS kinetics report, it is stated that there is no apparent systematic error observed from the residual plot up to the measured DT90 (approximately at day 5), and there is an underestimation beyond that point.

@@ -312,22 +325,22 @@

FOMC fit for L2

For comparison, the FOMC model is fitted as well, and the \(\chi^2\) error level is checked.

-
m.L2.FOMC <- mkinfit("FOMC", FOCUS_2006_L2_mkin, quiet = TRUE)
-plot(m.L2.FOMC, show_residuals = TRUE,
-     main = "FOCUS L2 - FOMC")
+
m.L2.FOMC <- mkinfit("FOMC", FOCUS_2006_L2_mkin, quiet = TRUE)
+plot(m.L2.FOMC, show_residuals = TRUE,
+     main = "FOCUS L2 - FOMC")

-
summary(m.L2.FOMC, data = FALSE)
-
## mkin version used for fitting:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:49 2019 
-## Date of summary: Fri Nov  1 10:10:49 2019 
+
summary(m.L2.FOMC, data = FALSE)
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:39 2020 
+## Date of summary: Tue May 12 15:31:39 2020 
 ## 
 ## 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.489 s
+## Fitted using 239 model solutions performed in 0.047 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -348,6 +361,11 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   61.78966 63.72928 -26.89483
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##           Estimate Std. Error    Lower   Upper
 ## parent_0   93.7700     1.6130 90.05000 97.4900
@@ -357,10 +375,10 @@
 ## 
 ## Parameter correlation:
 ##             parent_0  log_alpha   log_beta      sigma
-## parent_0   1.000e+00 -1.151e-01 -2.085e-01 -7.637e-09
+## parent_0   1.000e+00 -1.151e-01 -2.085e-01 -7.436e-09
 ## log_alpha -1.151e-01  1.000e+00  9.741e-01 -1.617e-07
-## log_beta  -2.085e-01  9.741e-01  1.000e+00 -1.387e-07
-## sigma     -7.637e-09 -1.617e-07 -1.387e-07  1.000e+00
+## log_beta  -2.085e-01  9.741e-01  1.000e+00 -1.386e-07
+## sigma     -7.436e-09 -1.617e-07 -1.386e-07  1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -386,24 +404,24 @@
 

DFOP fit for L2

Fitting the four parameter DFOP model further reduces the \(\chi^2\) error level.

-
m.L2.DFOP <- mkinfit("DFOP", FOCUS_2006_L2_mkin, quiet = TRUE)
-plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
-     main = "FOCUS L2 - DFOP")
+
m.L2.DFOP <- mkinfit("DFOP", FOCUS_2006_L2_mkin, quiet = TRUE)
+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:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:51 2019 
-## Date of summary: Fri Nov  1 10:10:51 2019 
+
summary(m.L2.DFOP, data = FALSE)
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:39 2020 
+## Date of summary: Tue May 12 15:31:39 2020 
 ## 
 ## Equations:
-## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
-##            exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
-##            exp(-k2 * time))) * parent
+## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
+##            time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
+##            * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 572 model solutions performed in 1.218 s
+## Fitted using 572 model solutions performed in 0.13 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -426,21 +444,26 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   52.36695 54.79148 -21.18347
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##          Estimate Std. Error      Lower     Upper
 ## parent_0  93.9500  9.998e-01    91.5900   96.3100
-## log_k1     3.1370  2.376e+03 -5616.0000 5622.0000
+## log_k1     3.1370  2.376e+03 -5615.0000 5622.0000
 ## log_k2    -1.0880  6.285e-02    -1.2370   -0.9394
 ## g_ilr     -0.2821  7.033e-02    -0.4484   -0.1158
 ## sigma      1.4140  2.886e-01     0.7314    2.0960
 ## 
 ## Parameter correlation:
 ##            parent_0     log_k1     log_k2      g_ilr      sigma
-## parent_0  1.000e+00  5.155e-07  2.371e-09  2.665e-01 -6.849e-09
-## log_k1    5.155e-07  1.000e+00  8.434e-05 -1.659e-04 -7.791e-06
-## log_k2    2.371e-09  8.434e-05  1.000e+00 -7.903e-01 -1.262e-08
-## g_ilr     2.665e-01 -1.659e-04 -7.903e-01  1.000e+00  3.241e-08
-## sigma    -6.849e-09 -7.791e-06 -1.262e-08  3.241e-08  1.000e+00
+## parent_0  1.000e+00  5.157e-07  2.376e-09  2.665e-01 -6.837e-09
+## log_k1    5.157e-07  1.000e+00  8.434e-05 -1.659e-04 -7.786e-06
+## log_k2    2.376e-09  8.434e-05  1.000e+00 -7.903e-01 -1.263e-08
+## g_ilr     2.665e-01 -1.659e-04 -7.903e-01  1.000e+00  3.248e-08
+## sigma    -6.837e-09 -7.786e-06 -1.263e-08  3.248e-08  1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -468,18 +491,18 @@
 

Laboratory Data L3

The following code defines example dataset L3 from the FOCUS kinetics report, p. 290.

-
FOCUS_2006_L3 = data.frame(
-  t = c(0, 3, 7, 14, 30, 60, 91, 120),
-  parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
-FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)
+
FOCUS_2006_L3 = data.frame(
+  t = c(0, 3, 7, 14, 30, 60, 91, 120),
+  parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
+FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)

Fit multiple models

As of mkin version 0.9-39 (June 2015), we can fit several models to one or more datasets in one call to the function mmkin. The datasets have to be passed in a list, in this case a named list holding only the L3 dataset prepared above.

-
# Only use one core here, not to offend the CRAN checks
-mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
-               list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
-plot(mm.L3)
+
# Only use one core here, not to offend the CRAN checks
+mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
+               list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
+plot(mm.L3)

The \(\chi^2\) error level of 21% as well as the plot suggest that the SFO model does not fit very well. The FOMC model performs better, with an error level at which the \(\chi^2\) test passes of 7%. Fitting the four parameter DFOP model further reduces the \(\chi^2\) error level considerably.

@@ -488,20 +511,20 @@ Accessing mmkin objects

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:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:53 2019 
-## Date of summary: Fri Nov  1 10:10:53 2019 
+
summary(mm.L3[["DFOP", 1]])
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:39 2020 
+## Date of summary: Tue May 12 15:31:40 2020 
 ## 
 ## Equations:
-## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
-##            exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
-##            exp(-k2 * time))) * parent
+## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
+##            time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
+##            * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 373 model solutions performed in 0.784 s
+## Fitted using 373 model solutions performed in 0.083 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -524,6 +547,11 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   32.97732 33.37453 -11.48866
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##          Estimate Std. Error   Lower      Upper
 ## parent_0  97.7500    1.01900 94.5000 101.000000
@@ -534,11 +562,11 @@
 ## 
 ## Parameter correlation:
 ##            parent_0     log_k1     log_k2      g_ilr      sigma
-## parent_0  1.000e+00  1.732e-01  2.282e-02  4.009e-01 -6.872e-07
-## log_k1    1.732e-01  1.000e+00  4.945e-01 -5.809e-01  3.200e-07
-## log_k2    2.282e-02  4.945e-01  1.000e+00 -6.812e-01  7.673e-07
-## g_ilr     4.009e-01 -5.809e-01 -6.812e-01  1.000e+00 -8.731e-07
-## sigma    -6.872e-07  3.200e-07  7.673e-07 -8.731e-07  1.000e+00
+## parent_0  1.000e+00  1.732e-01  2.282e-02  4.009e-01 -6.868e-07
+## log_k1    1.732e-01  1.000e+00  4.945e-01 -5.809e-01  3.175e-07
+## log_k2    2.282e-02  4.945e-01  1.000e+00 -6.812e-01  7.631e-07
+## g_ilr     4.009e-01 -5.809e-01 -6.812e-01  1.000e+00 -8.694e-07
+## sigma    -6.868e-07  3.175e-07  7.631e-07 -8.694e-07  1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -570,7 +598,7 @@
 ##    60   parent     22.0     23.26 -1.25919
 ##    91   parent     15.0     15.18 -0.18181
 ##   120   parent     12.0     10.19  1.81395
-
plot(mm.L3[["DFOP", 1]], show_errmin = TRUE)
+
plot(mm.L3[["DFOP", 1]], show_errmin = TRUE)

Here, a look to the model plot, the confidence intervals of the parameters and the correlation matrix suggest that the parameter estimates are reliable, and the DFOP model can be used as the best-fit model based on the \(\chi^2\) error level criterion for laboratory data L3.

This is also an example where the standard t-test for the parameter g_ilr is misleading, as it tests for a significant difference from zero. In this case, zero appears to be the correct value for this parameter, and the confidence interval for the backtransformed parameter g is quite narrow.

@@ -580,30 +608,30 @@

Laboratory Data L4

The following code defines example dataset L4 from the FOCUS kinetics report, p. 293:

-
FOCUS_2006_L4 = data.frame(
-  t = c(0, 3, 7, 14, 30, 60, 91, 120),
-  parent = c(96.6, 96.3, 94.3, 88.8, 74.9, 59.9, 53.5, 49.0))
-FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4)
+
FOCUS_2006_L4 = data.frame(
+  t = c(0, 3, 7, 14, 30, 60, 91, 120),
+  parent = c(96.6, 96.3, 94.3, 88.8, 74.9, 59.9, 53.5, 49.0))
+FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4)

Fits of the SFO and FOMC models, plots and summaries are produced below:

-
# Only use one core here, not to offend the CRAN checks
-mm.L4 <- mmkin(c("SFO", "FOMC"), cores = 1,
-               list("FOCUS L4" = FOCUS_2006_L4_mkin),
-               quiet = TRUE)
-plot(mm.L4)
+
# Only use one core here, not to offend the CRAN checks
+mm.L4 <- mmkin(c("SFO", "FOMC"), cores = 1,
+               list("FOCUS L4" = FOCUS_2006_L4_mkin),
+               quiet = TRUE)
+plot(mm.L4)

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:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:53 2019 
-## Date of summary: Fri Nov  1 10:10:54 2019 
+
summary(mm.L4[["SFO", 1]], data = FALSE)
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:40 2020 
+## Date of summary: Tue May 12 15:31:40 2020 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 142 model solutions performed in 0.292 s
+## Fitted using 142 model solutions performed in 0.029 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -622,6 +650,11 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   47.12133 47.35966 -20.56067
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##                   Estimate Std. Error  Lower   Upper
 ## parent_0            96.440    1.69900 92.070 100.800
@@ -630,9 +663,9 @@
 ## 
 ## Parameter correlation:
 ##                    parent_0 log_k_parent_sink     sigma
-## parent_0          1.000e+00         5.938e-01 3.440e-07
-## log_k_parent_sink 5.938e-01         1.000e+00 5.885e-07
-## sigma             3.440e-07         5.885e-07 1.000e+00
+## parent_0          1.000e+00         5.938e-01 3.387e-07
+## log_k_parent_sink 5.938e-01         1.000e+00 5.830e-07
+## sigma             3.387e-07         5.830e-07 1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -648,25 +681,21 @@
 ## All data   3.287       2  6
 ## parent     3.287       2  6
 ## 
-## Resulting formation fractions:
-##             ff
-## parent_sink  1
-## 
 ## Estimated disappearance times:
 ##        DT50 DT90
 ## parent  106  352
-
summary(mm.L4[["FOMC", 1]], data = FALSE)
-
## mkin version used for fitting:    0.9.49.6 
-## R version used for fitting:       3.6.1 
-## Date of fit:     Fri Nov  1 10:10:54 2019 
-## Date of summary: Fri Nov  1 10:10:54 2019 
+
summary(mm.L4[["FOMC", 1]], data = FALSE)
+
## mkin version used for fitting:    0.9.50.2 
+## R version used for fitting:       4.0.0 
+## Date of fit:     Tue May 12 15:31:40 2020 
+## Date of summary: Tue May 12 15:31:40 2020 
 ## 
 ## 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.455 s
+## Fitted using 224 model solutions performed in 0.044 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -687,6 +716,11 @@
 ## Fixed parameter values:
 ## None
 ## 
+## Results:
+## 
+##        AIC      BIC    logLik
+##   40.37255 40.69032 -16.18628
+## 
 ## Optimised, transformed parameters with symmetric confidence intervals:
 ##           Estimate Std. Error   Lower    Upper
 ## parent_0   99.1400     1.2670 95.6300 102.7000
@@ -696,10 +730,10 @@
 ## 
 ## Parameter correlation:
 ##             parent_0  log_alpha   log_beta      sigma
-## parent_0   1.000e+00 -4.696e-01 -5.543e-01 -2.563e-07
-## log_alpha -4.696e-01  1.000e+00  9.889e-01  4.066e-08
-## log_beta  -5.543e-01  9.889e-01  1.000e+00  6.818e-08
-## sigma     -2.563e-07  4.066e-08  6.818e-08  1.000e+00
+## parent_0   1.000e+00 -4.696e-01 -5.543e-01 -2.456e-07
+## log_alpha -4.696e-01  1.000e+00  9.889e-01  2.169e-08
+## log_beta  -5.543e-01  9.889e-01  1.000e+00  4.910e-08
+## sigma     -2.456e-07  2.169e-08  4.910e-08  1.000e+00
 ## 
 ## Backtransformed parameters:
 ## Confidence intervals for internally transformed parameters are asymmetric.
@@ -731,31 +765,11 @@
 
- @@ -766,7 +780,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png index 2e5071d9..db54326e 100644 Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png index 16235059..bfa271dd 100644 Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 6f97722c..5e32cfde 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -154,7 +154,7 @@
Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance
-
Benchmark timings for mkin on various systems
+
Benchmark timings for mkin
Performance benefit by using compiled model definitions in mkin
diff --git a/docs/articles/twa.html b/docs/articles/twa.html index 8d8bac0e..b58306f1 100644 --- a/docs/articles/twa.html +++ b/docs/articles/twa.html @@ -6,19 +6,19 @@ Calculation of time weighted average concentrations with mkin • mkin - - - - + + + + + - - + - +
@@ -87,12 +94,12 @@
@@ -138,7 +145,7 @@
-
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html index 14234785..0c34d77d 100644 --- a/docs/articles/web_only/FOCUS_Z.html +++ b/docs/articles/web_only/FOCUS_Z.html @@ -6,19 +6,19 @@ Example evaluation of FOCUS dataset Z • mkin - - - - + + + + + - - + - +
@@ -87,12 +94,12 @@
@@ -104,71 +111,71 @@

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

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"))
+
Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
+                Z1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
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)
+
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)

-
summary(m.Z.2a, data = FALSE)$bpar
-
##             Estimate se_notrans    t value     Pr(>t)    Lower    Upper
-## Z0_0      9.7015e+01   3.393176 2.8591e+01 6.4352e-21 91.66556 102.3642
-## k_Z0_sink 7.2231e-10   0.225254 3.2067e-09 5.0000e-01  0.00000      Inf
-## k_Z0_Z1   2.2360e+00   0.159134 1.4051e+01 1.1369e-13  1.95303   2.5600
-## k_Z1_sink 4.8212e-01   0.065454 7.3658e+00 5.1186e-08  0.40341   0.5762
-## sigma     4.8041e+00   0.637618 7.5345e+00 3.4431e-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")
## Successfully compiled differential equation model from auto-generated C code.
-
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)
+
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)

-
summary(m.Z.2a.ff, data = FALSE)$bpar
+
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.8155e-08  0.40341   0.5762
+## 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")
+
Z.3 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+               Z1 = mkinsub("SFO"), use_of_ff = "max")
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.3 <- mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE)
+
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
+
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
@@ -180,52 +187,51 @@
 

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")
+
Z.5 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+               Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+               Z2 = mkinsub("SFO"), use_of_ff = "max")
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.5 <- mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE)
+
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")
+
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")
## Successfully compiled differential equation model from auto-generated C code.
- -
## 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
-
plot_sep(m.Z.FOCUS)
+
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)

-
summary(m.Z.FOCUS, data = FALSE)$bpar
+
summary(m.Z.FOCUS, data = FALSE)$bpar
##             Estimate se_notrans t value     Pr(>t)     Lower      Upper
-## Z0_0       96.838607   1.994273 48.5584 4.0283e-42 92.826626 100.850589
-## k_Z0        2.215405   0.118459 18.7018 1.0415e-23  1.989465   2.467003
-## k_Z1        0.478300   0.028257 16.9267 6.2408e-22  0.424701   0.538662
-## k_Z2        0.451618   0.042138 10.7177 1.6308e-14  0.374328   0.544867
-## k_Z3        0.058693   0.015246  3.8498 1.7806e-04  0.034805   0.098978
-## f_Z2_to_Z3  0.471508   0.058352  8.0804 9.6648e-11  0.357735   0.588320
+## Z0_0       96.838721   1.994275 48.5584 4.0283e-42 92.826878 100.850563
+## k_Z0        2.215400   0.118459 18.7019 1.0414e-23  1.989462   2.466998
+## k_Z1        0.478301   0.028257 16.9267 6.2411e-22  0.424705   0.538662
+## k_Z2        0.451623   0.042138 10.7176 1.6313e-14  0.374336   0.544867
+## k_Z3        0.058694   0.015246  3.8499 1.7804e-04  0.034809   0.098967
+## f_Z2_to_Z3  0.471510   0.058352  8.0804 9.6640e-11  0.357775   0.588283
 ## sigma       3.984431   0.383402 10.3923 4.5575e-14  3.213126   4.755736
-
endpoints(m.Z.FOCUS)
+
endpoints(m.Z.FOCUS)
## $ff
 ##   Z2_Z3 Z2_sink 
 ## 0.47151 0.52849 
 ## 
-## $SFORB
-## logical(0)
-## 
 ## $distimes
 ##        DT50    DT90
 ## Z0  0.31288  1.0394
 ## Z1  1.44919  4.8141
-## Z2  1.53481  5.0985
-## Z3 11.80965 39.2308
+## Z2 1.53479 5.0985 +## Z3 11.80955 39.2305

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.

@@ -233,87 +239,85 @@ 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"))
+
Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
-
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)
+
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)

-
summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
+
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"))
+
Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
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)
+
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)

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"))
+
Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
- +
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"))
+
Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
- +
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)
+## 4$bparms.ode[1:4], : Observations with value of zero were removed from the data
+
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
-
plot_sep(m.Z.mkin.5a)
+## 5$bparms.ode[1:7], : Observations with value of zero were removed from the data
+
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)
+
endpoints(m.Z.mkin.5a)
## $ff
-##   Z0_free_Z1        Z1_Z2      Z2_sink   Z2_Z3_free Z3_free_sink 
-##      1.00000      1.00000      0.46344      0.53656      1.00000 
+## 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.4471381 0.0075124 0.0800075 0.0000000 
+## 2.4471358 0.0075126 0.0800073 0.0000000 
 ## 
 ## $distimes
 ##      DT50   DT90 DT50_Z0_b1 DT50_Z0_b2 DT50_Z3_b1 DT50_Z3_b2
-## Z0 0.3043 1.1848    0.28325     92.267         NA         NA
+## Z0 0.3043 1.1848    0.28325     92.265         NA         NA
 ## Z1 1.5148 5.0320         NA         NA         NA         NA
 ## Z2 1.6414 5.4526         NA         NA         NA         NA
-## Z3     NA     NA         NA         NA     8.6635        Inf
+## Z3 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.

@@ -328,20 +332,11 @@
- @@ -352,7 +347,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png index 76826836..23d051ce 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png index 25249a9a..d3702fb6 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png index f9c28e5a..4a6fce4f 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png index 6926c367..dd6537b7 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png index 7764f4e2..b986c30b 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png index c84e21f1..23d051ce 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png index 38805220..6e9f4efa 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png index e1cbf084..146acea9 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png index 30f6a0b7..47d806c0 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png index 891d95e1..7db8b07d 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png differ diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png index ea4f89e6..0c698299 100644 Binary files a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png and b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples.html b/docs/articles/web_only/NAFTA_examples.html index fecbe3b1..411341b8 100644 --- a/docs/articles/web_only/NAFTA_examples.html +++ b/docs/articles/web_only/NAFTA_examples.html @@ -6,19 +6,19 @@ Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance • mkin - - - - + + + + + - - + - +
@@ -87,12 +94,12 @@
@@ -112,12 +119,12 @@

Example on page 5, upper panel

-
p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
+
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)
+
print(p5a)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 465.21753  56.27506  32.06401 
@@ -143,7 +150,7 @@
 ##          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.86e-12 5.00e-01  0.0000      Inf
+## k2       2.17e-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
 ## 
@@ -152,7 +159,7 @@
 ##      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 4.42e+11 2.42e+11
+## DFOP 55.5 5.83e+11 3.20e+11
 ## 
 ## Representative half-life:
 ## [1] 321.51
@@ -160,12 +167,12 @@

Example on page 5, lower panel

-
p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
+
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)
+
print(p5b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 94.81123 10.10936  7.55871 
@@ -191,7 +198,7 @@
 ##          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       1.16e-11 5.00e-01  0.0000     Inf
+## k2       1.04e-11 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
 ## 
@@ -200,7 +207,7 @@
 ##      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 9.80e+10 5.98e+10
+## DFOP 83.6 1.09e+11 6.67e+10
 ## 
 ## Representative half-life:
 ## [1] 215.87
@@ -208,12 +215,12 @@

Example on page 6

-
p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
+
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)
+
print(p6)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 188.45361  51.00699  42.46931 
@@ -239,7 +246,7 @@
 ##          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       4.90e-11 5.00e-01  0.0000     Inf
+## k2       3.88e-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
 ## 
@@ -248,7 +255,7 @@
 ##      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 6.66e+09 1.41e+10
+## DFOP 34.1 8.42e+09 1.79e+10
 ## 
 ## Representative half-life:
 ## [1] 53.17
@@ -256,12 +263,12 @@

Example on page 7

-
p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
+
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)
+
print(p7)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 3661.661 3195.030 3174.145 
@@ -287,7 +294,7 @@
 ##          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       1.97e-10 5.00e-01  0.0000      Inf
+## k2       2.30e-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
 ## 
@@ -296,7 +303,7 @@
 ##      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 6.97e+09 3.52e+09
+## DFOP 96.4 5.95e+09 3.01e+09
 ## 
 ## Representative half-life:
 ## [1] 454.55
@@ -309,12 +316,12 @@

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_sink = 1e-3))
+
p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent_sink = 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)
+
print(p8)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 1996.9408  444.9237  547.5616 
@@ -361,12 +368,12 @@
 

Example on page 9, upper panel

-
p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
+
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)
+
print(p9a)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 839.35238  88.57064   9.93363 
@@ -392,7 +399,7 @@
 ##          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       6.02e-13 5.00e-01  0.000    Inf
+## k2       6.69e-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
 ## 
@@ -401,7 +408,7 @@
 ##      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 2.07e+12 1.15e+12
+## DFOP 10.5 1.86e+12 1.04e+12
 ## 
 ## Representative half-life:
 ## [1] 101.43
@@ -410,17 +417,12 @@

Example on page 9, lower panel

-
p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
-
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
-
## Warning in sqrt(diag(covar_notrans)): NaNs wurden erzeugt
-
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
## 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)
+
print(p9b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 35.64867 23.22334 35.64867 
@@ -447,7 +449,7 @@
 ## parent_0  94.7123 1.61e-16 93.1355 96.2891
 ## k1         0.0389 1.43e-06  0.0312  0.0485
 ## k2         0.0389 6.67e-03  0.0186  0.0812
-## g          0.7742      NaN      NA      NA
+## g          0.7742 5.00e-01  0.0000  1.0000
 ## sigma      1.5957 2.50e-04  0.9135  2.2779
 ## 
 ## 
@@ -464,12 +466,12 @@
 

Example on page 10

-
p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
+
p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
## 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)
+
print(p10)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 899.4089 336.4348 899.4089 
@@ -492,12 +494,12 @@
 ## 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.42e-04  0.0301   0.0814
-## k2         0.0495 1.66e-02  0.0200   0.1225
-## g          0.6634 5.00e-01  0.0000   1.0000
-## sigma      8.0152 2.50e-04  4.5886  11.4418
+##          Estimate   Pr(>t)   Lower   Upper
+## parent_0 101.7315 1.41e-09 91.6534 111.810
+## k1         0.0495 6.48e-04  0.0303   0.081
+## k2         0.0495 1.67e-02  0.0201   0.122
+## g          0.6634 5.00e-01  0.0000   1.000
+## sigma      8.0152 2.50e-04  4.5886  11.442
 ## 
 ## 
 ## DTx values:
@@ -517,12 +519,12 @@
 

Example on page 11

-
p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
+
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)
+
print(p11)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 579.6805 204.7932 144.7783 
@@ -560,7 +562,7 @@
 ## DFOP 4.21e+11 2.64e+12 9.56e+11
 ## 
 ## Representative half-life:
-## [1] 41148169
+## [1] 41148171

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.

@@ -571,14 +573,14 @@

Example on page 12, upper panel

-
p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
-
## Warning in summary.mkinfit(x): Could not calculate correlation; no
-## covariance matrix
+
p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
+
## Warning in summary.mkinfit(x): Could not calculate correlation; no covariance
+## matrix
## 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)
+
print(p12a)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 695.4440 220.0685 695.4440 
@@ -603,8 +605,8 @@
 ## $DFOP
 ##          Estimate   Pr(>t)   Lower   Upper
 ## parent_0  100.521 2.74e-10 92.2366 108.805
-## k1          0.124 5.74e-06  0.0958   0.161
-## k2          0.124 6.61e-02  0.0319   0.484
+## k1          0.124 5.75e-06  0.0958   0.161
+## k2          0.124 6.72e-02  0.0319   0.484
 ## g           0.877 5.00e-01  0.0000   1.000
 ## sigma       7.048 2.50e-04  4.0349  10.061
 ## 
@@ -621,20 +623,20 @@
 

Example on page 12, lower panel

-
p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
+
p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in qt(alpha/2, rdf): NaNs wurden erzeugt
## Warning in qt(1 - alpha/2, rdf): NaNs wurden erzeugt
## Warning in sqrt(diag(covar_notrans)): NaNs wurden erzeugt
## Warning in pt(abs(tval), rdf, lower.tail = FALSE): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
## 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(p12b)
+
plot(p12b)

-
print(p12b)
+
print(p12b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 58.90242 19.06353 58.90242 
@@ -677,16 +679,12 @@
 

Example on page 13

-
p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
-
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
-
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
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)
+
print(p13)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 174.5971 142.3951 174.5971 
@@ -711,9 +709,9 @@
 ## $DFOP
 ##          Estimate   Pr(>t)    Lower    Upper
 ## parent_0 92.73500 9.25e-15 8.95e+01 9.59e+01
-## k1        0.00258 4.28e-01 1.70e-08 3.92e+02
+## k1        0.00258 4.28e-01 1.45e-08 4.61e+02
 ## k2        0.00258 3.69e-08 2.20e-03 3.03e-03
-## g         0.00442 5.00e-01       NA       NA
+## g         0.00442 5.00e-01 0.00e+00 1.00e+00
 ## sigma     3.41172 1.35e-04 2.02e+00 4.80e+00
 ## 
 ## 
@@ -730,16 +728,16 @@
 

DT50 not observed in the study and DFOP problems in PestDF

-
p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
+
p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
## 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)
+
print(p14)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 48.43249 28.67746 27.26248 
@@ -765,7 +763,7 @@
 ##          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       7.29e-12 5.00e-01  0.00000      Inf
+## k2       7.70e-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
 ## 
@@ -774,7 +772,7 @@
 ##          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 2.54e+10 2.46e+11 9.51e+10
+## DFOP 2.41e+10 2.33e+11 9.00e+10
 ## 
 ## Representative half-life:
 ## [1] 6697.44
@@ -783,17 +781,16 @@

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

-
p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
+
p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
-
## Warning in sqrt(diag(covar_notrans)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
## 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(p15a)
+
plot(p15a)

-
print(p15a)
+
print(p15a)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 245.5248 135.0132 245.5248 
@@ -816,12 +813,12 @@
 ## sigma                  3.105 1.78e-04  1.795  4.416
 ## 
 ## $DFOP
-##          Estimate   Pr(>t)    Lower    Upper
-## parent_0 97.96752 2.85e-13 94.21914 101.7159
-## k1        0.00952 6.80e-02  0.00277   0.0327
-## k2        0.00952 3.82e-06  0.00902   0.0100
-## g         0.17247      NaN       NA       NA
-## sigma     4.18778 2.50e-04  2.39747   5.9781
+##          Estimate Pr(>t)    Lower    Upper
+## parent_0 97.96752     NA 94.21914 101.7159
+## k1        0.00952     NA  0.00241   0.0377
+## k2        0.00952     NA  0.00747   0.0121
+## g         0.17247     NA       NA       NA
+## sigma     4.18778     NA  2.39747   5.9781
 ## 
 ## 
 ## DTx values:
@@ -832,16 +829,16 @@
 ## 
 ## Representative half-life:
 ## [1] 41.33
-
p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
+
p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
-## result is doubtful
+
## 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)
+
print(p15b)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 106.91629  68.55574 106.91629 
@@ -858,18 +855,18 @@
 ## 
 ## $IORE
 ##                     Estimate   Pr(>t)    Lower  Upper
-## parent_0               99.83 1.81e-16 97.51349 102.14
+## parent_0               99.83 1.81e-16 97.51348 102.14
 ## k__iore_parent_sink     0.38 3.22e-01  0.00352  41.05
-## N_parent                0.00 5.00e-01 -1.07695   1.08
+## 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 6.75e-04 3.49e-02
-## k2       4.86e-03     NA 3.37e-03 6.99e-03
+## parent_0 1.01e+02     NA 98.24464 1.04e+02
+## k1       4.86e-03     NA  0.00068 3.47e-02
+## k2       4.86e-03     NA  0.00338 6.99e-03
 ## g        1.50e-01     NA       NA       NA
-## sigma    2.76e+00     NA 1.58e+00 3.94e+00
+## sigma    2.76e+00     NA  1.58208 3.94e+00
 ## 
 ## 
 ## DTx values:
@@ -885,14 +882,14 @@
 

The DFOP fraction parameter is greater than 1

-
p16 <- nafta(NAFTA_SOP_Attachment[["p16"]])
+
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)
+
print(p16)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 3831.804 2062.008 1550.980 
@@ -917,7 +914,7 @@
 ## $DFOP
 ##          Estimate   Pr(>t)   Lower  Upper
 ## parent_0  88.5333 7.40e-18 79.9836 97.083
-## k1        18.5561 5.00e-01  0.0000    Inf
+## k1        18.5560 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
@@ -950,53 +947,11 @@
 
- @@ -1007,7 +962,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png index ef5e72ed..218a790f 100644 Binary files a/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png differ diff --git a/docs/articles/web_only/benchmarks.html b/docs/articles/web_only/benchmarks.html index ad7cf62c..b47df46f 100644 --- a/docs/articles/web_only/benchmarks.html +++ b/docs/articles/web_only/benchmarks.html @@ -5,13 +5,13 @@ -Benchmark timings for mkin on various systems • mkin +Benchmark timings for mkin • mkin - + - - - + + + + + - - + - +
@@ -87,12 +94,12 @@
@@ -103,99 +110,90 @@

How to benefit from compiled models

When using an mkin version equal to or greater than 0.9-36 and a C compiler is available, you will see a message that the model is being compiled from autogenerated C code when defining a model using mkinmod. Starting from version 0.9.49.9, the mkinmod() function checks for presence of a compiler using

- +
pkgbuild::has_compiler()

In previous versions, it used Sys.which("gcc") for this check.

On Linux, you need to have the essential build tools like make and gcc or clang installed. On Debian based linux distributions, these will be pulled in by installing the build-essential package.

On MacOS, which I do not use personally, I have had reports that a compiler is available by default.

On Windows, you need to install Rtools and have the path to its bin directory in your PATH variable. You do not need to modify the PATH variable when installing Rtools. Instead, I would recommend to put the line

-
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
+
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))

into your .Rprofile startup file. This is just a text file with some R code that is executed when your R session starts. It has to be named .Rprofile and has to be located in your home directory, which will generally be your Documents folder. You can check the location of the home directory used by R by issuing

-
Sys.getenv("HOME")
+
Sys.getenv("HOME")
-
+

-Comparison with Eigenvalue based solutions

-

First, we build a simple degradation model for a parent compound with one metabolite.

-
library("mkin", quietly = TRUE)
-SFO_SFO <- mkinmod(
-  parent = mkinsub("SFO", "m1"),
-  m1 = mkinsub("SFO"))
+Comparison with other solution methods +

First, we build a simple degradation model for a parent compound with one metabolite, and we remove zero values from the dataset.

+
library("mkin", quietly = TRUE)
+SFO_SFO <- mkinmod(
+  parent = mkinsub("SFO", "m1"),
+  m1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-

We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the benchmark package. In the output of below code, the warnings about zero being removed from the FOCUS D dataset are suppressed.

- -
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   3.107    1.000     3.105        0
-## 1 deSolve, not compiled            3  28.765    9.258    28.749        0
-## 2      Eigenvalue based            3   4.446    1.431     4.445        0
-##   user.child sys.child
-## 3          0         0
-## 1          0         0
-## 2          0         0
-

We see that using the compiled model is by a factor of around 9 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs.

+
FOCUS_D <- subset(FOCUS_2006_D, value != 0)
+

We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the benchmark package. In the output of below code, the warnings about zero being removed from the FOCUS D dataset are suppressed. Since mkin version 0.9.49.11, an analytical solution is also implemented, which is included in the tests below.

+
if (require(rbenchmark)) {
+  b.1 <- benchmark(
+    "deSolve, not compiled" = mkinfit(SFO_SFO, FOCUS_D,
+       solution_type = "deSolve",
+       use_compiled = FALSE, quiet = TRUE),
+    "Eigenvalue based" = mkinfit(SFO_SFO, FOCUS_D,
+       solution_type = "eigen", quiet = TRUE),
+    "deSolve, compiled" = mkinfit(SFO_SFO, FOCUS_D,
+       solution_type = "deSolve", quiet = TRUE),
+    "analytical" = mkinfit(SFO_SFO, FOCUS_D,
+       solution_type = "analytical",
+       use_compiled = FALSE, quiet = TRUE),
+    replications = 1, order = "relative",
+    columns = c("test", "replications", "relative", "elapsed"))
+  print(b.1)
+} else {
+  print("R package rbenchmark is not available")
+}
+
##                    test replications relative elapsed
+## 4            analytical            1    1.000   0.190
+## 3     deSolve, compiled            1    1.774   0.337
+## 2      Eigenvalue based            1    2.105   0.400
+## 1 deSolve, not compiled            1   42.763   8.125
+

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

-
+

-Model that can not be solved with Eigenvalues

-

This evaluation is also taken from the example section of mkinfit.

-
if (require(rbenchmark)) {
-  FOMC_SFO <- mkinmod(
-    parent = mkinsub("FOMC", "m1"),
-    m1 = mkinsub( "SFO"))
-
-  b.2 <- benchmark(
-    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D,
-                                      use_compiled = FALSE, quiet = TRUE),
-    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
-    replications = 3)
-  print(b.2)
-  factor_FOMC_SFO <- round(b.2["1", "relative"])
-} else {
-  factor_FOMC_SFO <- NA
-  print("R package benchmark is not available")
-}
+Model without analytical solution +

This evaluation is also taken from the example section of mkinfit. No analytical solution is available for this system, and now Eigenvalue based solution is possible, so only deSolve using with or without compiled code is available.

+
if (require(rbenchmark)) {
+  FOMC_SFO <- mkinmod(
+    parent = mkinsub("FOMC", "m1"),
+    m1 = mkinsub( "SFO"))
+
+  b.2 <- benchmark(
+    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_D,
+                                      use_compiled = FALSE, quiet = TRUE),
+    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_D, quiet = TRUE),
+    replications = 1, order = "relative",
+    columns = c("test", "replications", "relative", "elapsed"))
+  print(b.2)
+  factor_FOMC_SFO <- round(b.2["1", "relative"])
+} else {
+  factor_FOMC_SFO <- NA
+  print("R package benchmark is not available")
+}
## Successfully compiled differential equation model from auto-generated C code.
-
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   4.844    1.000     4.842        0
-## 1 deSolve, not compiled            3  53.833   11.113    53.807        0
-##   user.child sys.child
-## 2          0         0
-## 1          0         0
-

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

-

This vignette was built with mkin 0.9.49.9 on

-
## R version 3.6.3 (2020-02-29)
+
##                    test replications relative elapsed
+## 2     deSolve, compiled            1    1.000   0.476
+## 1 deSolve, not compiled            1   30.103  14.329
+

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

+

This vignette was built with mkin 0.9.50.2 on

+
## R version 4.0.0 (2020-04-24)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
 ## Running under: Debian GNU/Linux 10 (buster)
## CPU model: AMD Ryzen 7 1700 Eight-Core Processor
- @@ -206,7 +204,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/news/index.html b/docs/news/index.html index 2795b09b..d61e532a 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -140,7 +140,7 @@

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

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

  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 15b8ca37..8f85de17 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: NAFTA_examples: web_only/NAFTA_examples.html benchmarks: web_only/benchmarks.html compiled_models: web_only/compiled_models.html -last_built: 2020-05-12T09:06Z +last_built: 2020-05-12T14:32Z 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 b91d40e3..3f474d56 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -73,7 +73,7 @@ same dataset." /> mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/reference/CAKE_export.html b/docs/reference/CAKE_export.html index a4161abc..4e456651 100644 --- a/docs/reference/CAKE_export.html +++ b/docs/reference/CAKE_export.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ specified as well." /> - +
@@ -114,7 +117,12 @@ specified as well." />
@@ -129,7 +137,7 @@ specified as well." />
@@ -221,15 +229,10 @@ compatible with CAKE.

The function is called for its side effect.

- @@ -240,7 +243,7 @@ compatible with CAKE.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/DFOP.solution.html b/docs/reference/DFOP.solution.html index e0094738..3c1fff89 100644 --- a/docs/reference/DFOP.solution.html +++ b/docs/reference/DFOP.solution.html @@ -73,7 +73,7 @@ two exponential decline functions." /> mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index 7273b5de..b7e8427e 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -128,7 +136,7 @@
@@ -176,16 +184,16 @@ either a list of mkinfit objects or a single mkinfit object.

cores = 1, quiet = TRUE) fits["FOMC", ]
#> dataset #> model B C -#> FOMC List,41 List,41 +#> FOMC List,39 List,39 #> attr(,"class") #> [1] "mmkin"
fits[, "B"]
#> dataset #> model B -#> SFO List,41 -#> FOMC List,41 +#> SFO List,39 +#> FOMC List,39 #> attr(,"class") #> [1] "mmkin"
fits["SFO", "B"]
#> dataset #> model B -#> SFO List,41 +#> SFO List,39 #> attr(,"class") #> [1] "mmkin"
head( @@ -206,23 +214,17 @@ either a list of mkinfit objects or a single mkinfit object.

#> #> $evaluations #> function gradient -#> 25 72 +#> 25 78 #> #> $message #> [1] "both X-convergence and relative convergence (5)" #>
- @@ -233,7 +235,7 @@ either a list of mkinfit objects or a single mkinfit object.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html index 83d624bb..b2292604 100644 --- a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html +++ b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit." /> - @@ -59,7 +62,7 @@ in this fit." /> - +
@@ -117,7 +120,12 @@ in this fit." />
@@ -149,7 +157,7 @@ in this fit.

Format

-

A data frame containing the following variables.

+

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

@@ -172,14 +180,10 @@ in this fit.

Examples

data(FOCUS_2006_DFOP_ref_A_to_B)
- @@ -190,7 +194,7 @@ in this fit.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html index 75a0da96..71cfb721 100644 --- a/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit." /> - @@ -59,7 +62,7 @@ in this fit." /> - +
@@ -117,7 +120,12 @@ in this fit." />
@@ -149,7 +157,7 @@ in this fit.

Format

-

A data frame containing the following variables.

+

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

@@ -171,14 +179,10 @@ in this fit.

Examples

data(FOCUS_2006_FOMC_ref_A_to_F)
- @@ -189,7 +193,7 @@ in this fit.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOCUS_2006_HS_ref_A_to_F.html b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html index d9d24bdf..21d778a8 100644 --- a/docs/reference/FOCUS_2006_HS_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit." /> - @@ -59,7 +62,7 @@ in this fit." /> - +
@@ -117,7 +120,12 @@ in this fit." />
@@ -149,7 +157,7 @@ in this fit.

Format

-

A data frame containing the following variables.

+

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

@@ -172,14 +180,10 @@ in this fit.

Examples

data(FOCUS_2006_HS_ref_A_to_F)
- @@ -190,7 +194,7 @@ in this fit.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html index 8c0f5bc9..8d5a0c59 100644 --- a/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit." /> - @@ -59,7 +62,7 @@ in this fit." /> - +
@@ -117,7 +120,12 @@ in this fit." />
@@ -149,7 +157,7 @@ in this fit.

Format

-

A data frame containing the following variables.

+

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

@@ -170,14 +178,10 @@ in this fit.

Examples

data(FOCUS_2006_SFO_ref_A_to_F)
- @@ -188,7 +192,7 @@ in this fit.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOCUS_2006_datasets.html b/docs/reference/FOCUS_2006_datasets.html index 8ccf363e..51ea1ded 100644 --- a/docs/reference/FOCUS_2006_datasets.html +++ b/docs/reference/FOCUS_2006_datasets.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -146,7 +154,7 @@

Format

-

6 datasets with observations on the following variables.

+

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

@@ -173,14 +181,10 @@ #> 8 parent 91 3.9 #> 9 parent 119 0.6 - @@ -191,7 +195,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/FOMC.solution.html b/docs/reference/FOMC.solution.html index f8fbd2ba..a7236844 100644 --- a/docs/reference/FOMC.solution.html +++ b/docs/reference/FOMC.solution.html @@ -73,7 +73,7 @@ a decreasing rate constant." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/HS.solution.html b/docs/reference/HS.solution.html index 9404893c..2c4eebe3 100644 --- a/docs/reference/HS.solution.html +++ b/docs/reference/HS.solution.html @@ -73,7 +73,7 @@ between them." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/IORE.solution.html b/docs/reference/IORE.solution.html index 194d11aa..9c8df9b3 100644 --- a/docs/reference/IORE.solution.html +++ b/docs/reference/IORE.solution.html @@ -73,7 +73,7 @@ a concentration dependent rate constant." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/NAFTA_SOP_2015.html b/docs/reference/NAFTA_SOP_2015.html index 5ad02bf9..97674400 100644 --- a/docs/reference/NAFTA_SOP_2015.html +++ b/docs/reference/NAFTA_SOP_2015.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -142,7 +150,7 @@

Format

-

2 datasets with observations on the following variables.

+

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

@@ -198,16 +206,12 @@ #> DFOP 429 2380 841 #> #> Representative half-life: -#> [1] 841.41
plot(nafta_evaluation)
+#> [1] 841.41
plot(nafta_evaluation)
- @@ -218,7 +222,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/NAFTA_SOP_Attachment.html b/docs/reference/NAFTA_SOP_Attachment.html index 110ccc86..99b9f8c3 100644 --- a/docs/reference/NAFTA_SOP_Attachment.html +++ b/docs/reference/NAFTA_SOP_Attachment.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -180,7 +188,7 @@ #> 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.86e-12 5.00e-01 0.0000 Inf +#> k2 2.17e-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 #> @@ -189,19 +197,15 @@ #> 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 4.42e+11 2.42e+11 +#> DFOP 55.5 5.83e+11 3.20e+11 #> #> Representative half-life: -#> [1] 321.51
plot(nafta_att_p5a)
+#> [1] 321.51
plot(nafta_att_p5a)
- @@ -212,7 +216,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/SFO.solution.html b/docs/reference/SFO.solution.html index b263f2f3..05332377 100644 --- a/docs/reference/SFO.solution.html +++ b/docs/reference/SFO.solution.html @@ -72,7 +72,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/SFORB.solution.html b/docs/reference/SFORB.solution.html index 4ef85274..e4c84edd 100644 --- a/docs/reference/SFORB.solution.html +++ b/docs/reference/SFORB.solution.html @@ -76,7 +76,7 @@ and no substance in the bound fraction." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/aw.html b/docs/reference/aw.html index 0b37847c..78f17958 100644 --- a/docs/reference/aw.html +++ b/docs/reference/aw.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ by Burnham and Anderson (2004)." /> - +
@@ -115,7 +118,12 @@ by Burnham and Anderson (2004)." />
@@ -130,7 +138,7 @@ by Burnham and Anderson (2004)." />
@@ -181,14 +189,10 @@ Inference: Understanding AIC and BIC in Model Selection. aw(f)
#> [1] 0.4808722 0.1945539 0.3245740
sum(aw(f))
#> [1] 1
aw(f[c("SFO", "DFOP")])
#> [1] 0.5970258 0.4029742
# }
- @@ -199,7 +203,7 @@ Inference: Understanding AIC and BIC in Model Selection.
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index 7658a572..190494bc 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -79,7 +79,7 @@ method of Venzon and Moolgavkar (1988)." /> mkin - 0.9.50.1 + 0.9.50.2 @@ -271,12 +271,12 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, 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 verstrichen -#> 3.362 0.000 3.364
# Using more cores does not save much time here, as parent_0 takes up most of the time +#> 3.410 0.000 3.412
# 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 from about 50 # seconds to about 12 seconds if we use at least four 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
#> Warning: scheduled cores 1, 2, 3 encountered errors in user code, all values of the jobs will be affected
#> Error in dimnames(x) <- dn: Länge von 'dimnames' [2] ungleich der Arrayausdehnung
#> Timing stopped at: 0.011 0.045 0.201
ci_profile
#> 2.5% 97.5% + c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores))
#> Profiling the likelihood
#> Warning: scheduled cores 1, 2, 3 encountered errors in user code, all values of the jobs will be affected
#> Error in dimnames(x) <- dn: Länge von 'dimnames' [2] ungleich der Arrayausdehnung
#> Timing stopped at: 0.008 0.044 0.201
ci_profile
#> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 #> k_m1 0.003892605 6.702778e-03 diff --git a/docs/reference/create_deg_func.html b/docs/reference/create_deg_func.html index 6d05e811..1a6da920 100644 --- a/docs/reference/create_deg_func.html +++ b/docs/reference/create_deg_func.html @@ -72,7 +72,7 @@ mkin - 0.9.50 + 0.9.50.2
@@ -176,8 +176,8 @@ analytical = mkinfit(SFO_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE), deSolve = mkinfit(SFO_SFO, FOCUS_D, solution_type = "deSolve", quiet = TRUE), replications = 2)
#> Lade nötiges Paket: rbenchmark
#> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.395 1.000 0.393 0.002 0 -#> 2 deSolve 2 0.693 1.754 0.692 0.000 0 +#> 1 analytical 2 0.410 1.000 0.410 0.000 0 +#> 2 deSolve 2 0.704 1.717 0.703 0.001 0 #> sys.child #> 1 0 #> 2 0
DFOP_SFO <- mkinmod( @@ -186,8 +186,8 @@ analytical = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE), 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.870 1.000 0.870 0 0 -#> 2 deSolve 2 1.678 1.929 1.677 0 0 +#> 1 analytical 2 0.894 1.000 0.894 0.000 0 +#> 2 deSolve 2 1.717 1.921 1.716 0.001 0 #> sys.child #> 1 0 #> 2 0
# } diff --git a/docs/reference/experimental_data_for_UBA-1.png b/docs/reference/experimental_data_for_UBA-1.png index d3880fea..6c225daa 100644 Binary files a/docs/reference/experimental_data_for_UBA-1.png and b/docs/reference/experimental_data_for_UBA-1.png differ diff --git a/docs/reference/experimental_data_for_UBA.html b/docs/reference/experimental_data_for_UBA.html index 18e11261..b9670390 100644 --- a/docs/reference/experimental_data_for_UBA.html +++ b/docs/reference/experimental_data_for_UBA.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -65,7 +69,6 @@ Dataset 11 is from the Renewal Assessment Report (RAR) for 2,4-D to one half of the LOD reported to be 1% AR. Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl (United Kingdom, 2014, p. 81)." /> - @@ -83,7 +86,7 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl - +
@@ -141,7 +144,12 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl
@@ -198,7 +206,7 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl

Format

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

+ 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

@@ -257,17 +265,13 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl 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")
+plot(f_1_2_tc, resplot = "errmod")
# }
- @@ -278,7 +282,7 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/get_deg_func.html b/docs/reference/get_deg_func.html index 598a25c0..812b25d7 100644 --- a/docs/reference/get_deg_func.html +++ b/docs/reference/get_deg_func.html @@ -72,7 +72,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/ilr.html b/docs/reference/ilr.html index 8410e499..30be0a73 100644 --- a/docs/reference/ilr.html +++ b/docs/reference/ilr.html @@ -73,7 +73,7 @@ transformations." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/loftest-3.png b/docs/reference/loftest-3.png index ecc4c3ee..39fca72d 100644 Binary files a/docs/reference/loftest-3.png and b/docs/reference/loftest-3.png differ diff --git a/docs/reference/loftest-4.png b/docs/reference/loftest-4.png index da86d97f..e2b8ac5c 100644 Binary files a/docs/reference/loftest-4.png and b/docs/reference/loftest-4.png differ diff --git a/docs/reference/loftest-5.png b/docs/reference/loftest-5.png index 54b176e7..a4d9fd48 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 7d4df9f5..bc9ec146 100644 --- a/docs/reference/loftest.html +++ b/docs/reference/loftest.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -40,7 +44,6 @@ 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." /> - @@ -58,7 +61,7 @@ lrtest.default from the lmtest package." /> - +
@@ -116,7 +119,12 @@ lrtest.default from the lmtest package." />
@@ -131,7 +139,7 @@ lrtest.default from the lmtest package." />
@@ -309,15 +317,10 @@ of replicate samples.

#>
# }
- @@ -328,7 +331,7 @@ of replicate samples.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/logLik.mkinfit.html b/docs/reference/logLik.mkinfit.html index 8e33c28f..22561d8a 100644 --- a/docs/reference/logLik.mkinfit.html +++ b/docs/reference/logLik.mkinfit.html @@ -76,7 +76,7 @@ the error model." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/lrtest.mkinfit.html b/docs/reference/lrtest.mkinfit.html index 6861b747..433b0a8b 100644 --- a/docs/reference/lrtest.mkinfit.html +++ b/docs/reference/lrtest.mkinfit.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -41,7 +45,6 @@ mkinfit objects are given as arguments, it is checked if they have been fitted to the same data. It is the responsibility of the user to make sure 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." /> - @@ -59,7 +62,7 @@ and can be expressed by fixing the parameters of the other." /> - +
@@ -117,7 +120,12 @@ and can be expressed by fixing the parameters of the other." />
@@ -132,7 +140,7 @@ and can be expressed by fixing the parameters of the other." />
@@ -225,14 +233,10 @@ lower number of fitted parameters (null hypothesis).

#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# }
- @@ -243,7 +247,7 @@ lower number of fitted parameters (null hypothesis).

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/max_twa_parent.html b/docs/reference/max_twa_parent.html index b8ce5397..ada54cba 100644 --- a/docs/reference/max_twa_parent.html +++ b/docs/reference/max_twa_parent.html @@ -78,7 +78,7 @@ soil section of the FOCUS guidance." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/mkin_long_to_wide.html b/docs/reference/mkin_long_to_wide.html index bb7c263a..7f3e7949 100644 --- a/docs/reference/mkin_long_to_wide.html +++ b/docs/reference/mkin_long_to_wide.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ variable and several dependent variables as columns." /> - +
@@ -115,7 +118,12 @@ variable and several dependent variables as columns." />
@@ -130,7 +138,7 @@ variable and several dependent variables as columns." />
@@ -193,16 +201,10 @@ observed values called "value".

#> 22 120 NA 33.31
- @@ -213,7 +215,7 @@ observed values called "value".

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mkin_wide_to_long.html b/docs/reference/mkin_wide_to_long.html index 523d45e1..a232688c 100644 --- a/docs/reference/mkin_wide_to_long.html +++ b/docs/reference/mkin_wide_to_long.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ mkinfit." /> - +
@@ -115,7 +118,12 @@ mkinfit." />
@@ -130,7 +138,7 @@ mkinfit." />
@@ -173,16 +181,10 @@ column of observed values.

#> 6 y 3 5
- @@ -193,7 +195,7 @@ column of observed values.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mkinds.html b/docs/reference/mkinds.html index 778c5132..2e52a95d 100644 --- a/docs/reference/mkinds.html +++ b/docs/reference/mkinds.html @@ -75,7 +75,7 @@ provided by this package come as mkinds objects nevertheless." /> mkin - 0.9.49.11 + 0.9.50.2 diff --git a/docs/reference/mkinerrmin.html b/docs/reference/mkinerrmin.html index 1a31bc60..10daee93 100644 --- a/docs/reference/mkinerrmin.html +++ b/docs/reference/mkinerrmin.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> - +
@@ -114,7 +117,12 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." />
@@ -129,7 +137,7 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." />
@@ -193,16 +201,10 @@ Document Reference Sanco/10058/2005 version 2.0, 434 pp,
- @@ -213,7 +215,7 @@ Document Reference Sanco/10058/2005 version 2.0, 434 pp,
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mkinerrplot.html b/docs/reference/mkinerrplot.html index 7e5a00f2..c2be5abf 100644 --- a/docs/reference/mkinerrplot.html +++ b/docs/reference/mkinerrplot.html @@ -76,7 +76,7 @@ using the argument show_errplot = TRUE." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 5d8dd81c..54ca377f 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -422,8 +422,8 @@ Degradation Data. Environments 6(12) 124 fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) summary(fit)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 10:55:39 2020 -#> Date of summary: Tue May 12 10:55:39 2020 +#> Date of fit: Tue May 12 15:29:48 2020 +#> Date of summary: Tue May 12 15:29:48 2020 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent @@ -507,7 +507,7 @@ Degradation Data. Environments 6(12) 124 m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> User System verstrichen -#> 0.408 0.001 0.410
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.417 0.000 0.417
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma #> 99.598483222 0.098697734 0.005260651 0.514475962 3.125503875
#> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -597,7 +597,7 @@ Degradation Data. Environments 6(12) 124 #> Sum of squared residuals at call 166: 371.2134 #> Sum of squared residuals at call 168: 371.2134 #> Negative log-likelihood at call 178: 97.22429
#> Optimisation successfully terminated.
#> User System verstrichen -#> 0.353 0.000 0.352
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.363 0.001 0.364
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma #> 99.598480759 0.098697739 0.005260651 0.514475958 3.125503874
endpoints(fit.deSolve)
#> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -631,8 +631,8 @@ Degradation Data. Environments 6(12) 124 SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.noweight)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 10:55:44 2020 -#> Date of summary: Tue May 12 10:55:44 2020 +#> Date of fit: Tue May 12 15:29:53 2020 +#> Date of summary: Tue May 12 15:29:53 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -640,7 +640,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 421 model solutions performed in 0.147 s +#> Fitted using 421 model solutions performed in 0.13 s #> #> Error model: Constant variance #> @@ -753,8 +753,8 @@ Degradation Data. Environments 6(12) 124 #> 120 m1 25.15 28.78984 -3.640e+00 #> 120 m1 33.31 28.78984 4.520e+00
f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.obs)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 10:55:44 2020 -#> Date of summary: Tue May 12 10:55:44 2020 +#> Date of fit: Tue May 12 15:29:53 2020 +#> Date of summary: Tue May 12 15:29:53 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -762,7 +762,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 978 model solutions performed in 0.334 s +#> Fitted using 978 model solutions performed in 0.337 s #> #> Error model: Variance unique to each observed variable #> @@ -890,8 +890,8 @@ Degradation Data. Environments 6(12) 124 #> 120 m1 25.15 28.80429 -3.654e+00 #> 120 m1 33.31 28.80429 4.506e+00
f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.tc)
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 10:55:45 2020 -#> Date of summary: Tue May 12 10:55:45 2020 +#> Date of fit: Tue May 12 15:29:54 2020 +#> Date of summary: Tue May 12 15:29:54 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -899,7 +899,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 1875 model solutions performed in 0.643 s +#> Fitted using 1875 model solutions performed in 0.645 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 1c97048e..79b21d33 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -75,7 +75,7 @@ list of lists can be given in the speclist argument." /> mkin - 0.9.50.1 + 0.9.50.2
@@ -255,7 +255,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file15d32c282a7d.c 2> file15d32c282a7d.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file61b4ce789c7.c 2> file61b4ce789c7.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinparplot.html b/docs/reference/mkinparplot.html index dfe695d0..4ff4970e 100644 --- a/docs/reference/mkinparplot.html +++ b/docs/reference/mkinparplot.html @@ -73,7 +73,7 @@ mkinfit." /> mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/reference/mkinplot.html b/docs/reference/mkinplot.html index d078e239..166e6b1a 100644 --- a/docs/reference/mkinplot.html +++ b/docs/reference/mkinplot.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ plot.mkinfit." /> - +
@@ -114,7 +117,12 @@ plot.mkinfit." />
@@ -129,7 +137,7 @@ plot.mkinfit." />
@@ -158,15 +166,10 @@ plot.mkinfit." />

The function is called for its side effect.

- @@ -177,7 +180,7 @@ plot.mkinfit." />
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 3035e03e..89f48a09 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -396,11 +396,11 @@ solver is used.

c(k_parent = 0.15, f_parent_to_m1 = 0.5, k_m1 = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "analytical", use_compiled = FALSE)[201,]) -}
#> Lade nötiges Paket: rbenchmark
#> test relative elapsed +}
#> test relative elapsed +#> 2 deSolve_compiled 1.0 0.005 #> 4 analytical 1.0 0.005 -#> 2 deSolve_compiled 1.2 0.006 #> 1 eigen 4.0 0.020 -#> 3 deSolve 43.8 0.219
+#> 3 deSolve 43.6 0.218
# \dontrun{ # Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C, quiet = TRUE) diff --git a/docs/reference/mkinresplot.html b/docs/reference/mkinresplot.html index cd6bf4a1..82afe2e2 100644 --- a/docs/reference/mkinresplot.html +++ b/docs/reference/mkinresplot.html @@ -75,7 +75,7 @@ argument show_residuals = TRUE." /> mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/reference/mkinsub.html b/docs/reference/mkinsub.html index b3be7c2c..ac1220e0 100644 --- a/docs/reference/mkinsub.html +++ b/docs/reference/mkinsub.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ mkinmod." /> - +
@@ -114,7 +117,12 @@ mkinmod." />
@@ -129,7 +137,7 @@ mkinmod." />
@@ -188,16 +196,10 @@ results on other operating systems or system configurations.

m1 = mkinsub("SFO", full_name = "Metabolite M1"))
#> Successfully compiled differential equation model from auto-generated C code.
# }
- @@ -208,7 +210,7 @@ results on other operating systems or system configurations.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index db359f48..3be3b4b9 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -75,7 +75,7 @@ datasets specified in its first two arguments." /> mkin - 0.9.50.1 + 0.9.50.2 @@ -216,8 +216,8 @@ plotting.

time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE))
#> Warning: Optimisation did not converge: #> false convergence (8)
time_default
#> User System verstrichen -#> 4.370 0.401 1.265
time_1
#> User System verstrichen -#> 5.000 0.008 5.011
+#> 4.520 0.374 1.284
time_1
#> User System verstrichen +#> 5.076 0.004 5.083
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340478 0.2659522 0.7505691 0.2494309 diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html index 02c44737..34cce546 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -76,7 +76,7 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP." /> mkin - 0.9.50.1 + 0.9.50.2
diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index 78489ee7..8ef7e7c9 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -75,7 +75,7 @@ datasets." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/nlme.mmkin.html b/docs/reference/nlme.mmkin.html index 4e5a86cb..928ee378 100644 --- a/docs/reference/nlme.mmkin.html +++ b/docs/reference/nlme.mmkin.html @@ -74,7 +74,7 @@ have been obtained by fitting the same model to a list of datasets." /> mkin - 0.9.50.1 + 0.9.50.2 @@ -181,7 +181,7 @@ have been obtained by fitting the same model to a list of datasets.

data -

Should the data be printed?

+

Ignored, data are taken from the mmkin model

fixed diff --git a/docs/reference/nobs.mkinfit.html b/docs/reference/nobs.mkinfit.html index 1bd97732..55eb6a3f 100644 --- a/docs/reference/nobs.mkinfit.html +++ b/docs/reference/nobs.mkinfit.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -128,7 +136,7 @@
@@ -157,13 +165,10 @@

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

- @@ -174,7 +179,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/parms.html b/docs/reference/parms.html index 2162fdc0..f62b3898 100644 --- a/docs/reference/parms.html +++ b/docs/reference/parms.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ considering the error structure that was assumed for the fit." /> - +
@@ -115,7 +118,12 @@ considering the error structure that was assumed for the fit." />
@@ -130,7 +138,7 @@ considering the error structure that was assumed for the fit." />
@@ -184,14 +192,10 @@ as used internally during the optimisation?

#> 82.4921598 0.3060633 4.6730124
parms(fit, transformed = TRUE)
#> parent_0 log_k_parent_sink sigma #> 82.492160 -1.183963 4.673012
- @@ -202,7 +206,7 @@ as used internally during the optimisation?

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index 284c30a6..f78ccf73 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -74,7 +74,7 @@ observed data together with the solution of the fitted model." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index 4b893032..6c9f2449 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -76,7 +76,7 @@ the fit of at least one model to the same dataset is shown." /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index 294a79a4..17a80aa2 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ function (SFO, then IORE, then DFOP)." /> - +
@@ -114,7 +117,12 @@ function (SFO, then IORE, then DFOP)." />
@@ -129,7 +137,7 @@ function (SFO, then IORE, then DFOP)." />
@@ -139,7 +147,7 @@ function (SFO, then IORE, then DFOP).

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

Arguments

@@ -170,16 +178,10 @@ function (SFO, then IORE, then DFOP).

Calls plot.mmkin.

- @@ -190,7 +192,7 @@ function (SFO, then IORE, then DFOP).

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/plot.nlme.mmkin.html b/docs/reference/plot.nlme.mmkin.html index 9c85fbf0..17ec06cf 100644 --- a/docs/reference/plot.nlme.mmkin.html +++ b/docs/reference/plot.nlme.mmkin.html @@ -72,7 +72,7 @@ mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/print.mkinds.html b/docs/reference/print.mkinds.html index 824d961b..af85c78f 100644 --- a/docs/reference/print.mkinds.html +++ b/docs/reference/print.mkinds.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -128,7 +136,7 @@
@@ -154,12 +162,10 @@
- @@ -170,7 +176,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/print.mkinmod.html b/docs/reference/print.mkinmod.html index 03e73e29..6622decf 100644 --- a/docs/reference/print.mkinmod.html +++ b/docs/reference/print.mkinmod.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ components." /> - +
@@ -114,7 +117,12 @@ components." />
@@ -129,7 +137,7 @@ components." />
@@ -177,13 +185,10 @@ components.

#> d_M2/dt = + f_M1_to_M2 * k_M1 * M1 - k_M2 * M2
- @@ -194,7 +199,7 @@ components.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 90cbec1a..8a886c63 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -42,7 +46,6 @@ below to see their documentation. lmtestlrtest " /> - @@ -60,7 +63,7 @@ below to see their documentation. - +
@@ -118,7 +121,12 @@ below to see their documentation.
@@ -133,14 +141,14 @@ below to see their documentation.

These objects are imported from other packages. Follow the links below to see their documentation.

-
+
lmtest

lrtest

@@ -150,11 +158,10 @@ below to see their documentation.

- @@ -165,7 +172,7 @@ below to see their documentation.

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/residuals.mkinfit.html b/docs/reference/residuals.mkinfit.html index 96b02908..0933cd7b 100644 --- a/docs/reference/residuals.mkinfit.html +++ b/docs/reference/residuals.mkinfit.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
@@ -113,7 +116,12 @@
@@ -128,7 +136,7 @@
@@ -164,13 +172,10 @@ standard deviation obtained from the fitted error model?

#> [7] -0.03269102 1.45347805 -0.88423710
residuals(f, standardized = TRUE)
#> [1] 0.13969820 -0.19981894 -0.22048777 1.05407086 -0.12434027 -1.33869248 #> [7] -0.04695387 2.08761953 -1.27002305
- @@ -181,7 +186,7 @@ standard deviation obtained from the fitted error model?

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/schaefer07_complex_case-1.png b/docs/reference/schaefer07_complex_case-1.png index 34356613..40a1ed45 100644 Binary files a/docs/reference/schaefer07_complex_case-1.png and b/docs/reference/schaefer07_complex_case-1.png differ diff --git a/docs/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html index 27b19430..dcecc9b5 100644 --- a/docs/reference/schaefer07_complex_case.html +++ b/docs/reference/schaefer07_complex_case.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -39,7 +43,6 @@ - @@ -57,7 +60,7 @@ - +
@@ -115,7 +118,12 @@
@@ -145,7 +153,7 @@

Format

-

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

+

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

@@ -170,20 +178,17 @@ C1 = list(type = "SFO"), A2 = list(type = "SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
# \dontrun{ fit <- mkinfit(model, data, quiet = TRUE) - plot(fit)
endpoints(fit)
#> $ff + plot(fit)
endpoints(fit)
#> $ff #> parent_A1 parent_B1 parent_C1 parent_sink A1_A2 A1_sink -#> 0.3809619 0.1954667 0.4235714 0.0000000 0.4479620 0.5520380 -#> -#> $SFORB -#> logical(0) +#> 0.3809618 0.1954667 0.4235715 0.0000000 0.4479625 0.5520375 #> #> $distimes #> DT50 DT90 #> parent 13.95078 46.34350 -#> A1 49.75344 165.27737 -#> B1 37.26907 123.80517 -#> C1 11.23131 37.30960 -#> A2 28.50627 94.69577 +#> A1 49.75346 165.27741 +#> B1 37.26904 123.80508 +#> C1 11.23130 37.30958 +#> A2 28.50628 94.69580 #>
# } # Compare with the results obtained in the original publication print(schaefer07_complex_results)
#> compound parameter KinGUI ModelMaker deviation @@ -202,14 +207,10 @@ #> 13 metabolite A2 degradation rate 0.0245 0.0244 0.4 #> 14 metabolite A2 DT50 28.2400 28.4500 0.7
- @@ -220,7 +221,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/sigma_twocomp.html b/docs/reference/sigma_twocomp.html index 76e2eb8f..1e1f5798 100644 --- a/docs/reference/sigma_twocomp.html +++ b/docs/reference/sigma_twocomp.html @@ -73,7 +73,7 @@ dependence of the measured value \(y\):" /> mkin - 0.9.50.1 + 0.9.50.2 diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 84e65787..55ce22cf 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -76,7 +76,7 @@ values." /> mkin - 0.9.50.1 + 0.9.50.2 @@ -229,17 +229,17 @@ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,

Examples

- summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.50.1 + summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 08:07:03 2020 -#> Date of summary: Tue May 12 08:07:03 2020 +#> Date of fit: Tue May 12 15:31:20 2020 +#> Date of summary: Tue May 12 15:31:20 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.026 s +#> Fitted using 131 model solutions performed in 0.027 s #> #> Error model: Constant variance #> diff --git a/docs/reference/synthetic_data_for_UBA_2014-1.png b/docs/reference/synthetic_data_for_UBA_2014-1.png index 201ef0fd..02976ced 100644 Binary files a/docs/reference/synthetic_data_for_UBA_2014-1.png and b/docs/reference/synthetic_data_for_UBA_2014-1.png differ diff --git a/docs/reference/synthetic_data_for_UBA_2014.html b/docs/reference/synthetic_data_for_UBA_2014.html index 6ac7403a..17d2f973 100644 --- a/docs/reference/synthetic_data_for_UBA_2014.html +++ b/docs/reference/synthetic_data_for_UBA_2014.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -52,7 +56,6 @@ Initial concentrations for metabolites and all values where adding the variance As an example, the first dataset has the title SFO_lin_a and is based on the SFO model with two sequential metabolites (linear pathway), with added variance component 'a'. Compare also the code in the example section to see the degradation models." /> - @@ -70,7 +73,7 @@ Compare also the code in the example section to see the degradation models." /> - +
@@ -128,7 +131,12 @@ Compare also the code in the example section to see the degradation models." />
@@ -172,7 +180,7 @@ Compare also the code in the example section to see the degradation models." />

Format

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

+ 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

@@ -280,10 +288,10 @@ Compare also the code in the example section to see the degradation models." /> # 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: 0.9.49.6 -#> R version used for fitting: 3.6.1 -#> Date of fit: Fri Nov 1 10:10:17 2019 -#> Date of summary: Fri Nov 1 10:10:17 2019 + plot_sep(fit)
summary(fit)
#> mkin version used for fitting: 0.9.50.2 +#> R version used for fitting: 4.0.0 +#> Date of fit: Tue May 12 15:31:29 2020 +#> Date of summary: Tue May 12 15:31:29 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -292,7 +300,7 @@ Compare also the code in the example section to see the degradation models." /> #> #> Model predictions using solution type deSolve #> -#> Fitted using 847 model solutions performed in 2.468 s +#> Fitted using 819 model solutions performed in 0.619 s #> #> Error model: Constant variance #> @@ -321,6 +329,11 @@ Compare also the code in the example section to see the degradation models." /> #> 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 @@ -339,15 +352,15 @@ Compare also the code in the example section to see the degradation models." /> #> log_k_M2 2.819e-02 7.166e-02 -3.929e-01 1.000e+00 -2.658e-01 #> f_parent_ilr_1 -4.624e-01 -5.682e-01 7.478e-01 -2.658e-01 1.000e+00 #> f_M1_ilr_1 1.614e-01 4.102e-01 -8.109e-01 5.419e-01 -8.605e-01 -#> sigma -3.704e-09 -1.104e-08 5.922e-08 -3.673e-08 5.867e-08 +#> sigma 1.285e-07 1.054e-07 -1.671e-07 3.644e-08 -2.503e-07 #> f_M1_ilr_1 sigma -#> parent_0 1.614e-01 -3.704e-09 -#> log_k_parent 4.102e-01 -1.104e-08 -#> log_k_M1 -8.109e-01 5.922e-08 -#> log_k_M2 5.419e-01 -3.673e-08 -#> f_parent_ilr_1 -8.605e-01 5.867e-08 -#> f_M1_ilr_1 1.000e+00 -8.075e-08 -#> sigma -8.075e-08 1.000e+00 +#> parent_0 1.614e-01 1.285e-07 +#> log_k_parent 4.102e-01 1.054e-07 +#> log_k_M1 -8.109e-01 -1.671e-07 +#> log_k_M2 5.419e-01 3.644e-08 +#> f_parent_ilr_1 -8.605e-01 -2.503e-07 +#> f_M1_ilr_1 1.000e+00 2.636e-07 +#> sigma 2.636e-07 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. @@ -384,8 +397,8 @@ Compare also the code in the example section to see the degradation models." /> #> #> Data: #> time variable observed predicted residual -#> 0 parent 101.5 1.021e+02 -0.56248 -#> 0 parent 101.2 1.021e+02 -0.86248 +#> 0 parent 101.5 1.021e+02 -0.56249 +#> 0 parent 101.2 1.021e+02 -0.86249 #> 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 @@ -394,8 +407,8 @@ Compare also the code in the example section to see the degradation models." /> #> 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 -1.875e-11 0.60000 -#> 120 parent 3.5 -2.805e-11 3.50000 +#> 90 parent 0.6 9.531e-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 @@ -405,9 +418,9 @@ Compare also the code in the example section to see the degradation models." /> #> 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 2.913e-10 3.20000 -#> 120 M1 1.5 3.625e-11 1.50000 -#> 120 M1 0.6 3.625e-11 0.60000 +#> 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 @@ -425,14 +438,10 @@ Compare also the code in the example section to see the degradation models." /> #> 120 M2 3.3 5.521e+00 -2.22107
# }
- @@ -443,7 +452,7 @@ Compare also the code in the example section to see the degradation models." />
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/test_data_from_UBA_2014-1.png b/docs/reference/test_data_from_UBA_2014-1.png index 51b38eda..431181cf 100644 Binary files a/docs/reference/test_data_from_UBA_2014-1.png and b/docs/reference/test_data_from_UBA_2014-1.png differ diff --git a/docs/reference/test_data_from_UBA_2014-2.png b/docs/reference/test_data_from_UBA_2014-2.png index a40f7553..4a064163 100644 Binary files a/docs/reference/test_data_from_UBA_2014-2.png and b/docs/reference/test_data_from_UBA_2014-2.png differ diff --git a/docs/reference/test_data_from_UBA_2014.html b/docs/reference/test_data_from_UBA_2014.html index 0040c331..237149a5 100644 --- a/docs/reference/test_data_from_UBA_2014.html +++ b/docs/reference/test_data_from_UBA_2014.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
@@ -114,7 +117,12 @@
@@ -144,7 +152,7 @@

Format

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

+ 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

@@ -165,23 +173,16 @@ # model). m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"), parent_s = mkinsub("SFO", "parent_w"))
#> Successfully compiled differential equation model from auto-generated C code.
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
#> Estimate se_notrans t value Pr(>t) -#> parent_w_0 9.598567e+01 2.12351789 4.520126e+01 9.476190e-18 -#> k_parent_w_sink 3.603743e-01 0.03149282 1.144306e+01 4.126593e-09 -#> k_parent_w_parent_s 6.031371e-02 0.01603582 3.761186e+00 9.436275e-04 -#> k_parent_s_sink 5.108964e-11 0.09482736 5.387647e-10 5.000000e-01 -#> k_parent_s_parent_w 7.419672e-02 0.10737376 6.910135e-01 2.500560e-01 -#> sigma 2.982879e+00 0.50545649 5.901356e+00 1.454535e-05 -#> Lower Upper -#> parent_w_0 91.48420503 100.4871438 -#> k_parent_w_sink 0.30668904 0.4234571 -#> k_parent_w_parent_s 0.03423904 0.1062455 -#> k_parent_s_sink 0.00000000 Inf -#> k_parent_s_parent_w 0.02289956 0.2404043 -#> sigma 2.00184022 3.9639169
mkinerrmin(f_river)
#> err.min n.optim df -#> All data 0.09246946 5 6 -#> parent_w 0.06377096 3 3 -#> parent_s 0.20882325 2 3
+ 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.91998116 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")), @@ -190,42 +191,38 @@ M3 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
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.55425584 0.859186619 89.1008474 1.113866e-26 74.755959756 -#> k_parent 0.12081956 0.004601922 26.2541544 1.077373e-16 0.111561582 -#> k_M1 0.84258649 0.806231419 1.0450926 1.545475e-01 0.113839803 -#> k_M2 0.04210878 0.017083049 2.4649453 1.170195e-02 0.018013807 -#> k_M3 0.01122919 0.007245890 1.5497322 6.885127e-02 0.002909463 -#> f_parent_to_M1 0.32240199 0.240803555 1.3388589 9.820820e-02 NA -#> f_parent_to_M2 0.16099854 0.033691991 4.7785403 6.531224e-05 NA -#> f_M1_to_M3 0.27921501 0.269443514 1.0362655 1.565440e-01 0.022992937 -#> f_M2_to_M3 0.55641331 0.595125445 0.9349513 1.807725e-01 0.008003317 +#> parent_0 76.55425585 0.859186419 89.1008682 1.113862e-26 74.755958727 +#> k_parent 0.12081956 0.004601919 26.2541704 1.077361e-16 0.111561576 +#> k_M1 0.84258631 0.806165101 1.0451783 1.545282e-01 0.113778787 +#> k_M2 0.04210878 0.017083048 2.4649453 1.170195e-02 0.018013823 +#> k_M3 0.01122919 0.007245869 1.5497365 6.885076e-02 0.002909418 +#> f_parent_to_M1 0.32240194 0.240785506 1.3389591 9.819219e-02 NA +#> f_parent_to_M2 0.16099854 0.033691990 4.7785405 6.531222e-05 NA +#> f_M1_to_M3 0.27921506 0.269425556 1.0363347 1.565282e-01 0.022977927 +#> f_M2_to_M3 0.55641328 0.595121733 0.9349571 1.807710e-01 0.008002321 #> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 #> Upper -#> parent_0 78.35255192 +#> parent_0 78.35255298 #> k_parent 0.13084582 -#> k_M1 6.23641265 -#> k_M2 0.09843279 -#> k_M3 0.04333950 +#> k_M1 6.23975442 +#> k_M2 0.09843270 +#> k_M3 0.04334016 #> f_parent_to_M1 NA #> f_parent_to_M2 NA -#> f_M1_to_M3 0.86443083 -#> f_M2_to_M3 0.99489847 +#> f_M1_to_M3 0.86450919 +#> f_M2_to_M3 0.99489910 #> sigma 1.45337221
mkinerrmin(f_soil)
#> err.min n.optim df #> All data 0.09649963 9 20 #> parent 0.04721283 2 6 -#> M1 0.26551209 2 5 +#> M1 0.26551208 2 5 #> M2 0.20327575 2 5 -#> M3 0.05196549 3 4
# } +#> M3 0.05196550 3 4
# }
- @@ -236,7 +233,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 185a8a64..61ed96d7 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -245,7 +245,7 @@ This is no problem for the internal use in mkinfit< #> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
# \dontrun{ # Compare to the version without transforming rate parameters -fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
#> Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", cost.current, "\n", sep = "")}: Fehlender Wert, wo TRUE/FALSE nötig ist
#> Timing stopped at: 0.002 0 0.003
fit.2.s <- summary(fit.2)
#> Error in summary(fit.2): Objekt 'fit.2' nicht gefunden
print(fit.2.s$par, 3)
#> Error in print(fit.2.s$par, 3): Objekt 'fit.2.s' nicht gefunden
print(fit.2.s$bpar, 3)
#> Error in print(fit.2.s$bpar, 3): Objekt 'fit.2.s' nicht gefunden
# } +fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
#> Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", cost.current, "\n", sep = "")}: Fehlender Wert, wo TRUE/FALSE nötig ist
#> Timing stopped at: 0.003 0 0.003
fit.2.s <- summary(fit.2)
#> Error in summary(fit.2): Objekt 'fit.2' nicht gefunden
print(fit.2.s$par, 3)
#> Error in print(fit.2.s$par, 3): Objekt 'fit.2.s' nicht gefunden
print(fit.2.s$bpar, 3)
#> Error in print(fit.2.s$bpar, 3): Objekt 'fit.2.s' nicht gefunden
# } initials <- fit$start$value names(initials) <- rownames(fit$start) diff --git a/docs/reference/update.mkinfit.html b/docs/reference/update.mkinfit.html index bb93a61e..f958fc14 100644 --- a/docs/reference/update.mkinfit.html +++ b/docs/reference/update.mkinfit.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -40,7 +44,6 @@ model parameters from the old fit are used as starting values for the updated fit. Values specified as 'parms.ini' and/or 'state.ini' will override these starting values." /> - @@ -58,7 +61,7 @@ override these starting values." /> - +
@@ -116,7 +119,12 @@ override these starting values." />
@@ -131,7 +139,7 @@ override these starting values." />
@@ -169,18 +177,15 @@ remove arguments given in the original call

# \dontrun{ fit <- mkinfit("SFO", subset(FOCUS_2006_D, value != 0), quiet = TRUE) parms(fit)
#> parent_0 k_parent_sink sigma -#> 99.44423886 0.09793574 3.39632469
fit_2 <- update(fit, error_model = "tc") +#> 99.44423885 0.09793574 3.39632469
fit_2 <- update(fit, error_model = "tc") parms(fit_2)
#> parent_0 k_parent_sink sigma_low rsd_high #> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02
plot_err(fit_2)
# }
- @@ -191,7 +196,7 @@ remove arguments given in the original call

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/man/nlme.mmkin.Rd b/man/nlme.mmkin.Rd index ae2b2d22..10c3ec78 100644 --- a/man/nlme.mmkin.Rd +++ b/man/nlme.mmkin.Rd @@ -30,7 +30,7 @@ \arguments{ \item{model}{An \code{\link{mmkin}} row object.} -\item{data}{Should the data be printed?} +\item{data}{Ignored, data are taken from the mmkin model} \item{fixed}{Ignored, all degradation parameters fitted in the mmkin model are used as fixed parameters} diff --git a/vignettes/mkin_benchmarks.rda b/vignettes/mkin_benchmarks.rda deleted file mode 100644 index dbd65850..00000000 Binary files a/vignettes/mkin_benchmarks.rda and /dev/null differ diff --git a/vignettes/web_only/benchmarks.Rmd b/vignettes/web_only/benchmarks.Rmd index cc28735a..27f5d366 100644 --- a/vignettes/web_only/benchmarks.Rmd +++ b/vignettes/web_only/benchmarks.Rmd @@ -1,5 +1,5 @@ --- -title: "Benchmark timings for mkin on various systems" +title: "Benchmark timings for mkin" author: "Johannes Ranke" output: html_document: @@ -19,10 +19,8 @@ opts_chunk$set(tidy = FALSE, cache = FALSE) library("mkin") ``` -## Systems - Each system is characterized by its CPU type, the operating system type and the -mkin version. +mkin version. Currently only values for one system are available. ```{r} cpu_model <- benchmarkme::get_cpu()$model_name @@ -30,23 +28,37 @@ operating_system <- Sys.info()[["sysname"]] mkin_version <- as.character(packageVersion("mkin")) system_string <- paste0(operating_system, ", ", cpu_model, ", mkin version ", mkin_version) load("~/git/mkin/vignettes/web_only/mkin_benchmarks.rda") -mkin_benchmarks[system_string, c("CPU", "OS", "mkin")] <- c(cpu_model, operating_system, mkin_version) +mkin_benchmarks[system_string, c("CPU", "OS", "mkin")] <- + c(cpu_model, operating_system, mkin_version) if (mkin_version > "0.9.48.1") { - mmkin_bench <- function(models, datasets, error_model = "const") mmkin(models, datasets, error_model = error_model, cores = 1, quiet = TRUE) + mmkin_bench <- function(models, datasets, error_model = "const") { + mmkin(models, datasets, error_model = error_model, cores = 1, quiet = TRUE) + } } else { - mmkin_bench <- function(models, datasets, error_model = NULL) mmkin(models, datasets, reweight.method = error_model, cores = 1, quiet = TRUE) + mmkin_bench <- function(models, datasets, error_model = NULL) { + mmkin(models, datasets, reweight.method = error_model, cores = 1, quiet = TRUE) + } } ``` -```{r timings} +## Test cases + +Parent only: + +```{r parent_only, warning = FALSE} FOCUS_C <- FOCUS_2006_C FOCUS_D <- subset(FOCUS_2006_D, value != 0) -# Parent only -t1 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_C, FOCUS_D)))[["elapsed"]] -t2 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_C, FOCUS_D), error_model = "tc"))[["elapsed"]] +parent_datasets <- list(FOCUS_C, FOCUS_D) -# One metabolite +t1 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), parent_datasets))[["elapsed"]] +t2 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), parent_datasets, + error_model = "tc"))[["elapsed"]] +``` + +One metabolite: + +```{r one_metabolite} SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO")) @@ -57,10 +69,15 @@ DFOP_SFO <- mkinmod( parent = mkinsub("FOMC", "m1"), m1 = mkinsub("SFO")) t3 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D)))[["elapsed"]] -t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), error_model = "tc"))[["elapsed"]] -t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), error_model = "obs"))[["elapsed"]] +t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), + error_model = "tc"))[["elapsed"]] +t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), + error_model = "obs"))[["elapsed"]] +``` -# Two metabolites, synthetic data +Two metabolites, synthetic data: + +```{r two_metabolites} m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"), M1 = mkinsub("SFO", "M2"), M2 = mkinsub("SFO"), @@ -78,15 +95,51 @@ DFOP_par_c <- synthetic_data_for_UBA_2014[[12]]$data t6 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a)))["elapsed"] t7 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c)))["elapsed"] -t8 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a), error_model = "tc"))["elapsed"] -t9 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c), error_model = "tc"))["elapsed"] +t8 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a), + error_model = "tc"))["elapsed"] +t9 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c), + error_model = "tc"))["elapsed"] + +t10 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a), + error_model = "obs"))["elapsed"] +t11 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c), + error_model = "obs"))["elapsed"] +``` + +```{r results} +mkin_benchmarks[system_string, paste0("t", 1:11)] <- + c(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) +save(mkin_benchmarks, file = "~/git/mkin/vignettes/web_only/mkin_benchmarks.rda") +``` + +## Results -t10 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a), error_model = "obs"))["elapsed"] -t11 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c), error_model = "obs"))["elapsed"] +Currently, we only have benchmark information on one system, therefore only the mkin +version is shown with the results below. Timings are in seconds, shorter is better. -mkin_benchmarks[system_string, paste0("t", 1:11)] <- c(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) -mkin_benchmarks[, -c(1:3)] +Benchmarks for all available error models are shown. +### Parent only -save(mkin_benchmarks, file = "~/git/mkin/vignettes/mkin_benchmarks.rda") +Constant variance and two-component error model: + +```{r} +print(mkin_benchmarks[, c("mkin", "t1", "t2")], row.names = FALSE) +``` + +### One metabolite + +Constant variance, variance by variable and two-component error model: + +```{r} +print(mkin_benchmarks[, c("mkin", "t3", "t4", "t5")], row.names = FALSE) +``` + +### Two metabolites + +Two different datasets, for each constant variance, variance by variable and +two-component error model are shown: + +```{r} +print(mkin_benchmarks[, c("mkin", paste0("t", 6:11))], row.names = FALSE) ``` diff --git a/vignettes/web_only/benchmarks.html b/vignettes/web_only/benchmarks.html index 337ccbb3..5c9cc67e 100644 --- a/vignettes/web_only/benchmarks.html +++ b/vignettes/web_only/benchmarks.html @@ -11,9 +11,9 @@ - + -Benchmark timings for mkin on various systems +Benchmark timings for mkin