From af7c6de4db9981ac814362c441fbac22c8faa2d7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 24 Nov 2022 09:02:26 +0100 Subject: Start online docs of the development version --- docs/dev/articles/FOCUS_D.html | 411 ++--- .../articles/FOCUS_D_files/figure-html/plot-1.png | Bin 79176 -> 79834 bytes .../FOCUS_D_files/figure-html/plot_2-1.png | Bin 24025 -> 24334 bytes docs/dev/articles/FOCUS_L.html | 84 +- docs/dev/articles/index.html | 2 +- docs/dev/articles/mkin.html | 4 +- docs/dev/articles/twa.html | 41 +- docs/dev/articles/web_only/FOCUS_Z.html | 402 ++--- .../figure-html/FOCUS_2006_Z_fits_1-1.png | Bin 66640 -> 66689 bytes .../figure-html/FOCUS_2006_Z_fits_10-1.png | Bin 106038 -> 105896 bytes .../figure-html/FOCUS_2006_Z_fits_11-1.png | Bin 105042 -> 104793 bytes .../figure-html/FOCUS_2006_Z_fits_11a-1.png | Bin 75626 -> 75230 bytes .../figure-html/FOCUS_2006_Z_fits_11b-1.png | Bin 35744 -> 36314 bytes .../figure-html/FOCUS_2006_Z_fits_2-1.png | Bin 66640 -> 66689 bytes .../figure-html/FOCUS_2006_Z_fits_3-1.png | Bin 66424 -> 66448 bytes .../figure-html/FOCUS_2006_Z_fits_5-1.png | Bin 80520 -> 80373 bytes .../figure-html/FOCUS_2006_Z_fits_6-1.png | Bin 105149 -> 105210 bytes .../figure-html/FOCUS_2006_Z_fits_7-1.png | Bin 104479 -> 104538 bytes .../figure-html/FOCUS_2006_Z_fits_9-1.png | Bin 88890 -> 88801 bytes docs/dev/articles/web_only/NAFTA_examples.html | 1611 ++++++++++---------- .../NAFTA_examples_files/figure-html/p10-1.png | Bin 78793 -> 79758 bytes .../NAFTA_examples_files/figure-html/p11-1.png | Bin 75470 -> 76315 bytes .../NAFTA_examples_files/figure-html/p12a-1.png | Bin 80755 -> 81697 bytes .../NAFTA_examples_files/figure-html/p12b-1.png | Bin 69885 -> 70800 bytes .../NAFTA_examples_files/figure-html/p13-1.png | Bin 77126 -> 78121 bytes .../NAFTA_examples_files/figure-html/p14-1.png | Bin 79693 -> 80656 bytes .../NAFTA_examples_files/figure-html/p15a-1.png | Bin 75945 -> 76925 bytes .../NAFTA_examples_files/figure-html/p15b-1.png | Bin 78004 -> 78968 bytes .../NAFTA_examples_files/figure-html/p16-1.png | Bin 93075 -> 93950 bytes .../NAFTA_examples_files/figure-html/p5a-1.png | Bin 81521 -> 82665 bytes .../NAFTA_examples_files/figure-html/p5b-1.png | Bin 79783 -> 80721 bytes .../NAFTA_examples_files/figure-html/p6-1.png | Bin 81974 -> 83052 bytes .../NAFTA_examples_files/figure-html/p7-1.png | Bin 101606 -> 102568 bytes .../NAFTA_examples_files/figure-html/p8-1.png | Bin 91429 -> 92407 bytes .../NAFTA_examples_files/figure-html/p9a-1.png | Bin 77612 -> 78605 bytes .../NAFTA_examples_files/figure-html/p9b-1.png | Bin 75129 -> 76240 bytes docs/dev/articles/web_only/benchmarks.html | 55 +- docs/dev/articles/web_only/compiled_models.html | 25 +- docs/dev/articles/web_only/dimethenamid_2018.html | 50 +- docs/dev/articles/web_only/multistart.html | 13 +- .../figure-html/unnamed-chunk-3-1.png | Bin 59586 -> 64470 bytes .../figure-html/unnamed-chunk-4-1.png | Bin 55154 -> 58448 bytes .../figure-html/unnamed-chunk-5-1.png | Bin 21455 -> 21853 bytes .../figure-html/unnamed-chunk-6-1.png | Bin 54302 -> 52343 bytes docs/dev/articles/web_only/saem_benchmarks.html | 85 +- docs/dev/authors.html | 6 +- docs/dev/index.html | 21 +- docs/dev/news/index.html | 16 +- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/AIC.mmkin.html | 275 ++-- docs/dev/reference/CAKE_export.html | 12 +- docs/dev/reference/D24_2014.html | 12 +- docs/dev/reference/DFOP.solution.html | 7 +- docs/dev/reference/Extract.mmkin.html | 304 ++-- docs/dev/reference/FOCUS_2006_DFOP_ref_A_to_B.html | 183 +-- docs/dev/reference/FOCUS_2006_FOMC_ref_A_to_F.html | 179 +-- docs/dev/reference/FOCUS_2006_HS_ref_A_to_F.html | 183 +-- docs/dev/reference/FOCUS_2006_SFO_ref_A_to_F.html | 175 +-- docs/dev/reference/FOCUS_2006_datasets.html | 194 +-- docs/dev/reference/FOMC.solution.html | 7 +- docs/dev/reference/HS.solution.html | 7 +- docs/dev/reference/IORE.solution.html | 7 +- docs/dev/reference/NAFTA_SOP_2015-1.png | Bin 61980 -> 63022 bytes docs/dev/reference/NAFTA_SOP_2015.html | 249 ++- docs/dev/reference/NAFTA_SOP_Attachment-1.png | Bin 63822 -> 64762 bytes docs/dev/reference/NAFTA_SOP_Attachment.html | 236 ++- docs/dev/reference/Rplot001.png | Bin 22432 -> 14083 bytes docs/dev/reference/Rplot002.png | Bin 16953 -> 13699 bytes docs/dev/reference/Rplot005.png | Bin 22787 -> 19451 bytes docs/dev/reference/SFO.solution.html | 7 +- docs/dev/reference/SFORB.solution.html | 7 +- docs/dev/reference/add_err-1.png | Bin 108676 -> 110047 bytes docs/dev/reference/add_err-2.png | Bin 63336 -> 63716 bytes docs/dev/reference/add_err-3.png | Bin 58909 -> 59458 bytes docs/dev/reference/add_err.html | 349 ++--- docs/dev/reference/anova.saem.mmkin.html | 7 +- docs/dev/reference/aw.html | 7 +- docs/dev/reference/confint.mkinfit.html | 621 ++++---- docs/dev/reference/create_deg_func.html | 20 +- docs/dev/reference/dimethenamid_2018-1.png | Bin 248143 -> 251312 bytes docs/dev/reference/dimethenamid_2018.html | 126 +- docs/dev/reference/ds_mixed-1.png | Bin 0 -> 219939 bytes docs/dev/reference/ds_mixed.html | 240 +++ docs/dev/reference/endpoints.html | 7 +- docs/dev/reference/experimental_data_for_UBA-1.png | Bin 102212 -> 102904 bytes docs/dev/reference/experimental_data_for_UBA.html | 239 ++- docs/dev/reference/f_time_norm_focus.html | 330 ++-- docs/dev/reference/focus_soil_moisture.html | 179 +-- docs/dev/reference/get_deg_func.html | 137 +- docs/dev/reference/illparms.html | 7 +- docs/dev/reference/ilr.html | 235 ++- docs/dev/reference/index.html | 10 +- docs/dev/reference/intervals.saem.mmkin.html | 12 +- docs/dev/reference/llhist.html | 7 +- docs/dev/reference/loftest-1.png | Bin 40351 -> 40003 bytes docs/dev/reference/loftest-2.png | Bin 39817 -> 39622 bytes docs/dev/reference/loftest-3.png | Bin 76976 -> 76871 bytes docs/dev/reference/loftest-4.png | Bin 74678 -> 74700 bytes docs/dev/reference/loftest-5.png | Bin 73446 -> 73212 bytes docs/dev/reference/loftest.html | 494 +++--- docs/dev/reference/logLik.mkinfit.html | 228 ++- docs/dev/reference/logLik.saem.mmkin.html | 2 +- docs/dev/reference/logistic.solution.html | 7 +- docs/dev/reference/lrtest.mkinfit.html | 283 ++-- docs/dev/reference/max_twa_parent.html | 286 ++-- docs/dev/reference/mccall81_245T-1.png | Bin 62537 -> 62692 bytes docs/dev/reference/mccall81_245T.html | 306 ++-- docs/dev/reference/mean_degparms.html | 12 +- docs/dev/reference/mhmkin.html | 7 +- docs/dev/reference/mixed-1.png | Bin 220021 -> 215088 bytes docs/dev/reference/mixed.html | 124 +- docs/dev/reference/mkin_long_to_wide.html | 233 ++- docs/dev/reference/mkin_wide_to_long.html | 193 +-- docs/dev/reference/mkinds.html | 12 +- docs/dev/reference/mkindsg.html | 12 +- docs/dev/reference/mkinerrmin.html | 248 ++- docs/dev/reference/mkinerrplot-1.png | Bin 41094 -> 41273 bytes docs/dev/reference/mkinerrplot.html | 314 ++-- docs/dev/reference/mkinfit.html | 30 +- docs/dev/reference/mkinmod.html | 6 +- docs/dev/reference/mkinparplot-1.png | Bin 25702 -> 25998 bytes docs/dev/reference/mkinparplot.html | 188 +-- docs/dev/reference/mkinplot.html | 164 +- docs/dev/reference/mkinpredict.html | 7 +- docs/dev/reference/mkinresplot-1.png | Bin 23819 -> 23910 bytes docs/dev/reference/mkinresplot.html | 324 ++-- docs/dev/reference/mmkin-1.png | Bin 111120 -> 111900 bytes docs/dev/reference/mmkin-2.png | Bin 108016 -> 108747 bytes docs/dev/reference/mmkin-3.png | Bin 96433 -> 96798 bytes docs/dev/reference/mmkin-4.png | Bin 66723 -> 67454 bytes docs/dev/reference/mmkin-5.png | Bin 65113 -> 65333 bytes docs/dev/reference/mmkin.html | 383 ++--- docs/dev/reference/multistart-1.png | Bin 60852 -> 64933 bytes docs/dev/reference/multistart-2.png | Bin 54922 -> 56780 bytes docs/dev/reference/multistart.html | 7 +- docs/dev/reference/nafta-1.png | Bin 61980 -> 63022 bytes docs/dev/reference/nafta.html | 323 ++-- docs/dev/reference/nlme-1.png | Bin 68891 -> 67982 bytes docs/dev/reference/nlme-2.png | Bin 94389 -> 91395 bytes docs/dev/reference/nlme.html | 142 +- docs/dev/reference/nlme.mmkin.html | 14 +- docs/dev/reference/nobs.mkinfit.html | 159 +- docs/dev/reference/parms.html | 7 +- docs/dev/reference/parplot.html | 13 +- docs/dev/reference/plot.mixed.mmkin.html | 7 +- docs/dev/reference/plot.mkinfit.html | 12 +- docs/dev/reference/plot.mmkin-1.png | Bin 48997 -> 49747 bytes docs/dev/reference/plot.mmkin-2.png | Bin 49376 -> 50033 bytes docs/dev/reference/plot.mmkin-3.png | Bin 46202 -> 46365 bytes docs/dev/reference/plot.mmkin-4.png | Bin 33057 -> 33401 bytes docs/dev/reference/plot.mmkin-5.png | Bin 57372 -> 58203 bytes docs/dev/reference/plot.mmkin.html | 373 ++--- docs/dev/reference/plot.nafta.html | 193 +-- docs/dev/reference/read_spreadsheet.html | 2 +- docs/dev/reference/reexports.html | 12 +- docs/dev/reference/residuals.mkinfit.html | 186 +-- docs/dev/reference/saem.html | 12 +- docs/dev/reference/schaefer07_complex_case-1.png | Bin 66965 -> 67140 bytes docs/dev/reference/schaefer07_complex_case.html | 249 ++- docs/dev/reference/set_nd_nq.html | 7 +- docs/dev/reference/sigma_twocomp-1.png | Bin 43910 -> 43780 bytes docs/dev/reference/sigma_twocomp.html | 245 ++- docs/dev/reference/status.html | 7 +- docs/dev/reference/summary.mkinfit.html | 13 +- docs/dev/reference/summary.mmkin.html | 9 +- docs/dev/reference/summary.nlme.mmkin.html | 24 +- docs/dev/reference/summary.saem.mmkin.html | 483 +++--- .../reference/synthetic_data_for_UBA_2014-1.png | Bin 67191 -> 67454 bytes .../dev/reference/synthetic_data_for_UBA_2014.html | 657 ++++---- docs/dev/reference/test_data_from_UBA_2014-1.png | Bin 57395 -> 57306 bytes docs/dev/reference/test_data_from_UBA_2014-2.png | Bin 72786 -> 72597 bytes docs/dev/reference/test_data_from_UBA_2014.html | 292 ++-- docs/dev/reference/tex_listing.html | 7 +- docs/dev/reference/transform_odeparms.html | 449 +++--- docs/dev/reference/update.mkinfit-1.png | Bin 42360 -> 42522 bytes docs/dev/reference/update.mkinfit-2.png | Bin 43389 -> 43527 bytes docs/dev/reference/update.mkinfit.html | 200 +-- docs/dev/sitemap.xml | 3 + 178 files changed, 7032 insertions(+), 8343 deletions(-) create mode 100644 docs/dev/reference/ds_mixed-1.png create mode 100644 docs/dev/reference/ds_mixed.html (limited to 'docs') diff --git a/docs/dev/articles/FOCUS_D.html b/docs/dev/articles/FOCUS_D.html index a35a255a..a7617d55 100644 --- a/docs/dev/articles/FOCUS_D.html +++ b/docs/dev/articles/FOCUS_D.html @@ -20,6 +20,8 @@ + +
+
@@ -112,207 +123,207 @@

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

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

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

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

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

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

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

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

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

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

-mkinparplot(fit)
+mkinparplot(fit)

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

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

    Example evaluation of FOCUS Laboratory Data L1 to L3

    Johannes Ranke

    -

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

    +

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

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

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

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

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

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

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

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

    Introduction to mkin

    Johannes Ranke

    -

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

    +

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

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

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

    -

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

    +

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

    -

    FOCUS Work Group on Degradation Kinetics. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    +

    FOCUS Work Group on Degradation Kinetics. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

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

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

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

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

    -
    -

    -The data

    +

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

    +
    +

    The data +

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

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

    -Parent and one metabolite

    +
    +

    Parent and one metabolite +

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

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

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

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

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

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

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

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

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

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

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

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

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

    -
    -

    -Metabolites Z2 and Z3

    +
    +

    Metabolites Z2 and Z3 +

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

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

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

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

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

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

    -
    -

    -Using the SFORB model

    +
    +

    Using the SFORB model +

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    The endpoints obtained with this model are

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

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

    -
    -

    -References

    +
    +

    References +

    -

    FOCUS Work Group on Degradation Kinetics. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

    +

    FOCUS Work Group on Degradation Kinetics. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

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

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

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

    -Introduction

    +
    +

    Introduction +

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

    The datasets are now distributed with the mkin package.

    -
    -

    -Examples where DFOP did not converge with PestDF 0.8.4

    +
    +

    Examples where DFOP did not converge with PestDF 0.8.4 +

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

    -
    -

    -Example on page 5, upper panel

    +
    +

    Example on page 5, upper panel +

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

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

    -Example on page 5, lower panel

    +
    +

    Example on page 5, lower panel +

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

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

    -Example on page 6

    +
    +

    Example on page 6 +

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

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

    -Example on page 7

    +
    +

    Example on page 7 +

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

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

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

    -
    -

    -Example on page 8

    +
    +

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

    +
    +

    Example on page 8 +

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

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

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

    -Examples where SFO was not selected for an abiotic study

    -
    -

    -Example on page 9, upper panel

    +
    +

    Examples where SFO was not selected for an abiotic study +

    +
    +

    Example on page 9, upper panel +

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

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

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

    -
    -

    -Example on page 9, lower panel

    +
    +

    Example on page 9, lower panel +

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

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

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

    -
    -

    -Example on page 10

    +
    +

    Example on page 10 +

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

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

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

    -
    -

    -The DT50 was not observed during the study

    -
    -

    -Example on page 11

    +
    +

    The DT50 was not observed during the study +

    +
    +

    Example on page 11 +

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

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

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

    -
    -

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

    +
    +

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

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

    -
    -

    -Example on page 12, upper panel

    +
    +

    Example on page 12, upper panel +

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

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

    -Example on page 12, lower panel

    +
    +

    Example on page 12, lower panel +

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

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

    -Example on page 13

    +
    +

    Example on page 13 +

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

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

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

    +
    +

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

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

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

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

    -
    -

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

    +
    +

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

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

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

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

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

    -
    -

    -The DFOP fraction parameter is greater than 1

    +
    +

    The DFOP fraction parameter is greater than 1 +

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

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

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

    -
    -

    -Conclusions

    +
    +

    Conclusions +

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

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

    -
    -

    -References

    +
    +

    References +

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

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

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.6.

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

    Benchmark timings for mkin

    Johannes Ranke

    -

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

    +

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

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

    Performance benefit by using compiled model definitions in mkin

    Johannes Ranke

    -

    2022-11-01

    +

    2022-11-24

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

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

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

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

    -

    This vignette was built with mkin 1.2.0 on

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

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

    +

    This vignette was built with mkin 1.2.2 on

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

    Example evaluations of the dimethenamid data from 2018

    Johannes Ranke

    -

    Last change 1 July 2022, built on 16 Sep 2022

    +

    Last change 1 July 2022, built on 24 Nov 2022

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

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

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

    Short demo of the multistart method

    Johannes Ranke

    -

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

    +

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

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

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

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

    Benchmark timings for saem.mmkin

    Johannes Ranke

    -

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

    +

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

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

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

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

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

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

    General

    @@ -186,7 +186,7 @@

    GUI

    -

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

    +

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

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

    The first mkin code was published on 11 May 2010 and the first CRAN version on 18 May 2010.

    In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named KinGUII whose R code is based on mkin, but which added, among other refinements, a closed source graphical user interface (GUI), iteratively reweighted least squares (IRLS) optimisation of the variance for each of the observed variables, and Markov Chain Monte Carlo (MCMC) simulation functionality, similar to what is available e.g. in the FME package.

    Somewhat in parallel, Syngenta has sponsored the development of an mkin and KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is more limited in the model formulation, but puts more weight on usability. CAKE is available for download from the CAKE website, where you can also find a zip archive of the R scripts derived from mkin, published under the GPL license.

    -

    Finally, there is KineticEval, which contains a further development of the scripts used for KinGUII, so the different tools will hopefully be able to learn from each other in the future as well.

    -

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

    +

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

    +

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

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

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

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

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

    +

    Thanks to everyone involved for collaboration and support!

    +

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

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

    @@ -88,7 +88,19 @@
    - + +
    +
    + +
    +
    +
    - - -
    +
    @@ -149,102 +94,110 @@ same dataset." /> same dataset.

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

    Arguments

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

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

    ...

    For compatibility with the generic method

    k

    As in the generic method

    - -

    Value

    - -

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

    -

    Author

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

    Arguments

    +
    object
    +

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

    + +
    ...
    +

    For compatibility with the generic method

    + + +
    k
    +

    As in the generic method

    + +
    +
    +

    Value

    + + +

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

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    Subsetting method for mmkin objects

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

    Arguments

    +
    x
    +

    An mmkin object

    -

    Arguments

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

    An mmkin object

    i

    Row index selecting the fits for specific models

    j

    Column index selecting the fits to specific datasets

    ...

    Not used, only there to satisfy the generic method definition

    drop

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

    -

    Value

    +
    i
    +

    Row index selecting the fits for specific models

    -

    An object of class mmkin.

    -

    Author

    +
    j
    +

    Column index selecting the fits to specific datasets

    + + +
    ...
    +

    Not used, only there to satisfy the generic method definition

    + + +
    drop
    +

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

    + +
    +
    +

    Value

    + + +

    An object of class mmkin.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    f

    The fitted f parameter

    -
    k1

    The fitted k1 parameter

    -
    k2

    The fitted k2 parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    f
    +

    The fitted f parameter

    + +
    k1
    +

    The fitted k1 parameter

    + +
    k2
    +

    The fitted k2 parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

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

    +
    +

    Source

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

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

    +
    -

    Examples

    -
    data(FOCUS_2006_DFOP_ref_A_to_B) -
    +
    +

    Examples

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

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    alpha

    The fitted alpha parameter

    -
    beta

    The fitted beta parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    alpha
    +

    The fitted alpha parameter

    + +
    beta
    +

    The fitted beta parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

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

    +
    +

    Source

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

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

    +
    -

    Examples

    -
    data(FOCUS_2006_FOMC_ref_A_to_F) -
    +
    +

    Examples

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

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    tb

    The fitted tb parameter

    -
    k1

    The fitted k1 parameter

    -
    k2

    The fitted k2 parameter

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    tb
    +

    The fitted tb parameter

    + +
    k1
    +

    The fitted k1 parameter

    + +
    k2
    +

    The fitted k2 parameter

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

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

    +
    +

    Source

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

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

    +
    -

    Examples

    -
    data(FOCUS_2006_HS_ref_A_to_F) -
    +
    +

    Examples

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

    Format

    +

    A data frame containing the following variables.

    package
    +

    a factor giving the name of the software package

    -

    Format

    +
    M0
    +

    The fitted initial concentration of the parent compound

    -

    A data frame containing the following variables.

    -
    package

    a factor giving the name of the software package

    -
    M0

    The fitted initial concentration of the parent compound

    -
    k

    The fitted first-order degradation rate constant

    -
    DT50

    The resulting half-life of the parent compound

    -
    DT90

    The resulting DT90 of the parent compound

    -
    dataset

    The FOCUS dataset that was used

    - -
    +
    k
    +

    The fitted first-order degradation rate constant

    + +
    DT50
    +

    The resulting half-life of the parent compound

    + +
    DT90
    +

    The resulting DT90 of the parent compound

    -

    Source

    +
    dataset
    +

    The FOCUS dataset that was used

    -

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

    +
    +

    Source

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

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

    +
    -

    Examples

    -
    data(FOCUS_2006_SFO_ref_A_to_F) -
    +
    +

    Examples

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

    Format

    +

    6 datasets with observations on the following variables.

    name
    +

    a factor containing the name of the observed variable

    -

    Format

    +
    time
    +

    a numeric vector containing time points

    -

    6 datasets with observations on the following variables.

    -
    name

    a factor containing the name of the observed variable

    -
    time

    a numeric vector containing time points

    -
    value

    a numeric vector containing concentrations in percent of applied radioactivity

    - -
    +
    value
    +

    a numeric vector containing concentrations in percent of applied radioactivity

    -

    Source

    - -

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

    +
    +

    Source

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU - Registration” Report of the FOCUS Work Group on Degradation Kinetics, + Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, - http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    - -

    Examples

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

    +
    + +
    +

    Examples

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

    Format

    +

    2 datasets with observations on the following variables.

    name
    +

    a factor containing the name of the observed variable

    -

    Format

    +
    time
    +

    a numeric vector containing time points

    -

    2 datasets with observations on the following variables.

    -
    name

    a factor containing the name of the observed variable

    -
    time

    a numeric vector containing time points

    -
    value

    a numeric vector containing concentrations

    - -
    - -

    Source

    +
    value
    +

    a numeric vector containing concentrations

    + +
    +
    +

    Source

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

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

    - -

    Examples

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

    +
    + +
    +

    Examples

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

    Format

    +
    +
    NAFTA_SOP_Attachment
    +
    +
    +

    Format

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

    -

    Source

    - + for the evaluation with nafta

    +
    +
    +

    Source

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

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

    - -

    Examples

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

    +
    + +
    +

    Examples

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

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

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

    Arguments

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

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

    sdfunc

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

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

    Arguments

    +
    prediction
    +

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

    + + +
    sdfunc
    +

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

    secondary

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

    n

    The number of datasets to be generated.

    LOD

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

    reps

    The number of replicates to be generated within the datasets.

    digits

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

    seed

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

    - -

    Value

    - -

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

    -

    References

    +random error terms for this value.

    + + +
    secondary
    +

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

    + + +
    n
    +

    The number of datasets to be generated.

    + + +
    LOD
    +

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

    + +
    reps
    +

    The number of replicates to be generated within the datasets.

    + + +
    digits
    +

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

    + + +
    seed
    +

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

    + +
    +
    +

    Value

    + + +

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

    +
    +
    +

    References

    Ranke J and Lehmann R (2015) To t-test or not to t-test, that is the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, Piacenza, Italy https://jrwb.de/posters/piacenza_2015.pdf

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

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

    Arguments

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

    An mkinfit object

    parm

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

    level

    The confidence level required

    alpha

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

    cutoff

    Possibility to specify an alternative cutoff for the difference +

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

    Arguments

    +
    object
    +

    An mkinfit object

    + + +
    parm
    +

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

    + + +
    level
    +

    The confidence level required

    + + +
    alpha
    +

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

    + + +
    cutoff
    +

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

    method

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

    + + +
    method
    +

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

    transformed

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

    backtransform

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

    + + +
    transformed
    +

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

    + + +
    backtransform
    +

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

    cores

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

    rel_tol

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

    + + +
    cores
    +

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

    + + +
    rel_tol
    +

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

    quiet

    Should we suppress the message "Profiling the likelihood"

    ...

    Not used

    - -

    Value

    - -

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

    -

    References

    +the quadratic method?

    + + +
    quiet
    +

    Should we suppress the message "Profiling the likelihood"

    + +
    ...
    +

    Not used

    + +
    +
    +

    Value

    + + +

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

    +
    +
    +

    References

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

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

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

    +
    -

    Examples

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

    Examples

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

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

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

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

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

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

    +
    + + + +
    +

    Examples

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

    Site built with pkgdown 2.0.6.

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

    Format

    +

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

    title
    +

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

    -

    Format

    +
    data
    +

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

    -

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

    -
    title

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

    -
    data

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

    -
    - -

    Source

    - +
    +
    +

    Source

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

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

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

    -

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

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

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

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

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

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

    +
    -

    Examples

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

    Examples

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

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

    Arguments

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

    An object containing information used for the calculations

    ...

    Currently not used

    moisture

    Numeric vector of moisture contents in \% w/w

    field_moisture

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

    temperature

    Numeric vector of temperatures in °C

    Q10

    The Q10 value used for temperature normalisation

    walker

    The Walker exponent used for moisture normalisation

    f_na

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

    study_moisture_ref_source

    Source for the reference value +

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

    Arguments

    +
    object
    +

    An object containing information used for the calculations

    + + +
    ...
    +

    Currently not used

    + + +
    moisture
    +

    Numeric vector of moisture contents in \% w/w

    + + +
    field_moisture
    +

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

    + + +
    temperature
    +

    Numeric vector of temperatures in °C

    + + +
    Q10
    +

    The Q10 value used for temperature normalisation

    + + +
    walker
    +

    The Walker exponent used for moisture normalisation

    + + +
    f_na
    +

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

    + + +
    study_moisture_ref_source
    +

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

    +the focus soil moisture for the soil class is used

    -

    References

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence +

    +
    +

    References

    +

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

    -

    See also

    - - - -

    Examples

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

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

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

    -
    focus_soil_moisture
    - - -

    Format

    +
    +
    focus_soil_moisture
    +
    +
    +

    Format

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

    -

    Source

    - +
    +
    +

    Source

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

    - -

    Examples

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

    +
    + +
    +

    Examples

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

    Retrieve a degradation function from the mmkin namespace

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

    Value

    +
    +

    Value

    + -

    A function that was likely previously assigned from within +

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

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

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

    Arguments

    - - - - - - -
    x

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

    +
    +

    Arguments

    +
    x
    +

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

    -

    Value

    +
    +
    +

    Value

    + -

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

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

    -

    References

    - +
    +
    +

    References

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

    -

    See also

    - -

    Another implementation can be found in R package +

    +
    +

    See also

    +

    Another implementation can be found in R package robCompositions.

    -

    Author

    - +
    +
    +

    Author

    René Lehmann and Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    -

    focus_soil_moisture

    +

    ds_mixed ds_sfo ds_fomc ds_dfop ds_hs ds_dfop_sfo

    -

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

    +

    Synthetic data for hierarchical kinetic degradation models

    D24_2014

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

    test_data_from_UBA_2014

    Three experimental datasets from two water sediment systems and one soil

    + +

    focus_soil_moisture

    + +

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

    print(<mkinds>)

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

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

    +lrtest.default from the lmtest package.

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

    Arguments

    +
    object
    +

    A model object with a defined loftest method

    -

    Arguments

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

    A model object with a defined loftest method

    ...

    Not used

    -

    Details

    +
    ...
    +

    Not used

    +
    +
    +

    Details

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

    -

    See also

    - -

    lrtest

    +
    +
    +

    See also

    +

    lrtest

    +
    -

    Examples

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

    Examples

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

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

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

    Arguments

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

    An object of class mkinfit.

    ...

    For compatibility with the generic method

    - -

    Value

    - -

    An object of class logLik with the number of estimated +

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

    Arguments

    +
    object
    +

    An object of class mkinfit.

    + + +
    ...
    +

    For compatibility with the generic method

    + +
    +
    +

    Value

    + + +

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

    -

    Details

    - +
    +
    +

    Details

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

    -

    See also

    - -

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

    -

    Author

    - +
    +
    +

    See also

    +

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

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

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

    Arguments

    +
    object
    +

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

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

    Optionally, another mkinfit object fitted to the same data.

    -

    Arguments

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

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

    object_2

    Optionally, another mkinfit object fitted to the same data.

    ...

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

    -

    Details

    +
    ...
    +

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

    +
    +
    +

    Details

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

    -

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

    +

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

    +
    -

    Examples

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

    Examples

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

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

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

    Arguments

    +
    fit
    +

    An object of class mkinfit.

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

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

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

    Arguments

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

    An object of class mkinfit.

    windows

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

    M0

    The initial concentration for which the maximum time weighted +

    M0
    +

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

    k

    The rate constant in the case of SFO kinetics.

    t

    The width of the time window.

    alpha

    Parameter of the FOMC model.

    beta

    Parameter of the FOMC model.

    k1

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

    k2

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

    g

    Parameter of the DFOP model.

    tb

    Parameter of the HS model.

    - -

    Value

    - -

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

    + + +
    k
    +

    The rate constant in the case of SFO kinetics.

    + + +
    t
    +

    The width of the time window.

    + + +
    alpha
    +

    Parameter of the FOMC model.

    + + +
    beta
    +

    Parameter of the FOMC model.

    + + +
    k1
    +

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

    + + +
    k2
    +

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

    + + +
    g
    +

    Parameter of the DFOP model.

    + + +
    tb
    +

    Parameter of the HS model.

    + +
    +
    +

    Value

    + + +

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

    -

    References

    - -

    FOCUS (2006) “Guidance Document on Estimating Persistence +

    +
    +

    References

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in -EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    -

    Author

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

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    Format

    +
    +
    mccall81_245T
    +
    -

    A dataframe containing the following variables.

    -
    name

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

    +

    Format

    +

    A dataframe containing the following variables.

    name
    +

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

    -
    time

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

    + +
    time
    +

    a numeric vector containing sampling times in days after treatment

    -
    value

    a numeric vector containing concentrations in percent of applied radioactivity

    -
    soil

    a factor containing the name of the soil

    - -
    -

    Source

    +
    value
    +

    a numeric vector containing concentrations in percent of applied radioactivity

    + +
    soil
    +

    a factor containing the name of the soil

    + +
    +
    +

    Source

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

    + doi:10.1021/jf00103a026

    +
    -

    Examples

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

    Examples

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

    Arguments

    object

    An mmkin row object

    + +
    ...

    Currently not used

    + +
    method

    The method to be used

    + +
    x

    A mixed.mmkin object to print

    + +
    digits

    Number of digits to use for printing.

    +

    Value

    -

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

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

    Examples

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

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

    -

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

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

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

    Arguments

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

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

    +

    Arguments

    +
    long_data
    +

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

    time

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

    outtime

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

    - -

    Value

    - -

    Dataframe in wide format.

    -

    Author

    +observed values called "value".

    + + +
    time
    +

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

    + + +
    outtime
    +

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

    + +
    +
    +

    Value

    + +

    Dataframe in wide format.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

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

    +mkinfit.

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

    Arguments

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

    The dataframe must contain one variable with the time +

    +

    Arguments

    +
    wide_data
    +

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

    time

    The name of the time variable.

    +column of observed values.

    + -

    Value

    +
    time
    +

    The name of the time variable.

    -

    Dataframe in long format as needed for mkinfit.

    -

    Author

    +
    +
    +

    Value

    + +

    Dataframe in long format as needed for mkinfit.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    -
    mkinerrmin(fit, alpha = 0.05)
    - -

    Arguments

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

    an object of class mkinfit.

    alpha

    The confidence level chosen for the chi-squared test.

    - -

    Value

    - -

    A dataframe with the following components:

    -
    err.min

    The -relative error, expressed as a fraction.

    n.optim

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

    df

    The number of +

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

    Arguments

    +
    fit
    +

    an object of class mkinfit.

    + + +
    alpha
    +

    The confidence level chosen for the chi-squared test.

    + +
    +
    +

    Value

    + + +

    A dataframe with the following components:

    +
    err.min
    +

    The +relative error, expressed as a fraction.

    +
    n.optim
    +

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

    +
    df
    +

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

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

    +

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

    Details

    - -

    This function is used internally by summary.mkinfit.

    -

    References

    - -

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

    +
    +
    +

    Details

    +

    This function is used internally by summary.mkinfit.

    +
    +
    +

    References

    +

    FOCUS (2006) “Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU -Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC +Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, -http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    - -

    Examples

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

    +
    + +
    +

    Examples

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

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

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

    Arguments

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

    A fit represented in an mkinfit object.

    obs_vars

    A character vector of names of the observed variables for +

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

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    + + +
    obs_vars
    +

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

    xlim

    plot range in x direction.

    xlab

    Label for the x axis.

    ylab

    Label for the y axis.

    maxy

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

    legend

    Should a legend be plotted?

    lpos

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

    col_obs

    Colors for the observed variables.

    pch_obs

    Symbols to be used for the observed variables.

    frame

    Should a frame be drawn around the plots?

    ...

    further arguments passed to plot.

    - -

    Value

    - -

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

    -

    See also

    +the model

    -

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

    -

    Author

    -

    Johannes Ranke

    +
    xlim
    +

    plot range in x direction.

    + + +
    xlab
    +

    Label for the x axis.

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    maxy
    +

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

    + + +
    legend
    +

    Should a legend be plotted?

    + + +
    lpos
    +

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

    + -

    Examples

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

    Colors for the observed variables.

    -
    + +
    pch_obs
    +

    Symbols to be used for the observed variables.

    + + +
    frame
    +

    Should a frame be drawn around the plots?

    + + +
    ...
    +

    further arguments passed to plot.

    + +
    +
    +

    Value

    + + +

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

    +
    +
    +

    See also

    +

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

    +
    +
    +

    Author

    +

    Johannes Ranke

    +
    + +
    +

    Examples

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

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

    +mkinfit.

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

    Arguments

    - - - - - - -
    object

    A fit represented in an mkinfit object.

    +
    +

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    -

    Value

    +
    +
    +

    Value

    + -

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

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

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

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

    +plot.mkinfit.

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

    Arguments

    +
    fit
    +

    an object of class mkinfit.

    -

    Arguments

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

    an object of class mkinfit.

    ...

    further arguments passed to plot.mkinfit.

    -

    Value

    +
    ...
    +

    further arguments passed to plot.mkinfit.

    -

    The function is called for its side effect.

    -

    Author

    +
    +
    +

    Value

    + +

    The function is called for its side effect.

    +
    +
    +

    Author

    Johannes Ranke

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

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

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

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

    Arguments

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

    A fit represented in an mkinfit object.

    obs_vars

    A character vector of names of the observed variables for +

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

    Arguments

    +
    object
    +

    A fit represented in an mkinfit object.

    + + +
    obs_vars
    +

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

    xlim

    plot range in x direction.

    standardized

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

    xlab

    Label for the x axis.

    ylab

    Label for the y axis.

    maxabs

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

    legend

    Should a legend be plotted?

    lpos

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

    col_obs

    Colors for the observed variables.

    pch_obs

    Symbols to be used for the observed variables.

    frame

    Should a frame be drawn around the plots?

    ...

    further arguments passed to plot.

    - -

    Value

    - -

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

    -

    See also

    +the model

    -

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

    -

    Author

    +
    xlim
    +

    plot range in x direction.

    + + +
    standardized
    +

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

    + + +
    xlab
    +

    Label for the x axis.

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    maxabs
    +

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

    + + +
    legend
    +

    Should a legend be plotted?

    + + +
    lpos
    +

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

    + + +
    col_obs
    +

    Colors for the observed variables.

    + + +
    pch_obs
    +

    Symbols to be used for the observed variables.

    + + +
    frame
    +

    Should a frame be drawn around the plots?

    + + +
    ...
    +

    further arguments passed to plot.

    + +
    +
    +

    Value

    + + +

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

    +
    +
    +

    See also

    +

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

    +
    +
    +

    Author

    Johannes Ranke and Katrin Lindenberger

    +
    -

    Examples

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

    Examples

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

    This function calls mkinfit on all combinations of models and +

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

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

    Arguments

    +
    models
    +

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

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

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

    -

    Arguments

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

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

    datasets

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

    cores

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

    cores
    +

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

    cluster

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

    ...

    Not used.

    x

    An mmkin object.

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

    -

    Value

    -

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

    -

    See also

    +
    cluster
    +

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

    -

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

    -

    Author

    -

    Johannes Ranke

    +
    ...
    +

    Not used.

    -

    Examples

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

    An mmkin object.

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

    Value

    + -
    +

    A two-dimensional array of mkinfit

    + + +

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

    +
    +
    +

    See also

    +

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

    +
    +
    +

    Author

    +

    Johannes Ranke

    +
    + +
    +

    Examples

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

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

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

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

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

    Arguments

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

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

    title

    Optional title of the dataset

    quiet

    Should the evaluation text be shown?

    ...

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

    x

    An nafta object.

    digits

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

    - -

    Source

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

    Source

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

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

    -

    Value

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

    +
    +
    +

    Arguments

    +
    ds
    +

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

    + + +
    title
    +

    Optional title of the dataset

    + -

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

    quiet
    +

    Should the evaluation text be shown?

    + + +
    ...
    +

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

    + + +
    x
    +

    An nafta object.

    + + +
    digits
    +

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

    + +
    +
    +

    Value

    + + +

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

    -

    Author

    - +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

    Arguments

    object

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

    +

    Value

    -

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

    + + +

    A function that can be used with nlme

    + + +

    A groupedData object

    See also

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

    Examples

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

    Site built with pkgdown 2.0.2.

    +

    Site built with pkgdown 2.0.6.

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

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

    Number of observations on which an mkinfit object was fitted

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

    Arguments

    +
    object
    +

    An mkinfit object

    -

    Arguments

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

    An mkinfit object

    ...

    For compatibility with the generic method

    -

    Value

    +
    ...
    +

    For compatibility with the generic method

    -

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

    +
    +
    +

    Value

    + + +

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

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

    Title of the plot

    +
    +

    Details

    +

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

    +

    References

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

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

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

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

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

    Arguments

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

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

    main

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

    legends

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

    resplot

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

    ylab

    Label for the y axis.

    standardized

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

    show_errmin

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

    errmin_var

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

    errmin_digits

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

    cex

    Passed to the plot functions and mtext.

    rel.height.middle

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

    ymax

    Maximum y axis value for plot.mkinfit.

    ...

    Further arguments passed to plot.mkinfit and -mkinresplot.

    - -

    Value

    - -

    The function is called for its side effect.

    -

    Details

    - -

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

    -

    Author

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

    Arguments

    +
    x
    +

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

    + + +
    main
    +

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

    + + +
    legends
    +

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

    + + +
    resplot
    +

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

    + + +
    ylab
    +

    Label for the y axis.

    + + +
    standardized
    +

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

    + + +
    show_errmin
    +

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

    + + +
    errmin_var
    +

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

    + +
    errmin_digits
    +

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

    + + +
    cex
    +

    Passed to the plot functions and mtext.

    + + +
    rel.height.middle
    +

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

    + + +
    ymax
    +

    Maximum y axis value for plot.mkinfit.

    + + +
    ...
    +

    Further arguments passed to plot.mkinfit and +mkinresplot.

    + +
    +
    +

    Value

    + + +

    The function is called for its side effect.

    +
    +
    +

    Details

    +

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

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

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

    Examples

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

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

    Arguments

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

    An object of class nafta.

    legend

    Should a legend be added?

    main

    Possibility to override the main title of the plot.

    ...

    Further arguments passed to plot.mmkin.

    - -

    Value

    - -

    The function is called for its side effect.

    -

    Details

    - -

    Calls plot.mmkin.

    -

    Author

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

    Arguments

    +
    x
    +

    An object of class nafta.

    + +
    legend
    +

    Should a legend be added?

    + + +
    main
    +

    Possibility to override the main title of the plot.

    + + +
    ...
    +

    Further arguments passed to plot.mmkin.

    + +
    +
    +

    Value

    + + +

    The function is called for its side effect.

    +
    +
    +

    Details

    +

    Calls plot.mmkin.

    +
    +
    +

    Author

    Johannes Ranke

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

    Extract residuals from an mkinfit model

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

    Arguments

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

    A mkinfit object

    standardized

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

    ...

    Not used

    - - -

    Examples

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

    Arguments

    +
    object
    +

    A mkinfit object

    + + +
    standardized
    +

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

    + + +
    ...
    +

    Not used

    + +
    + +
    +

    Examples

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

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

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

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

    Format

    +

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

    time
    +

    a numeric vector

    + +
    parent
    +

    a numeric vector

    +
    A1
    +

    a numeric vector

    -

    Format

    +
    B1
    +

    a numeric vector

    + +
    C1
    +

    a numeric vector

    + +
    A2
    +

    a numeric vector

    -

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

    -
    time

    a numeric vector

    -
    parent

    a numeric vector

    -
    A1

    a numeric vector

    -
    B1

    a numeric vector

    -
    C1

    a numeric vector

    -
    A2

    a numeric vector

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

    -

    References

    - +
    +
    +

    References

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

    +
    -

    Examples

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

    Examples

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

    -
    sigma_twocomp(y, sigma_low, rsd_high)
    - -

    Arguments

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

    The magnitude of the observed value

    sigma_low

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

    rsd_high

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

    - -

    Value

    - -

    The standard deviation of the response variable.

    -

    Details

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

    Arguments

    +
    y
    +

    The magnitude of the observed value

    + +
    sigma_low
    +

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

    + + +
    rsd_high
    +

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

    + +
    +
    +

    Value

    + + +

    The standard deviation of the response variable.

    +
    +
    +

    Details

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

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

    -

    References

    - +
    +
    +

    References

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

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

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

    +
    -

    Examples

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

    Examples

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

    Format

    +

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

    title
    +

    The name of the dataset, e.g. SFO_lin_a

    -

    Format

    +
    data
    +

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

    -

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

    -
    title

    The name of the dataset, e.g. SFO_lin_a

    -
    data

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

    -
    - -

    Source

    - +
    +
    +

    Source

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

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

    +
    -

    Examples

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

    Examples

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

    Format

    +

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

    title
    +

    The name of the dataset, e.g. UBA_2014_WS_river

    -

    Format

    +
    data
    +

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

    -

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

    -
    title

    The name of the dataset, e.g. UBA_2014_WS_river

    -
    data

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

    -
    - -

    Source

    - +
    +
    +

    Source

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

    +
    -

    Examples

    -
    # \dontrun{ - # This is a level P-II evaluation of the dataset according to the FOCUS kinetics - # guidance. Due to the strong correlation of the parameter estimates, the - # covariance matrix is not returned. Note that level P-II evaluations are - # generally considered deprecated due to the frequent occurrence of such - # large parameter correlations, among other reasons (e.g. the adequacy of the - # model). - m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"), - parent_s = mkinsub("SFO", "parent_w")) -
    #> Temporary DLL for differentials generated and loaded
    f_river <- mkinfit(m_ws, test_data_from_UBA_2014[[1]]$data, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    plot_sep(f_river) -
    - summary(f_river)$bpar -
    #> Warning: Could not calculate correlation; no covariance matrix
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_w_0 95.91998118 NA NA NA NA NA -#> k_parent_w 0.41145375 NA NA NA NA NA -#> k_parent_s 0.04663944 NA NA NA NA NA -#> f_parent_w_to_parent_s 0.12467894 NA NA NA NA NA -#> f_parent_s_to_parent_w 0.50000000 NA NA NA NA NA -#> sigma 3.13612618 NA NA NA NA NA
    mkinerrmin(f_river) -
    #> err.min n.optim df -#> All data 0.1090929 5 6 -#> parent_w 0.0817436 3 3 -#> parent_s 0.1619965 2 3
    - # This is the evaluation used for the validation of software packages - # in the expertise from 2014 - m_soil <- mkinmod(parent = mkinsub("SFO", c("M1", "M2")), - M1 = mkinsub("SFO", "M3"), - M2 = mkinsub("SFO", "M3"), - M3 = mkinsub("SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    - f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE) -
    #> Warning: Observations with value of zero were removed from the data
    plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright")) -
    summary(f_soil)$bpar -
    #> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 76.55425650 0.859186399 89.1008710 1.113861e-26 74.755959418 -#> k_parent 0.12081956 0.004601918 26.2541722 1.077359e-16 0.111561575 -#> k_M1 0.84258615 0.806160102 1.0451846 1.545268e-01 0.113779609 -#> k_M2 0.04210880 0.017083034 2.4649483 1.170188e-02 0.018013857 -#> k_M3 0.01122918 0.007245856 1.5497385 6.885052e-02 0.002909431 -#> f_parent_to_M1 0.32240200 0.240783943 1.3389680 9.819076e-02 NA -#> f_parent_to_M2 0.16099855 0.033691952 4.7785464 6.531136e-05 NA -#> f_M1_to_M3 0.27921507 0.269423780 1.0363416 1.565267e-01 0.022978205 -#> f_M2_to_M3 0.55641252 0.595119966 0.9349586 1.807707e-01 0.008002509 -#> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 -#> Upper -#> parent_0 78.35255358 -#> k_parent 0.13084582 -#> k_M1 6.23970702 -#> k_M2 0.09843260 -#> k_M3 0.04333992 -#> f_parent_to_M1 NA -#> f_parent_to_M2 NA -#> f_M1_to_M3 0.86450775 -#> f_M2_to_M3 0.99489895 -#> sigma 1.45337221
    mkinerrmin(f_soil) -
    #> err.min n.optim df -#> All data 0.09649963 9 20 -#> parent 0.04721283 2 6 -#> M1 0.26551208 2 5 -#> M2 0.20327575 2 5 -#> M3 0.05196550 3 4
    # } -
    +
    +

    Examples

    +
      # \dontrun{
    +  # This is a level P-II evaluation of the dataset according to the FOCUS kinetics
    +  # guidance. Due to the strong correlation of the parameter estimates, the
    +  # covariance matrix is not returned. Note that level P-II evaluations are
    +  # generally considered deprecated due to the frequent occurrence of such
    +  # large parameter correlations, among other reasons (e.g. the adequacy of the
    +  # model).
    +  m_ws <- mkinmod(parent_w = mkinsub("SFO", "parent_s"),
    +                  parent_s = mkinsub("SFO", "parent_w"))
    +#> Temporary DLL for differentials generated and loaded
    +  f_river <- mkinfit(m_ws, test_data_from_UBA_2014[[1]]$data, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +  plot_sep(f_river)
    +
    +
    +  summary(f_river)$bpar
    +#> Warning: Could not calculate correlation; no covariance matrix
    +#>                           Estimate se_notrans t value Pr(>t) Lower Upper
    +#> parent_w_0             95.91998118         NA      NA     NA    NA    NA
    +#> k_parent_w              0.41145375         NA      NA     NA    NA    NA
    +#> k_parent_s              0.04663944         NA      NA     NA    NA    NA
    +#> f_parent_w_to_parent_s  0.12467894         NA      NA     NA    NA    NA
    +#> f_parent_s_to_parent_w  0.50000000         NA      NA     NA    NA    NA
    +#> sigma                   3.13612618         NA      NA     NA    NA    NA
    +  mkinerrmin(f_river)
    +#>            err.min n.optim df
    +#> All data 0.1090929       5  6
    +#> parent_w 0.0817436       3  3
    +#> parent_s 0.1619965       2  3
    +
    +  # This is the evaluation used for the validation of software packages
    +  # in the expertise from 2014
    +  m_soil <- mkinmod(parent = mkinsub("SFO", c("M1", "M2")),
    +                    M1 = mkinsub("SFO", "M3"),
    +                    M2 = mkinsub("SFO", "M3"),
    +                    M3 = mkinsub("SFO"),
    +                    use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +  f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE)
    +#> Warning: Observations with value of zero were removed from the data
    +  plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright"))
    +
    +  summary(f_soil)$bpar
    +#>                   Estimate  se_notrans    t value       Pr(>t)        Lower
    +#> parent_0       76.55425650 0.859186399 89.1008710 1.113861e-26 74.755959418
    +#> k_parent        0.12081956 0.004601918 26.2541722 1.077359e-16  0.111561575
    +#> k_M1            0.84258615 0.806160102  1.0451846 1.545268e-01  0.113779609
    +#> k_M2            0.04210880 0.017083034  2.4649483 1.170188e-02  0.018013857
    +#> k_M3            0.01122918 0.007245856  1.5497385 6.885052e-02  0.002909431
    +#> f_parent_to_M1  0.32240200 0.240783943  1.3389680 9.819076e-02           NA
    +#> f_parent_to_M2  0.16099855 0.033691952  4.7785464 6.531136e-05           NA
    +#> f_M1_to_M3      0.27921507 0.269423780  1.0363416 1.565267e-01  0.022978205
    +#> f_M2_to_M3      0.55641252 0.595119966  0.9349586 1.807707e-01  0.008002509
    +#> sigma           1.14005399 0.149696423  7.6157731 1.727024e-07  0.826735778
    +#>                      Upper
    +#> parent_0       78.35255358
    +#> k_parent        0.13084582
    +#> k_M1            6.23970702
    +#> k_M2            0.09843260
    +#> k_M3            0.04333992
    +#> f_parent_to_M1          NA
    +#> f_parent_to_M2          NA
    +#> f_M1_to_M3      0.86450775
    +#> f_M2_to_M3      0.99489895
    +#> sigma           1.45337221
    +  mkinerrmin(f_soil)
    +#>             err.min n.optim df
    +#> All data 0.09649963       9 20
    +#> parent   0.04721283       2  6
    +#> M1       0.26551208       2  5
    +#> M2       0.20327575       2  5
    +#> M3       0.05196550       3  4
    +  # }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/tex_listing.html b/docs/dev/reference/tex_listing.html index c82138b7..03bd83f2 100644 --- a/docs/dev/reference/tex_listing.html +++ b/docs/dev/reference/tex_listing.html @@ -18,7 +18,7 @@ option results = "asis".'> mkin - 1.2.0 + 1.2.2 @@ -60,7 +60,10 @@ option results = "asis".'> Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • diff --git a/docs/dev/reference/transform_odeparms.html b/docs/dev/reference/transform_odeparms.html index 75d6a1f9..a7a01043 100644 --- a/docs/dev/reference/transform_odeparms.html +++ b/docs/dev/reference/transform_odeparms.html @@ -1,72 +1,17 @@ - - - - - - - -Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms • mkin - - - - - - - - - - + + - - - -
    -
    - -
    - -
    +
    @@ -154,205 +99,221 @@ restricted values to the full scale of real numbers. For kinetic rate constants and other parameters that can only take on positive values, a simple log transformation is used. For compositional parameters, such as the formations fractions that should always sum up to 1 and can not be negative, -the ilr transformation is used.

    +the ilr transformation is used.

    +
    + +
    +
    transform_odeparms(
    +  parms,
    +  mkinmod,
    +  transform_rates = TRUE,
    +  transform_fractions = TRUE
    +)
    +
    +backtransform_odeparms(
    +  transparms,
    +  mkinmod,
    +  transform_rates = TRUE,
    +  transform_fractions = TRUE
    +)
    -
    transform_odeparms(
    -  parms,
    -  mkinmod,
    -  transform_rates = TRUE,
    -  transform_fractions = TRUE
    -)
    +    
    +

    Arguments

    +
    parms
    +

    Parameters of kinetic models as used in the differential +equations.

    -backtransform_odeparms( - transparms, - mkinmod, - transform_rates = TRUE, - transform_fractions = TRUE -)
    -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    parms

    Parameters of kinetic models as used in the differential -equations.

    mkinmod

    The kinetic model of class mkinmod, containing +

    mkinmod
    +

    The kinetic model of class mkinmod, containing the names of the model variables that are needed for grouping the -formation fractions before ilr transformation, the parameter -names and the information if the pathway to sink is included in the model.

    transform_rates

    Boolean specifying if kinetic rate constants should +formation fractions before ilr transformation, the parameter +names and the information if the pathway to sink is included in the model.

    + + +
    transform_rates
    +

    Boolean specifying if kinetic rate constants should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the estimator. If TRUE, also alpha and beta parameters of the FOMC model are log-transformed, as well as k1 and k2 rate constants for the DFOP and HS -models and the break point tb of the HS model.

    transform_fractions

    Boolean specifying if formation fractions +models and the break point tb of the HS model.

    + + +
    transform_fractions
    +

    Boolean specifying if formation fractions constants should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the estimator. The default (TRUE) is to do transformations. The g parameter of the DFOP model is also seen as a fraction. If a single fraction is transformed (g parameter of DFOP or only a single target variable e.g. a single metabolite plus a pathway to sink), a -logistic transformation is used stats::qlogis(). In other cases, i.e. if +logistic transformation is used stats::qlogis(). In other cases, i.e. if two or more formation fractions need to be transformed whose sum cannot -exceed one, the ilr transformation is used.

    transparms

    Transformed parameters of kinetic models as used in the -fitting procedure.

    +exceed one, the ilr transformation is used.

    + -

    Value

    +
    transparms
    +

    Transformed parameters of kinetic models as used in the +fitting procedure.

    -

    A vector of transformed or backtransformed parameters

    -

    Details

    +
    +
    +

    Value

    + +

    A vector of transformed or backtransformed parameters

    +
    +
    +

    Details

    The transformation of sets of formation fractions is fragile, as it supposes the same ordering of the components in forward and backward transformation. -This is no problem for the internal use in mkinfit.

    -

    Author

    - +This is no problem for the internal use in mkinfit.

    +
    +
    +

    Author

    Johannes Ranke

    +
    -

    Examples

    -
    -SFO_SFO <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = TRUE), - m1 = list(type = "SFO"), use_of_ff = "min") -
    #> Temporary DLL for differentials generated and loaded
    -# Fit the model to the FOCUS example dataset D using defaults -FOCUS_D <- subset(FOCUS_2006_D, value != 0) # remove zero values to avoid warning -fit <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE) -fit.s <- summary(fit) -# Transformed and backtransformed parameters -print(fit.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.60 1.5702 96.40 102.79 -#> log_k_parent_sink -3.04 0.0763 -3.19 -2.88 -#> log_k_parent_m1 -2.98 0.0403 -3.06 -2.90 -#> log_k_m1_sink -5.25 0.1332 -5.52 -4.98 -#> sigma 3.13 0.3585 2.40 3.85
    print(fit.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04103 0.0560 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04678 0.0551 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
    -# \dontrun{ -# Compare to the version without transforming rate parameters (does not work -# with analytical solution, we get NA values for m1 in predictions) -fit.2 <- mkinfit(SFO_SFO, FOCUS_D, transform_rates = FALSE, - solution_type = "deSolve", quiet = TRUE) -fit.2.s <- summary(fit.2) -print(fit.2.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.59848 1.57022 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 2.39609 3.85e+00
    print(fit.2.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 1.03e+02 -#> k_parent_sink 0.04792 0.00365 13.11 6.13e-15 0.04049 5.54e-02 -#> k_parent_m1 0.05078 0.00205 24.80 3.27e-23 0.04661 5.49e-02 -#> k_m1_sink 0.00526 0.00070 7.51 6.16e-09 0.00384 6.69e-03 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.85e+00
    # } - -initials <- fit$start$value -names(initials) <- rownames(fit$start) -transformed <- fit$start_transformed$value -names(transformed) <- rownames(fit$start_transformed) -transform_odeparms(initials, SFO_SFO) -
    #> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 100.750000 -2.302585 -2.301586 -2.300587
    backtransform_odeparms(transformed, SFO_SFO) -
    #> parent_0 k_parent_sink k_parent_m1 k_m1_sink -#> 100.7500 0.1000 0.1001 0.1002
    -# \dontrun{ -# The case of formation fractions (this is now the default) -SFO_SFO.ff <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = TRUE), - m1 = list(type = "SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    -fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_D, quiet = TRUE) -fit.ff.s <- summary(fit.ff) -print(fit.ff.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 99.5985 1.5702 96.404 102.79 -#> log_k_parent -2.3157 0.0409 -2.399 -2.23 -#> log_k_m1 -5.2475 0.1332 -5.518 -4.98 -#> f_parent_qlogis 0.0579 0.0893 -0.124 0.24 -#> sigma 3.1255 0.3585 2.396 3.85
    print(fit.ff.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40383 102.7931 -#> k_parent 0.09870 0.00403 24.47 4.96e-23 0.09082 0.1073 -#> k_m1 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 -#> f_parent_to_m1 0.51448 0.02230 23.07 3.10e-22 0.46912 0.5596 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
    initials <- c("f_parent_to_m1" = 0.5) -transformed <- transform_odeparms(initials, SFO_SFO.ff) -backtransform_odeparms(transformed, SFO_SFO.ff) -
    #> f_parent_to_m1 -#> 0.5
    -# And without sink -SFO_SFO.ff.2 <- mkinmod( - parent = list(type = "SFO", to = "m1", sink = FALSE), - m1 = list(type = "SFO"), - use_of_ff = "max") -
    #> Temporary DLL for differentials generated and loaded
    - -fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_D, quiet = TRUE) -fit.ff.2.s <- summary(fit.ff.2) -print(fit.ff.2.s$par, 3) -
    #> Estimate Std. Error Lower Upper -#> parent_0 84.79 3.012 78.67 90.91 -#> log_k_parent -2.76 0.082 -2.92 -2.59 -#> log_k_m1 -4.21 0.123 -4.46 -3.96 -#> sigma 8.22 0.943 6.31 10.14
    print(fit.ff.2.s$bpar, 3) -
    #> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 84.7916 3.01203 28.15 1.92e-25 78.6704 90.913 -#> k_parent 0.0635 0.00521 12.19 2.91e-14 0.0538 0.075 -#> k_m1 0.0148 0.00182 8.13 8.81e-10 0.0115 0.019 -#> sigma 8.2229 0.94323 8.72 1.73e-10 6.3060 10.140
    # } - -
    +
    +

    Examples

    +
    
    +SFO_SFO <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = TRUE),
    +  m1 = list(type = "SFO"), use_of_ff = "min")
    +#> Temporary DLL for differentials generated and loaded
    +
    +# Fit the model to the FOCUS example dataset D using defaults
    +FOCUS_D <- subset(FOCUS_2006_D, value != 0) # remove zero values to avoid warning
    +fit <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE)
    +fit.s <- summary(fit)
    +# Transformed and backtransformed parameters
    +print(fit.s$par, 3)
    +#>                   Estimate Std. Error Lower  Upper
    +#> parent_0             99.60     1.5702 96.40 102.79
    +#> log_k_parent_sink    -3.04     0.0763 -3.19  -2.88
    +#> log_k_parent_m1      -2.98     0.0403 -3.06  -2.90
    +#> log_k_m1_sink        -5.25     0.1332 -5.52  -4.98
    +#> sigma                 3.13     0.3585  2.40   3.85
    +print(fit.s$bpar, 3)
    +#>               Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0      99.59848    1.57022   63.43 2.30e-36 96.40384 102.7931
    +#> k_parent_sink  0.04792    0.00365   13.11 6.13e-15  0.04103   0.0560
    +#> k_parent_m1    0.05078    0.00205   24.80 3.27e-23  0.04678   0.0551
    +#> k_m1_sink      0.00526    0.00070    7.51 6.16e-09  0.00401   0.0069
    +#> sigma          3.12550    0.35852    8.72 2.24e-10  2.39609   3.8549
    +
    +# \dontrun{
    +# Compare to the version without transforming rate parameters (does not work
    +# with analytical solution, we get NA values for m1 in predictions)
    +fit.2 <- mkinfit(SFO_SFO, FOCUS_D, transform_rates = FALSE,
    +  solution_type = "deSolve", quiet = TRUE)
    +fit.2.s <- summary(fit.2)
    +print(fit.2.s$par, 3)
    +#>               Estimate Std. Error    Lower    Upper
    +#> parent_0      99.59848    1.57022 96.40384 1.03e+02
    +#> k_parent_sink  0.04792    0.00365  0.04049 5.54e-02
    +#> k_parent_m1    0.05078    0.00205  0.04661 5.49e-02
    +#> k_m1_sink      0.00526    0.00070  0.00384 6.69e-03
    +#> sigma          3.12550    0.35852  2.39609 3.85e+00
    +print(fit.2.s$bpar, 3)
    +#>               Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0      99.59848    1.57022   63.43 2.30e-36 96.40384 1.03e+02
    +#> k_parent_sink  0.04792    0.00365   13.11 6.13e-15  0.04049 5.54e-02
    +#> k_parent_m1    0.05078    0.00205   24.80 3.27e-23  0.04661 5.49e-02
    +#> k_m1_sink      0.00526    0.00070    7.51 6.16e-09  0.00384 6.69e-03
    +#> sigma          3.12550    0.35852    8.72 2.24e-10  2.39609 3.85e+00
    +# }
    +
    +initials <- fit$start$value
    +names(initials) <- rownames(fit$start)
    +transformed <- fit$start_transformed$value
    +names(transformed) <- rownames(fit$start_transformed)
    +transform_odeparms(initials, SFO_SFO)
    +#>          parent_0 log_k_parent_sink   log_k_parent_m1     log_k_m1_sink 
    +#>        100.750000         -2.302585         -2.301586         -2.300587 
    +backtransform_odeparms(transformed, SFO_SFO)
    +#>      parent_0 k_parent_sink   k_parent_m1     k_m1_sink 
    +#>      100.7500        0.1000        0.1001        0.1002 
    +
    +# \dontrun{
    +# The case of formation fractions (this is now the default)
    +SFO_SFO.ff <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = TRUE),
    +  m1 = list(type = "SFO"),
    +  use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_D, quiet = TRUE)
    +fit.ff.s <- summary(fit.ff)
    +print(fit.ff.s$par, 3)
    +#>                 Estimate Std. Error  Lower  Upper
    +#> parent_0         99.5985     1.5702 96.404 102.79
    +#> log_k_parent     -2.3157     0.0409 -2.399  -2.23
    +#> log_k_m1         -5.2475     0.1332 -5.518  -4.98
    +#> f_parent_qlogis   0.0579     0.0893 -0.124   0.24
    +#> sigma             3.1255     0.3585  2.396   3.85
    +print(fit.ff.s$bpar, 3)
    +#>                Estimate se_notrans t value   Pr(>t)    Lower    Upper
    +#> parent_0       99.59848    1.57022   63.43 2.30e-36 96.40383 102.7931
    +#> k_parent        0.09870    0.00403   24.47 4.96e-23  0.09082   0.1073
    +#> k_m1            0.00526    0.00070    7.51 6.16e-09  0.00401   0.0069
    +#> f_parent_to_m1  0.51448    0.02230   23.07 3.10e-22  0.46912   0.5596
    +#> sigma           3.12550    0.35852    8.72 2.24e-10  2.39609   3.8549
    +initials <- c("f_parent_to_m1" = 0.5)
    +transformed <- transform_odeparms(initials, SFO_SFO.ff)
    +backtransform_odeparms(transformed, SFO_SFO.ff)
    +#> f_parent_to_m1 
    +#>            0.5 
    +
    +# And without sink
    +SFO_SFO.ff.2 <- mkinmod(
    +  parent = list(type = "SFO", to = "m1", sink = FALSE),
    +  m1 = list(type = "SFO"),
    +  use_of_ff = "max")
    +#> Temporary DLL for differentials generated and loaded
    +
    +
    +fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_D, quiet = TRUE)
    +fit.ff.2.s <- summary(fit.ff.2)
    +print(fit.ff.2.s$par, 3)
    +#>              Estimate Std. Error Lower Upper
    +#> parent_0        84.79      3.012 78.67 90.91
    +#> log_k_parent    -2.76      0.082 -2.92 -2.59
    +#> log_k_m1        -4.21      0.123 -4.46 -3.96
    +#> sigma            8.22      0.943  6.31 10.14
    +print(fit.ff.2.s$bpar, 3)
    +#>          Estimate se_notrans t value   Pr(>t)   Lower  Upper
    +#> parent_0  84.7916    3.01203   28.15 1.92e-25 78.6704 90.913
    +#> k_parent   0.0635    0.00521   12.19 2.91e-14  0.0538  0.075
    +#> k_m1       0.0148    0.00182    8.13 8.81e-10  0.0115  0.019
    +#> sigma      8.2229    0.94323    8.72 1.73e-10  6.3060 10.140
    +# }
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/reference/update.mkinfit-1.png b/docs/dev/reference/update.mkinfit-1.png index df8473c1..12fe1f5b 100644 Binary files a/docs/dev/reference/update.mkinfit-1.png and b/docs/dev/reference/update.mkinfit-1.png differ diff --git a/docs/dev/reference/update.mkinfit-2.png b/docs/dev/reference/update.mkinfit-2.png index 13c99b44..21817f94 100644 Binary files a/docs/dev/reference/update.mkinfit-2.png and b/docs/dev/reference/update.mkinfit-2.png differ diff --git a/docs/dev/reference/update.mkinfit.html b/docs/dev/reference/update.mkinfit.html index 83f45028..cf611716 100644 --- a/docs/dev/reference/update.mkinfit.html +++ b/docs/dev/reference/update.mkinfit.html @@ -1,70 +1,15 @@ - - - - - - - -Update an mkinfit model with different arguments — update.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Update an mkinfit model with different arguments — update.mkinfit • mkin - - - - - - - - - - - + + - - -
    -
    - -
    - -
    +
    @@ -153,66 +98,67 @@ updated fit. Values specified as 'parms.ini' and/or 'state.ini' will override these starting values.

    -
    # S3 method for mkinfit
    -update(object, ..., evaluate = TRUE)
    - -

    Arguments

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

    An mkinfit object to be updated

    ...

    Arguments to mkinfit that should replace +

    +
    # S3 method for mkinfit
    +update(object, ..., evaluate = TRUE)
    +
    + +
    +

    Arguments

    +
    object
    +

    An mkinfit object to be updated

    + + +
    ...
    +

    Arguments to mkinfit that should replace the arguments from the original call. Arguments set to NULL will -remove arguments given in the original call

    evaluate

    Should the call be evaluated or returned as a call

    - - -

    Examples

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

    + + +
    evaluate
    +

    Should the call be evaluated or returned as a call

    + +
    + +
    +

    Examples

    +
    # \dontrun{
    +fit <- mkinfit("SFO", subset(FOCUS_2006_D, value != 0), quiet = TRUE)
    +parms(fit)
    +#>    parent_0    k_parent       sigma 
    +#> 99.44423885  0.09793574  3.39632469 
    +plot_err(fit)
    +
    +fit_2 <- update(fit, error_model = "tc")
    +parms(fit_2)
    +#>     parent_0     k_parent    sigma_low     rsd_high 
    +#> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02 
    +plot_err(fit_2)
    +
    +# }
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/dev/sitemap.xml b/docs/dev/sitemap.xml index 04cf230e..06f56c5d 100644 --- a/docs/dev/sitemap.xml +++ b/docs/dev/sitemap.xml @@ -120,6 +120,9 @@ https://pkgdown.jrwb.de/mkin/reference/dimethenamid_2018.html + + https://pkgdown.jrwb.de/mkin/reference/ds_mixed.html + https://pkgdown.jrwb.de/mkin/reference/endpoints.html -- cgit v1.2.1