From 95178837d3f91e84837628446b5fd468179af2b9 Mon Sep 17 00:00:00 2001
From: Johannes Ranke A comprehensive report of the results is obtained using the Since mkin version 0.9-32 (July 2014), we can use shorthand notation like 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. 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. 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. 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.4 on This vignette was built with mkin 0.9.49.5 on Direct minimization of the negative log-likelihood for non-constant error models (two-component and variance by variable). In the case the error model is constant variance, least squares is used as this is more stable The argument ‘reweight.method’ to mkinfit and mmkin is now obsolete, use ‘error_model’ instead Several algorithms for minimization of the negative log-likelihood for non-constant error models (two-component and variance by variable). In the case the error model is constant variance, least squares is used as this is more stable. The default algorithm tries direct minimization and a three step procedure, and returns the model with the highest likelihood. The argument ‘reweight.method’ to mkinfit and mmkin is now obsolete, use ‘error_model’ and ‘error_model_algorithm’ instead Add a test that checks if we get the best known AIC for parent only fits to 12 test datasets. Add these test datasets for this purpose. New function ‘mkinerrplot’. This function is also used for residual plots in ‘plot.mmkin’ if the argument ‘resplot = “errmod”’ is given, and in ‘plot.mkinfit’ if ‘show_errplot’ is set to TRUE. Remove dependency on FME, only use nlminb for optimisation Use the numDeriv package to calculate hessians The code for manual weighting was removed The fitting time reported in the summary now includes the calculation of the hessians Adapt tests Fix an error in the FOCUS chi2 error level calculations that occurred if parameters were specified in parms.ini that were not in the model. A warning was already issued, but when fitting via mmkin this could easily go unnoticed.Example evaluation of FOCUS Example Dataset D
Johannes Ranke
- 2019-05-08
+ 2019-06-04
FOCUS_D.Rmd
summary
method for mkinfit
objects.## mkin version used for fitting: 0.9.49.4
+
## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:27 2019
-## Date of summary: Wed May 8 20:52:27 2019
+## Date of fit: Tue Jun 4 15:03:18 2019
+## Date of summary: Tue Jun 4 15:03:18 2019
##
## Equations:
## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -177,7 +177,7 @@
##
## Model predictions using solution type deSolve
##
-## Fitted using 389 model solutions performed in 0.998 s
+## Fitted using 389 model solutions performed in 0.978 s
##
## Error model:
## Constant variance
@@ -305,7 +305,7 @@
diff --git a/docs/articles/FOCUS_D_files/figure-html/plot-1.png b/docs/articles/FOCUS_D_files/figure-html/plot-1.png
index 0cd6596d..fc1142ab 100644
Binary files a/docs/articles/FOCUS_D_files/figure-html/plot-1.png and b/docs/articles/FOCUS_D_files/figure-html/plot-1.png differ
diff --git a/docs/articles/FOCUS_D_files/figure-html/plot_2-1.png b/docs/articles/FOCUS_D_files/figure-html/plot_2-1.png
index 64da1d2e..97c61a16 100644
Binary files a/docs/articles/FOCUS_D_files/figure-html/plot_2-1.png and b/docs/articles/FOCUS_D_files/figure-html/plot_2-1.png differ
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 6771bf63..75b2cf10 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -30,7 +30,7 @@
@@ -88,7 +88,7 @@
Example evaluation of FOCUS Laboratory Data L1 to L3
Johannes Ranke
- 2019-05-08
+ 2019-06-04
FOCUS_L.Rmd
"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.## mkin version used for fitting: 0.9.49.4
+
## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:29 2019
-## Date of summary: Wed May 8 20:52:29 2019
+## Date of fit: Tue Jun 4 15:03:20 2019
+## Date of summary: Tue Jun 4 15:03:20 2019
##
## Equations:
## d_parent/dt = - k_parent_sink * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 133 model solutions performed in 0.276 s
+## Fitted using 133 model solutions performed in 0.28 s
##
## Error model:
## Constant variance
@@ -213,10 +213,10 @@
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-## Warning in cov2cor(ans$cov.unscaled): diag(.) had 0 or NA entries; non-
## finite result is doubtful
## mkin version used for fitting: 0.9.49.4
+
-## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:31 2019
-## Date of summary: Wed May 8 20:52:31 2019
+## Date of fit: Tue Jun 4 15:03:22 2019
+## Date of summary: Tue Jun 4 15:03:22 2019
##
##
## Warning: Optimisation did not converge:
@@ -317,17 +317,17 @@
main = "FOCUS L2 - FOMC")
## mkin version used for fitting: 0.9.49.4
+
-## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:32 2019
-## Date of summary: Wed May 8 20:52:32 2019
+## Date of fit: Tue Jun 4 15:03:23 2019
+## Date of summary: Tue Jun 4 15:03:23 2019
##
## 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.483 s
+## Fitted using 239 model solutions performed in 0.484 s
##
## Error model:
## Constant variance
@@ -392,10 +392,10 @@
main = "FOCUS L2 - DFOP")
## mkin version used for fitting: 0.9.49.4
+
## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:33 2019
-## Date of summary: Wed May 8 20:52:33 2019
+## Date of fit: Tue Jun 4 15:03:25 2019
+## Date of summary: Tue Jun 4 15:03:25 2019
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -404,7 +404,7 @@
##
## Model predictions using solution type analytical
##
-## Fitted using 572 model solutions performed in 1.185 s
+## Fitted using 572 model solutions performed in 1.193 s
##
## Error model:
## Constant variance
@@ -491,10 +491,10 @@
## mkin version used for fitting: 0.9.49.4
+
## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:35 2019
-## Date of summary: Wed May 8 20:52:35 2019
+## Date of fit: Tue Jun 4 15:03:26 2019
+## Date of summary: Tue Jun 4 15:03:27 2019
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -503,7 +503,7 @@
##
## Model predictions using solution type analytical
##
-## Fitted using 373 model solutions performed in 0.768 s
+## Fitted using 373 model solutions performed in 0.767 s
##
## Error model:
## Constant variance
@@ -596,17 +596,17 @@
## mkin version used for fitting: 0.9.49.4
+
-## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:36 2019
-## Date of summary: Wed May 8 20:52:37 2019
+## Date of fit: Tue Jun 4 15:03:27 2019
+## Date of summary: Tue Jun 4 15:03:28 2019
##
## Equations:
## d_parent/dt = - k_parent_sink * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 142 model solutions performed in 0.289 s
+## Fitted using 142 model solutions performed in 0.288 s
##
## Error model:
## Constant variance
@@ -660,17 +660,17 @@
## DT50 DT90
## parent 106 352
## mkin version used for fitting: 0.9.49.4
+
## mkin version used for fitting: 0.9.49.5
## R version used for fitting: 3.6.0
-## Date of fit: Wed May 8 20:52:36 2019
-## Date of summary: Wed May 8 20:52:37 2019
+## Date of fit: Tue Jun 4 15:03:28 2019
+## Date of summary: Tue Jun 4 15:03:28 2019
##
## 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.45 s
+## Fitted using 224 model solutions performed in 0.449 s
##
## Error model:
## Constant variance
@@ -769,7 +769,7 @@
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png
index cc28c092..32fef506 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png
index 46d85b73..f23a4c97 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png
index ac326b45..ed6a781d 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png differ
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 62b2ceb3..2e5071d9 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-4-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png
index 1a9c8457..04bee502 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png
index 93beb55f..86af1cf9 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-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 3dd8565c..16235059 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/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png
index 8d6531ea..0bfac9e2 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png
index a5e75b70..d194c676 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
index eb2d55ef..c2982f4b 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -60,7 +60,7 @@
@@ -145,7 +145,7 @@
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
index c274696c..09b1b8ea 100644
--- a/docs/articles/mkin.html
+++ b/docs/articles/mkin.html
@@ -30,7 +30,7 @@
@@ -88,7 +88,7 @@
Introduction to mkin
Johannes Ranke
- 2019-05-08
+ 2019-06-04
mkin.Rmd
Calculation of time weighted average concentrations with mkin
Johannes Ranke
- 2019-05-08
+ 2019-06-04
twa.Rmd
Example evaluation of FOCUS dataset Z
Johannes Ranke
- 2019-05-08
+ 2019-06-04
FOCUS_Z.Rmd
Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance
Johannes Ranke
- 2019-05-08
+ 2019-06-04
NAFTA_examples.Rmd
## Warning in summary.mkinfit(x): Could not calculate correlation; no
-## covariance matrix
-
-## 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
## Sums of squares:
## SFO IORE DFOP
## 1996.9408 444.9237 547.5616
@@ -327,11 +322,10 @@
##
## Parameters:
## $SFO
-## Estimate Pr(>t) Lower Upper
-## parent_0 88.16549 NA NA NA
-## k__iore_parent_sink 0.00100 NA NA NA
-## k_parent_sink 0.00803 NA NA NA
-## sigma 7.44786 NA NA NA
+## Estimate Pr(>t) Lower Upper
+## parent_0 88.16549 6.53e-29 83.37344 92.95754
+## k_parent_sink 0.00803 1.67e-13 0.00674 0.00957
+## sigma 7.44786 4.17e-10 5.66209 9.23363
##
## $IORE
## Estimate Pr(>t) Lower Upper
@@ -341,13 +335,12 @@
## sigma 3.52e+00 5.36e-10 2.67e+00 4.36e+00
##
## $DFOP
-## Estimate Pr(>t) Lower Upper
-## parent_0 95.70619 NA NA NA
-## k__iore_parent_sink 0.00100 NA NA NA
-## k1 0.02500 NA NA NA
-## k2 0.00273 NA NA NA
-## g 0.58835 NA NA NA
-## sigma 3.90001 NA NA NA
+## Estimate Pr(>t) Lower Upper
+## parent_0 95.70619 8.99e-32 91.87941 99.53298
+## k1 0.02500 5.25e-04 0.01422 0.04394
+## k2 0.00273 6.84e-03 0.00125 0.00597
+## g 0.58835 2.84e-06 0.36595 0.77970
+## sigma 3.90001 6.94e-10 2.96260 4.83741
##
##
## DTx values:
@@ -366,12 +359,12 @@
Example on page 9, upper panel
-
+
## 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
## Sums of squares:
## SFO IORE DFOP
## 839.35238 88.57064 9.93363
@@ -415,7 +408,7 @@
Example on page 9, lower panel
-
+
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(diag(covar_notrans)): NaNs wurden erzeugt
@@ -423,9 +416,9 @@
## finite result is doubtful
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
## 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
## Sums of squares:
## SFO IORE DFOP
## 35.64867 23.22334 35.64867
@@ -469,12 +462,12 @@
Example on page 10
-
+
## 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
## Sums of squares:
## SFO IORE DFOP
## 899.4089 336.4348 899.4089
@@ -522,12 +515,12 @@
Example on page 11
-
+
## 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
## Sums of squares:
## SFO IORE DFOP
## 579.6805 204.7932 144.7783
@@ -576,14 +569,14 @@
Example on page 12, upper panel
-
+
## 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
## Sums of squares:
## SFO IORE DFOP
## 695.4440 220.0685 695.4440
@@ -626,7 +619,7 @@
Example on page 12, lower panel
-
+
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in qt(alpha/2, rdf): NaNs wurden erzeugt
@@ -637,9 +630,9 @@
## finite result is doubtful
## Warning in qt(1 - alpha/2, rdf): NaNs wurden erzeugt
## 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
## Sums of squares:
## SFO IORE DFOP
## 58.90242 19.06353 58.90242
@@ -682,16 +675,16 @@
Example on page 13
-
+
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
## Warning in cov2cor(ans$cov.unscaled): 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
## Sums of squares:
## SFO IORE DFOP
## 174.5971 142.3951 174.5971
@@ -735,16 +728,16 @@
DT50 not observed in the study and DFOP problems in PestDF
-
+
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
## Warning in cov2cor(ans$cov.unscaled): 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
## Sums of squares:
## SFO IORE DFOP
## 48.43249 28.67746 27.26248
@@ -788,7 +781,7 @@
N is less than 1 and DFOP fraction parameter is below zero
-
+
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(diag(covar_notrans)): NaNs wurden erzeugt
@@ -796,9 +789,9 @@
## finite result is doubtful
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
## 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
-
+
## Sums of squares:
## SFO IORE DFOP
## 245.5248 135.0132 245.5248
@@ -837,16 +830,16 @@
##
## Representative half-life:
## [1] 41.33
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
## Warning in cov2cor(ans$cov.unscaled): 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
## Sums of squares:
## SFO IORE DFOP
## 106.91629 68.55574 106.91629
@@ -890,14 +883,14 @@
The DFOP fraction parameter is greater than 1
-
+
## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
## The representative half-life of the IORE model is longer than the one corresponding
## to the terminal degradation rate found with the DFOP model.
-
+
-
+
## The representative half-life obtained from the DFOP model may be used
## Sums of squares:
## SFO IORE DFOP
## 3831.804 2062.008 1550.980
@@ -1010,7 +1003,7 @@
Benchmark timings for mkin on various systems
Johannes Ranke
- 2019-05-08
+ 2019-06-04
benchmarks.Rmd
# Parent only
t1 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_2006_C, FOCUS_2006_D)))[["elapsed"]]
-t2 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_2006_C, FOCUS_2006_D), error_model = "tc"))[["elapsed"]]
-
-# One metabolite
-SFO_SFO <- mkinmod(
- parent = mkinsub("SFO", "m1"),
- m1 = mkinsub("SFO"))
+
## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): Optimisation did not converge:
+## iteration limit reached without convergence (10)
-
-## Successfully compiled differential equation model from auto-generated C code.
-## Successfully compiled differential equation model from auto-generated C code.
+
DFOP_SFO <- mkinmod(
+
-
+
+## Successfully compiled differential equation model from auto-generated C code.
+
+## Successfully compiled differential equation model from auto-generated C code.
## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
+## Observations with value of zero were removed from the data
-## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
-## Observations with value of zero were removed from the data
-
-## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
## Observations with value of zero were removed from the data
## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
## Observations with value of zero were removed from the data
t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(subset(FOCUS_2006_D, value != 0)), error_model = "tc"))[["elapsed"]]
-t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_2006_D), error_model = "obs"))[["elapsed"]]
t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(subset(FOCUS_2006_D, value != 0)), error_model = "tc"))[["elapsed"]]
+t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_2006_D), error_model = "obs"))[["elapsed"]]
-## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
## Observations with value of zero were removed from the data
@@ -149,117 +149,131 @@
## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...):
## Observations with value of zero were removed from the data
# Two metabolites, synthetic data
-m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"),
- M1 = mkinsub("SFO", "M2"),
- M2 = mkinsub("SFO"),
- use_of_ff = "max", quiet = TRUE)
-
-m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")),
- M1 = mkinsub("SFO"),
- M2 = mkinsub("SFO"),
- use_of_ff = "max", quiet = TRUE)
-
-SFO_lin_a <- synthetic_data_for_UBA_2014[[1]]$data
-
-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"]
-
-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"]
-
-mkin_benchmarks[system_string, paste0("t", 1:11)] <- c(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11)
-mkin_benchmarks
# Two metabolites, synthetic data
+m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"),
+ M1 = mkinsub("SFO", "M2"),
+ M2 = mkinsub("SFO"),
+ use_of_ff = "max", quiet = TRUE)
+
+m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")),
+ M1 = mkinsub("SFO"),
+ M2 = mkinsub("SFO"),
+ use_of_ff = "max", quiet = TRUE)
+
+SFO_lin_a <- synthetic_data_for_UBA_2014[[1]]$data
+
+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"]
+
+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"]
+
+mkin_benchmarks[system_string, paste0("t", 1:11)] <- c(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11)
+mkin_benchmarks
-
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.626
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.527## CPU
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 AMD Ryzen 7 1700 Eight-Core Processor
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 AMD Ryzen 7 1700 Eight-Core Processor
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 AMD Ryzen 7 1700 Eight-Core Processor
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 AMD Ryzen 7 1700 Eight-Core Processor
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 AMD Ryzen 7 1700 Eight-Core Processor
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 AMD Ryzen 7 1700 Eight-Core Processor
## OS
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 Linux
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 Linux
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 Linux
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 Linux
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 Linux
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 Linux
## mkin
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 0.9.48.1
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 0.9.49.1
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 0.9.49.2
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 0.9.49.3
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 0.9.49.4
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 0.9.49.5
## t1
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 3.610
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 8.184
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 7.064
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.296
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.792
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.936
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 5.805
## t2
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 11.019
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 22.889
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 12.558
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 21.239
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 17.398
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 20.545
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 35.748
## t3
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 3.764
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.649
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.786
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 4.510
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.427
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.446
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.403
## t4
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 14.347
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 13.789
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 8.461
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 13.805
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 16.104
-## t5
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 9.495
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 6.395
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 5.675
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.386
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 7.527
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 15.335
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 30.613
+## t5
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 9.495
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 6.395
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 5.675
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.386
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 6.002
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.309
## t6
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 2.623
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 2.542
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 2.723
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 2.643
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 2.541
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 2.635
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 2.546
## t7
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 4.587
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.128
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.478
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 4.374
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.308
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.259
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.214
## t8
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 7.525
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.632
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.862
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.02
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.775
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.737
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.871
## t9
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 16.621
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 8.171
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 7.618
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 11.124
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 11.116
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 7.763
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 15.738
## t10
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 8.576
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 3.676
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 3.579
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 5.388
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.063
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 3.427
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.763
## t11
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 31.267
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 5.636
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 5.574
## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.365
-## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 7.784
Performance benefit by using compiled model definitions in mkin
Johannes Ranke
- 2019-05-08
+ 2019-06-04
compiled_models.Rmd
## test replications elapsed relative user.self sys.self
-## 3 deSolve, compiled 3 3.131 1.000 3.129 0
-## 1 deSolve, not compiled 3 28.306 9.041 28.290 0
-## 2 Eigenvalue based 3 4.361 1.393 4.358 0
+## 3 deSolve, compiled 3 3.053 1.000 3.052 0
+## 1 deSolve, not compiled 3 28.457 9.321 28.442 0
+## 2 Eigenvalue based 3 4.296 1.407 4.293 0
## user.child sys.child
## 3 0 0
## 1 0 0
@@ -214,16 +214,16 @@
## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
## value of zero were removed from the data
## test replications elapsed relative user.self sys.self
-## 2 deSolve, compiled 3 5.023 1.000 5.021 0
-## 1 deSolve, not compiled 3 53.267 10.605 53.235 0
+## 2 deSolve, compiled 3 4.828 1.000 4.825 0
+## 1 deSolve, not compiled 3 53.153 11.009 53.125 0
## user.child sys.child
## 2 0 0
## 1 0 0
+## Running under: Debian GNU/Linux 10 (buster)
## R version 3.6.0 (2019-04-26)
## Platform: x86_64-pc-linux-gnu (64-bit)
-## Running under: Debian GNU/Linux 9 (stretch)
## CPU model: AMD Ryzen 7 1700 Eight-Core Processor
-mkin 0.9.49.4 (2019-05-08) Unreleased
+mkin 0.9.49.5 (2019-06-04) Unreleased
-
experimental_data_for_UBA.Rd
The 12 datasets were extracted from active substance evaluation dossiers published + by EFSA. Kinetic evaluations shown for these datasets are intended to illustrate + and advance error model specifications. The fact that these data and some + results are shown here do not imply a license to use them in the context of + pesticide registrations, as the use of the data may be constrained by + data protection regulations.
+ +experimental_data_for_UBA_2019
+
+ A list containing twelve datasets as an R6 class defined by mkinds
,
+ each containing, among others, the following components
title
The name of the dataset, e.g. Soil 1
data
A data frame with the data in the form expected by mkinfit
Ranke (2019) Documentation of results obtained for the error model expertise + written for the German Umweltbundesamt.
+ + +++# Model definitions +sfo_sfo <- mkinmod( + parent = mkinsub("SFO", to = "A1"), + A1 = mkinsub("SFO"), + use_of_ff = "max" +)#>+dfop_sfo <- mkinmod( + parent = mkinsub("DFOP", to = "A1"), + A1 = mkinsub("SFO"), + use_of_ff = "max" +)#>+sfo_sfo_sfo <- mkinmod( + parent = mkinsub("SFO", to = "A1"), + A1 = mkinsub("SFO", to = "A2"), + A2 = mkinsub("SFO"), + use_of_ff = "max" +)#>+dfop_sfo_sfo <- mkinmod( + parent = mkinsub("DFOP", to = "A1"), + A1 = mkinsub("SFO", to = "A2"), + A2 = mkinsub("SFO"), + use_of_ff = "max" +)#>d_1_2 <- lapply(experimental_data_for_UBA_2019[1:2], function(x) x$data) +names(d_1_2) <- paste("Soil", 1:2) + + +f_1_2_tc <- mmkin(list("DFOP-SFO-SFO" = dfop_sfo_sfo), d_1_2, error_model = "tc") + +plot(f_1_2_tc, resplot = "errmod")+
Function to plot the confidence intervals obtained using mkinfit
Function to plot squared residuals and the error model for an mkin object
Synthetic datasets for one parent compound with two metabolites
Experimental datasets used for development and testing of error models
If the error model is "const", the error model algorithm is ignored, + because no special algorithm is needed and unweighted (also known as + ordinary) least squares fitting can be applied.
+The default algorithm "d_3" will directly minimize the negative + log-likelihood and - independently - also use the three step algorithm + described below. The fit with the higher likelihood is returned.
+The algorithm "direct" will directly minimize the negative + log-likelihood.
+The algorithm "twostep" will minimize the negative log-likelihood + after an initial unweighted leas squares optimisation step.
+The algorithm "threestep" starts with unweighted least squares, + then optimizes only the error model using the degradation model + parameters found, and then minimizes the negative log-likelihood + with free degradation and error model parameters.
+The algorithm "fourstep" starts with unweighted least squares, + then optimizes only the error model using the degradation model + parameters found, then optimizes the degradation model again + with fixed error model parameters, and finally minimizes the negative + log-likelihood with free degradation and error model parameters.
+The algorithm "IRLS" starts with unweighted least squares, + and then iterates optimization of the error model parameters and subsequent + optimization of the degradation model using those error model parameters, + until the error model parameters converge.
Tolerance for the convergence criterion calculated from the error model + parameters in IRLS fits.
Maximum number of iterations in IRLS fits.
Should a trace of the parameter values be listed?
diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 51be5465..2c5f056e 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -68,7 +68,7 @@ For the definition of model types and their parameters, the equations given @@ -234,7 +234,7 @@ For the definition of model types and their parameters, the equations given SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)# Use shorthand notation for parent only degradation fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) -summary(fit)#> mkin version used for fitting: 0.9.49.4 +summary(fit)#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed May 8 20:50:50 2019 -#> Date of summary: Wed May 8 20:50:50 2019 +#> Date of fit: Tue Jun 4 15:01:15 2019 +#> Date of summary: Tue Jun 4 15:01:15 2019 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 222 model solutions performed in 0.456 s +#> Fitted using 222 model solutions performed in 0.461 s #> #> Error model: #> Constant variance @@ -443,7 +480,7 @@ Per default, parameters in the kinetic models are internally transformed in m1 = mkinsub("SFO"))#># 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 -#> 1.488 0.000 1.488coef(fit)#> NULLendpoints(fit)#> $ff +#> 1.521 0.000 1.526coef(fit)#> NULLendpoints(fit)#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -515,7 +552,7 @@ Per default, parameters in the kinetic models are internally transformed in #> Sum of squared residuals at call 126: 371.2134 #> Sum of squared residuals at call 135: 371.2134 #> Negative log-likelihood at call 145: 97.22429#>#> User System verstrichen -#> 1.086 0.000 1.087coef(fit.deSolve)#> NULLendpoints(fit.deSolve)#> $ff +#> 1.093 0.000 1.093coef(fit.deSolve)#> NULLendpoints(fit.deSolve)#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -545,10 +582,10 @@ Per default, parameters in the kinetic models are internally transformed in fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode, quiet = TRUE)#> Warning: Observations with value of zero were removed from the data# Weighted fits, including IRLS SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"), use_of_ff = "max")#>f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.noweight)#>f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.noweight)#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed May 8 20:51:06 2019 -#> Date of summary: Wed May 8 20:51:06 2019 +#> Date of fit: Tue Jun 4 15:01:31 2019 +#> Date of summary: Tue Jun 4 15:01:31 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -556,7 +593,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 421 model solutions performed in 1.082 s +#> Fitted using 421 model solutions performed in 1.096 s #> #> Error model: #> Constant variance @@ -663,10 +700,10 @@ Per default, parameters in the kinetic models are internally transformed in #> 100 m1 31.04 31.98163 -9.416e-01 #> 100 m1 33.13 31.98163 1.148e+00 #> 120 m1 25.15 28.78984 -3.640e+00 -#> 120 m1 33.31 28.78984 4.520e+00f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.obs)#> mkin version used for fitting: 0.9.49.4 +#> 120 m1 33.31 28.78984 4.520e+00f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.obs)#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed May 8 20:51:08 2019 -#> Date of summary: Wed May 8 20:51:08 2019 +#> Date of fit: Tue Jun 4 15:01:34 2019 +#> Date of summary: Tue Jun 4 15:01:34 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -674,19 +711,19 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 758 model solutions performed in 1.971 s +#> Fitted using 979 model solutions performed in 2.603 s #> #> Error model: #> Variance unique to each observed variable #> #> Starting values for parameters to be optimised: -#> value type -#> parent_0 100.7500 state -#> k_parent 0.1000 deparm -#> k_m1 0.1001 deparm -#> f_parent_to_m1 0.5000 deparm -#> sigma_parent 3.0000 error -#> sigma_m1 3.0000 error +#> value type +#> parent_0 100.750000 state +#> k_parent 0.100000 deparm +#> k_m1 0.100100 deparm +#> f_parent_to_m1 0.500000 deparm +#> sigma_parent 3.398909 error +#> sigma_m1 2.857157 error #> #> Starting values for the transformed parameters actually optimised: #> value lower upper @@ -694,8 +731,8 @@ Per default, parameters in the kinetic models are internally transformed in #> log_k_parent -2.302585 -Inf Inf #> log_k_m1 -2.301586 -Inf Inf #> f_parent_ilr_1 0.000000 -Inf Inf -#> sigma_parent 3.000000 0 Inf -#> sigma_m1 3.000000 0 Inf +#> sigma_parent 3.398909 0 Inf +#> sigma_m1 2.857157 0 Inf #> #> Fixed parameter values: #> value type @@ -715,14 +752,14 @@ Per default, parameters in the kinetic models are internally transformed in #> parent_0 1.00000 0.51078 -0.19133 -0.59997 0.035670 #> log_k_parent 0.51078 1.00000 -0.37458 -0.59239 0.069833 #> log_k_m1 -0.19133 -0.37458 1.00000 0.74398 -0.026158 -#> f_parent_ilr_1 -0.59997 -0.59239 0.74398 1.00000 -0.041368 +#> f_parent_ilr_1 -0.59997 -0.59239 0.74398 1.00000 -0.041369 #> sigma_parent 0.03567 0.06983 -0.02616 -0.04137 1.000000 -#> sigma_m1 -0.03385 -0.06627 0.02482 0.03925 -0.004628 +#> sigma_m1 -0.03385 -0.06627 0.02482 0.03926 -0.004628 #> sigma_m1 #> parent_0 -0.033847 #> log_k_parent -0.066265 -#> log_k_m1 0.024821 -#> f_parent_ilr_1 0.039255 +#> log_k_m1 0.024823 +#> f_parent_ilr_1 0.039256 #> sigma_parent -0.004628 #> sigma_m1 1.000000 #> @@ -786,17 +823,17 @@ Per default, parameters in the kinetic models are internally transformed in #> 21 m1 46.44 41.65115 4.789e+00 #> 35 m1 41.22 43.29465 -2.075e+00 #> 35 m1 37.95 43.29465 -5.345e+00 -#> 50 m1 41.19 41.19948 -9.481e-03 +#> 50 m1 41.19 41.19948 -9.479e-03 #> 50 m1 40.01 41.19948 -1.189e+00 -#> 75 m1 40.09 36.44036 3.650e+00 -#> 75 m1 33.85 36.44036 -2.590e+00 -#> 100 m1 31.04 31.98774 -9.477e-01 -#> 100 m1 33.13 31.98774 1.142e+00 -#> 120 m1 25.15 28.80430 -3.654e+00 -#> 120 m1 33.31 28.80430 4.506e+00f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.tc)#> mkin version used for fitting: 0.9.49.4 +#> 75 m1 40.09 36.44035 3.650e+00 +#> 75 m1 33.85 36.44035 -2.590e+00 +#> 100 m1 31.04 31.98773 -9.477e-01 +#> 100 m1 33.13 31.98773 1.142e+00 +#> 120 m1 25.15 28.80429 -3.654e+00 +#> 120 m1 33.31 28.80429 4.506e+00f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)#> Warning: Observations with value of zero were removed from the datasummary(f.tc)#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed May 8 20:51:11 2019 -#> Date of summary: Wed May 8 20:51:11 2019 +#> Date of fit: Tue Jun 4 15:01:43 2019 +#> Date of summary: Tue Jun 4 15:01:43 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -804,28 +841,28 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 821 model solutions performed in 3.29 s +#> Fitted using 2289 model solutions performed in 9.499 s #> #> Error model: #> Two-component variance function #> #> Starting values for parameters to be optimised: -#> value type -#> parent_0 100.7500 state -#> k_parent 0.1000 deparm -#> k_m1 0.1001 deparm -#> f_parent_to_m1 0.5000 deparm -#> sigma_low 0.1000 error -#> rsd_high 0.1000 error +#> value type +#> parent_0 1.007500e+02 state +#> k_parent 1.000000e-01 deparm +#> k_m1 1.001000e-01 deparm +#> f_parent_to_m1 5.000000e-01 deparm +#> sigma_low 5.641148e-03 error +#> rsd_high 8.430766e-02 error #> #> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 100.750000 -Inf Inf -#> log_k_parent -2.302585 -Inf Inf -#> log_k_m1 -2.301586 -Inf Inf -#> f_parent_ilr_1 0.000000 -Inf Inf -#> sigma_low 0.100000 0 Inf -#> rsd_high 0.100000 0 Inf +#> value lower upper +#> parent_0 100.750000000 -Inf Inf +#> log_k_parent -2.302585093 -Inf Inf +#> log_k_m1 -2.301585593 -Inf Inf +#> f_parent_ilr_1 0.000000000 -Inf Inf +#> sigma_low 0.005641148 0 Inf +#> rsd_high 0.084307660 0 Inf #> #> Fixed parameter values: #> value type @@ -856,7 +893,7 @@ Per default, parameters in the kinetic models are internally transformed in #> Estimate t value Pr(>t) Lower Upper #> parent_0 1.007e+02 38.4300 1.180e-28 95.400000 1.061e+02 #> k_parent 1.006e-01 112.8000 1.718e-43 0.098760 1.024e-01 -#> k_m1 5.167e-03 10.9500 1.172e-12 0.004290 6.223e-03 +#> k_m1 5.167e-03 10.9500 1.171e-12 0.004290 6.223e-03 #> f_parent_to_m1 5.084e-01 26.0100 2.146e-23 0.468600 5.481e-01 #> sigma_low 3.050e-03 0.6314 2.661e-01 -0.006786 1.289e-02 #> rsd_high 7.928e-02 8.4170 6.418e-10 0.060100 9.847e-02 @@ -879,18 +916,18 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Data: #> time variable observed predicted residual -#> 0 parent 99.46 100.73433 -1.274329 -#> 0 parent 102.04 100.73433 1.305671 -#> 1 parent 93.50 91.09750 2.402495 -#> 1 parent 92.50 91.09750 1.402495 -#> 3 parent 63.23 74.50140 -11.271403 -#> 3 parent 68.99 74.50140 -5.511403 -#> 7 parent 52.32 49.82880 2.491205 -#> 7 parent 55.13 49.82880 5.301205 -#> 14 parent 27.27 24.64809 2.621909 -#> 14 parent 26.64 24.64809 1.991909 -#> 21 parent 11.50 12.19231 -0.692315 -#> 21 parent 11.64 12.19231 -0.552315 +#> 0 parent 99.46 100.73434 -1.274339 +#> 0 parent 102.04 100.73434 1.305661 +#> 1 parent 93.50 91.09751 2.402486 +#> 1 parent 92.50 91.09751 1.402486 +#> 3 parent 63.23 74.50141 -11.271410 +#> 3 parent 68.99 74.50141 -5.511410 +#> 7 parent 52.32 49.82880 2.491201 +#> 7 parent 55.13 49.82880 5.301201 +#> 14 parent 27.27 24.64809 2.621908 +#> 14 parent 26.64 24.64809 1.991908 +#> 21 parent 11.50 12.19232 -0.692315 +#> 21 parent 11.64 12.19232 -0.552315 #> 35 parent 2.85 2.98327 -0.133266 #> 35 parent 2.91 2.98327 -0.073266 #> 50 parent 0.69 0.66013 0.029874 @@ -899,24 +936,24 @@ Per default, parameters in the kinetic models are internally transformed in #> 75 parent 0.06 0.05344 0.006562 #> 1 m1 4.84 4.88645 -0.046451 #> 1 m1 5.64 4.88645 0.753549 -#> 3 m1 12.91 13.22867 -0.318668 -#> 3 m1 12.96 13.22867 -0.268668 -#> 7 m1 22.97 25.36416 -2.394164 -#> 7 m1 24.47 25.36416 -0.894164 -#> 14 m1 41.69 37.00974 4.680265 -#> 14 m1 33.21 37.00974 -3.799735 -#> 21 m1 44.37 41.90133 2.468670 -#> 21 m1 46.44 41.90133 4.538670 -#> 35 m1 41.22 43.45691 -2.236914 -#> 35 m1 37.95 43.45691 -5.506914 -#> 50 m1 41.19 41.34199 -0.151988 -#> 50 m1 40.01 41.34199 -1.331988 -#> 75 m1 40.09 36.61471 3.475290 -#> 75 m1 33.85 36.61471 -2.764710 -#> 100 m1 31.04 32.20083 -1.160830 -#> 100 m1 33.13 32.20083 0.929170 -#> 120 m1 25.15 29.04131 -3.891312 -#> 120 m1 33.31 29.04131 4.268688+#> 3 m1 12.91 13.22867 -0.318669 +#> 3 m1 12.96 13.22867 -0.268669 +#> 7 m1 22.97 25.36417 -2.394166 +#> 7 m1 24.47 25.36417 -0.894166 +#> 14 m1 41.69 37.00974 4.680263 +#> 14 m1 33.21 37.00974 -3.799737 +#> 21 m1 44.37 41.90133 2.468669 +#> 21 m1 46.44 41.90133 4.538669 +#> 35 m1 41.22 43.45691 -2.236913 +#> 35 m1 37.95 43.45691 -5.506913 +#> 50 m1 41.19 41.34199 -0.151985 +#> 50 m1 40.01 41.34199 -1.331985 +#> 75 m1 40.09 36.61471 3.475295 +#> 75 m1 33.85 36.61471 -2.764705 +#> 100 m1 31.04 32.20082 -1.160823 +#> 100 m1 33.13 32.20082 0.929177 +#> 120 m1 25.15 29.04130 -3.891304 +#> 120 m1 33.31 29.04130 4.268696
# One parent compound, one metabolite, both single first order, path from -# parent to sink included -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"), +diff --git a/docs/reference/plot.mmkin-1.png b/docs/reference/plot.mmkin-1.png index 03d334f7..8cf969c9 100644 Binary files a/docs/reference/plot.mmkin-1.png and b/docs/reference/plot.mmkin-1.png differ diff --git a/docs/reference/plot.mmkin-2.png b/docs/reference/plot.mmkin-2.png index 25ed01cc..45d67b55 100644 Binary files a/docs/reference/plot.mmkin-2.png and b/docs/reference/plot.mmkin-2.png differ diff --git a/docs/reference/plot.mmkin-3.png b/docs/reference/plot.mmkin-3.png index 7f32afe2..47cd7eec 100644 Binary files a/docs/reference/plot.mmkin-3.png and b/docs/reference/plot.mmkin-3.png differ diff --git a/docs/reference/plot.mmkin-4.png b/docs/reference/plot.mmkin-4.png index b03dffb2..44037bb4 100644 Binary files a/docs/reference/plot.mmkin-4.png and b/docs/reference/plot.mmkin-4.png differ diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index 3037ca24..0b626d1b 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -67,7 +67,7 @@ If the current plot device is a tikz device, @@ -197,8 +197,8 @@ If the current plot device is a tikz device,# One parent compound, one metabolite, both single first order, path from +# parent to sink included +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"), m1 = mkinsub("SFO", full = "Metabolite M1" ))#>#> Warning: Observations with value of zero were removed from the dataplot(fit)# Show the observed variables separately plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))@@ -306,7 +306,7 @@ plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, …diff --git a/docs/reference/print.mkinds.html b/docs/reference/print.mkinds.html index 2cc112aa..7c401533 100644 --- a/docs/reference/print.mkinds.html +++ b/docs/reference/print.mkinds.html @@ -63,7 +63,7 @@ @@ -165,7 +165,7 @@ diff --git a/docs/reference/print.mkinmod.html b/docs/reference/print.mkinmod.html index d09b629e..4ca7631b 100644 --- a/docs/reference/print.mkinmod.html +++ b/docs/reference/print.mkinmod.html @@ -63,7 +63,7 @@ @@ -186,7 +186,7 @@ diff --git a/docs/reference/print.nafta.html b/docs/reference/print.nafta.html index 28847afe..10afb77d 100644 --- a/docs/reference/print.nafta.html +++ b/docs/reference/print.nafta.html @@ -65,7 +65,7 @@ @@ -177,7 +177,7 @@ diff --git a/docs/reference/schaefer07_complex_case-1.png b/docs/reference/schaefer07_complex_case-1.png index 49967dc9..34356613 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 09f6d1e2..50e07d37 100644 --- a/docs/reference/schaefer07_complex_case.html +++ b/docs/reference/schaefer07_complex_case.html @@ -65,7 +65,7 @@ @@ -216,7 +216,7 @@ diff --git a/docs/reference/sigma_twocomp.html b/docs/reference/sigma_twocomp.html index 265c7d1f..b73b81f4 100644 --- a/docs/reference/sigma_twocomp.html +++ b/docs/reference/sigma_twocomp.html @@ -68,7 +68,7 @@ This is the error model used for example by Werner et al. (1978). The model @@ -195,7 +195,7 @@ This is the error model used for example by Werner et al. (1978). The model diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index b3151da1..ffe1edb1 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -66,7 +66,7 @@ @@ -209,10 +209,10 @@# Only use one core not to offend CRAN checks fits <- mmkin(c("FOMC", "HS"), list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles - cores = 1, quiet = TRUE, error_model = "tc") - plot(fits[, "FOCUS C"])+ cores = 1, quiet = TRUE, error_model = "tc")#> Warning: Optimisation did not converge: +#> iteration limit reached without convergence (10)# We can also plot a single fit, if we like the way plot.mmkin works, but then the plot # height should be smaller than the plot width (this is not possible for the html pages # generated by pkgdown, as far as I know). @@ -227,7 +227,7 @@ If the current plot device is a tikz device,diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index 1aa4485a..fdc6e0ac 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -67,7 +67,7 @@ @@ -187,7 +187,7 @@ plot(x, legend = FALSE, main = "auto", …)Examples
-#> mkin version used for fitting: 0.9.49.4 +diff --git a/docs/reference/synthetic_data_for_UBA.html b/docs/reference/synthetic_data_for_UBA.html index 2c2623e4..4a7ca728 100644 --- a/docs/reference/synthetic_data_for_UBA.html +++ b/docs/reference/synthetic_data_for_UBA.html @@ -40,7 +40,7 @@ Variance component 'a' is based on a normal distribution with standard deviation Variance component 'c' is based on the error model from Rocke and Lorenzato (1995), with the minimum standard deviation (for small y values) of 0.5, and a proportionality constant of 0.07 for the increase of the standard deviation with y. Note that this is a simplified version - of the error model proposed by Rocke and Lorenzato (1995), as in their model the error of the + of the error model proposed by Rocke and Lorenzato (1995), as in their model the error of the measured values approximates lognormal distribution for high values, whereas we are using normally distributed error components all along. Initial concentrations for metabolites and all values where adding the variance component resulted @@ -78,7 +78,7 @@ Compare also the code in the example section to see the degradation models." /> @@ -151,7 +151,7 @@ Compare also the code in the example section to see the degradation models." /> Variance component 'c' is based on the error model from Rocke and Lorenzato (1995), with the minimum standard deviation (for small y values) of 0.5, and a proportionality constant of 0.07 for the increase of the standard deviation with y. Note that this is a simplified version - of the error model proposed by Rocke and Lorenzato (1995), as in their model the error of the + of the error model proposed by Rocke and Lorenzato (1995), as in their model the error of the measured values approximates lognormal distribution for high values, whereas we are using normally distributed error components all along.#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed May 8 20:52:12 2019 -#> Date of summary: Wed May 8 20:52:12 2019 +#> Date of fit: Tue Jun 4 15:03:02 2019 +#> Date of summary: Tue Jun 4 15:03:02 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent @@ -307,7 +307,7 @@Initial concentrations for metabolites and all values where adding the variance component resulted @@ -253,7 +253,8 @@ add_err = function(d, sdfunc, LOD = 0.1, reps = 2, seed = 123456789) return(d_NA) } -# The following is the two-component model of Rocke and Lorenzato (1995) +# The following is the simplified version of the two-component model of Rocke +# and Lorenzato (1995) sdfunc_twocomp = function(value, sd_low, rsd_high) { sqrt(sd_low^2 + value^2 * rsd_high^2) } @@ -304,7 +305,7 @@ summary(fit)
diff --git a/docs/reference/test_data_from_UBA_2014-1.png b/docs/reference/test_data_from_UBA_2014-1.png index a9aeea21..fc05f896 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 f6c91bff..b0dfdd5a 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 bc988340..e40d320f 100644 --- a/docs/reference/test_data_from_UBA_2014.html +++ b/docs/reference/test_data_from_UBA_2014.html @@ -64,7 +64,7 @@ @@ -231,7 +231,7 @@ diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 7e05480e..bf134334 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -71,7 +71,7 @@ The transformation of sets of formation fractions is fragile, as it supposes @@ -293,7 +293,7 @@ The transformation of sets of formation fractions is fragile, as it supposes -- cgit v1.2.1