From 7e8d788d298b8e1492fd8f62d88456e99e0f5992 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 4 Jul 2019 08:10:33 +0200 Subject: Address failures of CRAN checks, improve NEWS Static documentation rebuilt by pkgdown --- DESCRIPTION | 2 +- NEWS.md | 6 +++-- docs/articles/FOCUS_D.html | 8 +++--- docs/articles/FOCUS_L.html | 40 ++++++++++++++-------------- docs/articles/mkin.html | 2 +- docs/articles/twa.html | 2 +- docs/articles/web_only/FOCUS_Z.html | 2 +- docs/articles/web_only/NAFTA_examples.html | 2 +- docs/articles/web_only/benchmarks.html | 24 ++++++++--------- docs/articles/web_only/compiled_models.html | 12 ++++----- docs/news/index.html | 9 ++++--- docs/reference/mkinfit.html | 28 +++++++++---------- docs/reference/mkinmod.html | 2 +- docs/reference/mkinpredict.html | 4 +-- docs/reference/mmkin.html | 4 +-- docs/reference/summary.mkinfit.html | 4 +-- tests/testthat/test_error_models.R | 13 +++++---- tests/testthat/test_nafta.R | 8 ++++-- vignettes/mkin_benchmarks.rda | Bin 877 -> 875 bytes 19 files changed, 91 insertions(+), 81 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index eab410b5..7af9ef7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data Version: 0.9.49.5 -Date: 2019-07-03 +Date: 2019-07-04 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de", comment = c(ORCID = "0000-0003-4371-6538")), diff --git a/NEWS.md b/NEWS.md index 37964fd9..853f6b56 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# mkin 0.9.49.5 (2019-07-03) +# mkin 0.9.49.5 (2019-07-04) - Several algorithms for minimization of the negative log-likelihood for non-constant error models (two-component and variance by variable). In the case the error model is constant variance, least squares is used as this is more stable. The default algorithm 'd_3' tries direct minimization and a three-step procedure, and returns the model with the highest likelihood. @@ -14,7 +14,7 @@ - Add a simple benchmark vignette to document the impact on performance. -- The code for manual weighting was removed. This functionality might get added again at a later time. +- The code for manual weighting was removed. This functionality might get added again at a later time. For the time being, please use an earlier version, e.g. 0.9.48.1 if you want to do manual weighting. - The fitting time reported in the summary now includes the time used for calculation of the hessians @@ -22,6 +22,8 @@ - Fix an error in the FOCUS chi2 error level calculations that occurred if parameters were specified in parms.ini that were not in the model. A warning was already issued, but when fitting in parallel via mmkin this could go unnoticed. +- Add example datasets obtained from risk assessment reports published by the European Food Safety Agency. + # mkin 0.9.48.1 (2019-03-04) - Add the function 'logLik.mkinfit' which makes it possible to calculate an AIC for mkinfit objects diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index 88a3fa6a..ed41e555 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -88,7 +88,7 @@

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2019-07-03

+

2019-07-04

@@ -168,8 +168,8 @@
summary(fit)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:00 2019 
-## Date of summary: Wed Jul  3 16:39:00 2019 
+## Date of fit:     Thu Jul  4 08:04:23 2019 
+## Date of summary: Thu Jul  4 08:04:24 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -177,7 +177,7 @@
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted using 389 model solutions performed in 0.977 s
+## Fitted using 389 model solutions performed in 0.982 s
 ## 
 ## Error model: Constant variance 
 ## 
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 1b54252f..0060bd69 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -88,7 +88,7 @@
       

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2019-07-03

+

2019-07-04

@@ -114,15 +114,15 @@ summary(m.L1.SFO)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:02 2019 
-## Date of summary: Wed Jul  3 16:39:02 2019 
+## Date of fit:     Thu Jul  4 08:04:26 2019 
+## Date of summary: Thu Jul  4 08:04:26 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 133 model solutions performed in 0.279 s
+## Fitted using 133 model solutions performed in 0.278 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -216,8 +216,8 @@
 ## finite result is doubtful
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:04 2019 
-## Date of summary: Wed Jul  3 16:39:04 2019 
+## Date of fit:     Thu Jul  4 08:04:28 2019 
+## Date of summary: Thu Jul  4 08:04:28 2019 
 ## 
 ## 
 ## Warning: Optimisation did not converge:
@@ -229,7 +229,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 899 model solutions performed in 1.874 s
+## Fitted using 899 model solutions performed in 1.876 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -321,15 +321,15 @@
 
summary(m.L2.FOMC, data = FALSE)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:05 2019 
-## Date of summary: Wed Jul  3 16:39:05 2019 
+## Date of fit:     Thu Jul  4 08:04:29 2019 
+## Date of summary: Thu Jul  4 08:04:29 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 239 model solutions performed in 0.485 s
+## Fitted using 239 model solutions performed in 0.486 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -397,8 +397,8 @@
 
summary(m.L2.DFOP, data = FALSE)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:07 2019 
-## Date of summary: Wed Jul  3 16:39:07 2019 
+## Date of fit:     Thu Jul  4 08:04:30 2019 
+## Date of summary: Thu Jul  4 08:04:30 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -497,8 +497,8 @@
 
summary(mm.L3[["DFOP", 1]])
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:08 2019 
-## Date of summary: Wed Jul  3 16:39:09 2019 
+## Date of fit:     Thu Jul  4 08:04:32 2019 
+## Date of summary: Thu Jul  4 08:04:32 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -507,7 +507,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 373 model solutions performed in 0.772 s
+## Fitted using 373 model solutions performed in 0.773 s
 ## 
 ## Error model: Constant variance 
 ## 
@@ -603,8 +603,8 @@
 
summary(mm.L4[["SFO", 1]], data = FALSE)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:09 2019 
-## Date of summary: Wed Jul  3 16:39:10 2019 
+## Date of fit:     Thu Jul  4 08:04:33 2019 
+## Date of summary: Thu Jul  4 08:04:33 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
@@ -668,15 +668,15 @@
 
summary(mm.L4[["FOMC", 1]], data = FALSE)
## mkin version used for fitting:    0.9.49.5 
 ## R version used for fitting:       3.6.0 
-## Date of fit:     Wed Jul  3 16:39:10 2019 
-## Date of summary: Wed Jul  3 16:39:10 2019 
+## Date of fit:     Thu Jul  4 08:04:33 2019 
+## Date of summary: Thu Jul  4 08:04:33 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 224 model solutions performed in 0.452 s
+## Fitted using 224 model solutions performed in 0.453 s
 ## 
 ## Error model: Constant variance 
 ## 
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
index df694259..8ad4a8e9 100644
--- a/docs/articles/mkin.html
+++ b/docs/articles/mkin.html
@@ -88,7 +88,7 @@
       

Introduction to mkin

Johannes Ranke

-

2019-07-03

+

2019-07-04

diff --git a/docs/articles/twa.html b/docs/articles/twa.html index 34b85796..98e5efdf 100644 --- a/docs/articles/twa.html +++ b/docs/articles/twa.html @@ -88,7 +88,7 @@

Calculation of time weighted average concentrations with mkin

Johannes Ranke

-

2019-07-03

+

2019-07-04

diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html index b82e1e01..4a856b71 100644 --- a/docs/articles/web_only/FOCUS_Z.html +++ b/docs/articles/web_only/FOCUS_Z.html @@ -88,7 +88,7 @@

Example evaluation of FOCUS dataset Z

Johannes Ranke

-

2019-07-03

+

2019-07-04

diff --git a/docs/articles/web_only/NAFTA_examples.html b/docs/articles/web_only/NAFTA_examples.html index c1922b64..3f6ff8b9 100644 --- a/docs/articles/web_only/NAFTA_examples.html +++ b/docs/articles/web_only/NAFTA_examples.html @@ -88,7 +88,7 @@

Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance

Johannes Ranke

-

2019-07-03

+

2019-07-04

diff --git a/docs/articles/web_only/benchmarks.html b/docs/articles/web_only/benchmarks.html index c68db93b..005834cc 100644 --- a/docs/articles/web_only/benchmarks.html +++ b/docs/articles/web_only/benchmarks.html @@ -88,7 +88,7 @@

Benchmark timings for mkin on various systems

Johannes Ranke

-

2019-07-03

+

2019-07-04

@@ -202,77 +202,77 @@ ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 7.064 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.296 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.936 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 5.820 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 5.843 ## t2 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 11.019 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 22.889 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 12.558 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 21.239 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 20.545 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 35.917 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 35.863 ## t3 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 3.764 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.649 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.786 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 4.510 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.446 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.415 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.417 ## t4 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 14.347 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 13.789 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 8.461 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 13.805 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 15.335 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 30.588 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 30.484 ## t5 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 9.495 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 6.395 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 5.675 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.386 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 6.002 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.317 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.307 ## t6 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 2.623 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 2.542 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 2.723 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 2.643 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 2.635 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 2.556 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 2.538 ## t7 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 4.587 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.128 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.478 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 4.374 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.259 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.213 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 4.196 ## t8 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 7.525 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 4.632 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 4.862 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.02 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 4.737 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.851 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.853 ## t9 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 16.621 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 8.171 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 7.618 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 11.124 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 7.763 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 15.645 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 15.643 ## t10 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 8.576 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 3.676 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 3.579 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 5.388 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 3.427 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.734 +## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 7.733 ## t11 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.48.1 31.267 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.1 5.636 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.2 5.574 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.3 7.365 ## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.4 5.626 -## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.489
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.5 10.511
save(mkin_benchmarks, file = "~/git/mkin/vignettes/mkin_benchmarks.rda")
diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html index b30488a0..3fc54cfa 100644 --- a/docs/articles/web_only/compiled_models.html +++ b/docs/articles/web_only/compiled_models.html @@ -88,7 +88,7 @@

Performance benefit by using compiled model definitions in mkin

Johannes Ranke

-

2019-07-03

+

2019-07-04

@@ -163,9 +163,9 @@ ## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve", quiet ## = TRUE): Observations with value of zero were removed from the data
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   3.043    1.000     3.042        0
-## 1 deSolve, not compiled            3  28.630    9.408    28.616        0
-## 2      Eigenvalue based            3   4.291    1.410     4.289        0
+## 3     deSolve, compiled            3   3.061    1.000     3.059        0
+## 1 deSolve, not compiled            3  28.502    9.311    28.487        0
+## 2      Eigenvalue based            3   4.321    1.412     4.318        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
@@ -214,8 +214,8 @@
 ## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
 ## value of zero were removed from the data
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   4.800    1.000     4.795    0.002
-## 1 deSolve, not compiled            3  53.371   11.119    53.346    0.000
+## 2     deSolve, compiled            3   4.818    1.000     4.814        0
+## 1 deSolve, not compiled            3  53.275   11.057    53.249        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
diff --git a/docs/news/index.html b/docs/news/index.html index f8504768..0b82cbcc 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -122,9 +122,9 @@ -
+

-mkin 0.9.49.5 (2019-07-03) Unreleased +mkin 0.9.49.5 (2019-07-04) Unreleased

  • Several algorithms for minimization of the negative log-likelihood for non-constant error models (two-component and variance by variable). In the case the error model is constant variance, least squares is used as this is more stable. The default algorithm ‘d_3’ tries direct minimization and a three-step procedure, and returns the model with the highest likelihood.

  • @@ -134,10 +134,11 @@
  • Remove dependency on FME, only use nlminb for optimisation (‘Port’ algorithm). I cannot remember cases where one of the other optimisation algorithms was preferable, except that I sometime used Levenberg-Marquardt for speed in cases where I did not expect to get trapped in a local minimum.

  • Use the numDeriv package to calculate hessians. This results in slightly different confidence intervals, takes a bit longer, but is apparently more robust

  • Add a simple benchmark vignette to document the impact on performance.

  • -
  • The code for manual weighting was removed. This functionality might get added again at a later time.

  • +
  • The code for manual weighting was removed. This functionality might get added again at a later time. For the time being, please use an earlier version, e.g. 0.9.48.1 if you want to do manual weighting.

  • The fitting time reported in the summary now includes the time used for calculation of the hessians

  • Adapt tests

  • Fix an error in the FOCUS chi2 error level calculations that occurred if parameters were specified in parms.ini that were not in the model. A warning was already issued, but when fitting in parallel via mmkin this could go unnoticed.

  • +
  • Add example datasets obtained from risk assessment reports published by the European Food Safety Agency.

@@ -698,7 +699,7 @@

Contents

#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed Jul 3 16:36:58 2019 -#> Date of summary: Wed Jul 3 16:36:58 2019 +#> Date of fit: Thu Jul 4 08:02:21 2019 +#> Date of summary: Thu Jul 4 08:02:21 2019 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 222 model solutions performed in 0.46 s +#> Fitted using 222 model solutions performed in 0.464 s #> #> Error model: Constant variance #> @@ -481,7 +481,7 @@ Per default, parameters in the kinetic models are internally transformed in m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> User System verstrichen -#> 1.497 0.000 1.499
coef(fit)
#> NULL
#> $ff +#> 1.507 0.004 1.511
coef(fit)
#> NULL
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -553,7 +553,7 @@ Per default, parameters in the kinetic models are internally transformed in #> Sum of squared residuals at call 126: 371.2134 #> Sum of squared residuals at call 135: 371.2134 #> Negative log-likelihood at call 145: 97.22429
#> Optimisation successfully terminated.
#> User System verstrichen -#> 1.079 0.000 1.079
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff +#> 1.078 0.000 1.078
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -585,8 +585,8 @@ Per default, parameters in the kinetic models are internally transformed in SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.noweight)
#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed Jul 3 16:37:14 2019 -#> Date of summary: Wed Jul 3 16:37:14 2019 +#> Date of fit: Thu Jul 4 08:02:37 2019 +#> Date of summary: Thu Jul 4 08:02:37 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -594,7 +594,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 421 model solutions performed in 1.107 s +#> Fitted using 421 model solutions performed in 1.096 s #> #> Error model: Constant variance #> @@ -704,8 +704,8 @@ Per default, parameters in the kinetic models are internally transformed in #> 120 m1 25.15 28.78984 -3.640e+00 #> 120 m1 33.31 28.78984 4.520e+00
f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.obs)
#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed Jul 3 16:37:17 2019 -#> Date of summary: Wed Jul 3 16:37:17 2019 +#> Date of fit: Thu Jul 4 08:02:40 2019 +#> Date of summary: Thu Jul 4 08:02:40 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -713,7 +713,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 979 model solutions performed in 2.612 s +#> Fitted using 979 model solutions performed in 2.574 s #> #> Error model: Variance unique to each observed variable #> @@ -836,8 +836,8 @@ Per default, parameters in the kinetic models are internally transformed in #> 120 m1 25.15 28.80429 -3.654e+00 #> 120 m1 33.31 28.80429 4.506e+00
f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.tc)
#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed Jul 3 16:37:26 2019 -#> Date of summary: Wed Jul 3 16:37:26 2019 +#> Date of fit: Thu Jul 4 08:02:49 2019 +#> Date of summary: Thu Jul 4 08:02:49 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -845,7 +845,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 2289 model solutions performed in 9.522 s +#> Fitted using 2289 model solutions performed in 9.379 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index f1793541..39fe631b 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -234,7 +234,7 @@ For the definition of model types and their parameters, the equations given SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file24f24fd75f75.c 2> file24f24fd75f75.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file6e9c38dae9ed.c 2> file6e9c38dae9ed.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 9c4263b6..ef847245 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -328,7 +328,7 @@ c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "eigen")[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.003 0.000 0.004
system.time( +#> 0.004 0.000 0.003
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve")[201,]))
#> time parent m1 @@ -338,7 +338,7 @@ c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.022 0.000 0.022
+#> 0.022 0.000 0.021
# Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C)
#> Ordinary least squares optimisation
#> Sum of squared residuals at call 1: 552.5739 #> Sum of squared residuals at call 3: 552.5739 diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 7a34ac7d..38c46b6e 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -194,8 +194,8 @@ time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) time_default
#> User System verstrichen -#> 0.036 0.048 5.130
time_1
#> User System verstrichen -#> 19.222 0.000 19.233
+#> 0.055 0.032 5.069
time_1
#> User System verstrichen +#> 19.260 0.000 19.271
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340481 0.2659519 0.7505684 0.2494316 diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 4f2c9ecb..c4d2653d 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -211,8 +211,8 @@

Examples

summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.49.5 #> R version used for fitting: 3.6.0 -#> Date of fit: Wed Jul 3 16:38:45 2019 -#> Date of summary: Wed Jul 3 16:38:45 2019 +#> Date of fit: Thu Jul 4 08:04:08 2019 +#> Date of summary: Thu Jul 4 08:04:08 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent diff --git a/tests/testthat/test_error_models.R b/tests/testthat/test_error_models.R index 33e44bf8..fbae6286 100644 --- a/tests/testthat/test_error_models.R +++ b/tests/testthat/test_error_models.R @@ -91,14 +91,17 @@ test_that("Reweighting method 'tc' produces reasonable variance estimates", { sdfunc = function(x) sigma_twocomp(x, 0.5, 0.07), n = 1, reps = 100, digits = 5, LOD = -Inf, seed = 123456) - # Per default (on my box) use all cores minus one - n_cores <- parallel::detectCores() - 1 + # Per default (on my box where I set NOT_CRAN) use all cores minus one + if (identical(Sys.getenv("NOT_CRAN"), "true")) { + n_cores <- parallel::detectCores() - 1 + } else { + n_cores <- 1 + } - # We are only allowed one core on travis + # We are only allowed one core on travis, but they also set NOT_CRAN=true if (Sys.getenv("TRAVIS") != "") n_cores = 1 - # Also on Windows we would need to make a cluster first, - # and I do not know how this would work on winbuilder or CRAN, so + # On Windows we would need to make a cluster first if (Sys.info()["sysname"] == "Windows") n_cores = 1 # Unweighted fits diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R index 096287aa..8cb1895b 100644 --- a/tests/testthat/test_nafta.R +++ b/tests/testthat/test_nafta.R @@ -39,7 +39,9 @@ test_that("Test data from Appendix B are correctly evaluated", { expect_known_output(print(res), "NAFTA_SOP_Appendix_B.txt") plot_nafta <- function() plot(res) - vdiffr::expect_doppelganger("NAFTA SOP Appendix B", plot_nafta) + if(requireNamespace("vdiffr", quietly = TRUE)) { + vdiffr::expect_doppelganger("NAFTA SOP Appendix B", plot_nafta) + } }) test_that("Test data from Appendix D are correctly evaluated", { @@ -61,5 +63,7 @@ test_that("Test data from Appendix D are correctly evaluated", { expect_known_output(print(res), "NAFTA_SOP_Appendix_D.txt") plot_nafta <- function() plot(res) - vdiffr::expect_doppelganger("Plot NAFTA analysis", plot_nafta) + if(requireNamespace("vdiffr", quietly = TRUE)) { + vdiffr::expect_doppelganger("Plot NAFTA analysis", plot_nafta) + } }) diff --git a/vignettes/mkin_benchmarks.rda b/vignettes/mkin_benchmarks.rda index 4828db0d..521ccb7d 100644 Binary files a/vignettes/mkin_benchmarks.rda and b/vignettes/mkin_benchmarks.rda differ -- cgit v1.2.1