From d852e9e000f57f280deb84611ae1af58daa883cc Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 18 Nov 2016 23:08:45 +0100 Subject: Fix links in README, configure navbar, rebuild docs --- vignettes/FOCUS_D.html | 25 +++++++++++-------- vignettes/FOCUS_L.html | 54 ++++++++++++++++++++--------------------- vignettes/FOCUS_Z.pdf | Bin 239558 -> 239561 bytes vignettes/compiled_models.html | 43 ++++++++++++++++---------------- 4 files changed, 64 insertions(+), 58 deletions(-) (limited to 'vignettes') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index fcf9d46d..40edec94 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -11,7 +11,7 @@ - + Example evaluation of FOCUS Example Dataset D @@ -21,7 +21,7 @@ - + @@ -119,14 +119,19 @@ $(document).ready(function () {

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2016-11-17

+

2016-11-18

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 a 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")
-print(FOCUS_2006_D)
+
library("mkin")
+
## Loading required package: minpack.lm
+
## Loading required package: rootSolve
+
## Loading required package: inline
+
## Loading required package: methods
+
## Loading required package: parallel
+
print(FOCUS_2006_D)
##      name time  value
 ## 1  parent    0  99.46
 ## 2  parent    0 102.04
@@ -193,16 +198,16 @@ print(FOCUS_2006_D)
summary(fit)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 17:26:27 2016 
-## Date of summary: Thu Nov 17 17:26:28 2016 
+## Date of fit:     Fri Nov 18 22:48:53 2016 
+## Date of summary: Fri Nov 18 22:48:54 2016 
 ## 
 ## Equations:
-## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
-## d_m1 = + k_parent_m1 * parent - k_m1_sink * m1
+## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
+## d_m1/dt = + k_parent_m1 * parent - k_m1_sink * m1
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted with method Port using 153 model solutions performed in 0.655 s
+## Fitted with method Port using 153 model solutions performed in 0.64 s
 ## 
 ## Weighting: none
 ## 
diff --git a/vignettes/FOCUS_L.html b/vignettes/FOCUS_L.html
index 0d96fd5f..315f3d98 100644
--- a/vignettes/FOCUS_L.html
+++ b/vignettes/FOCUS_L.html
@@ -11,7 +11,7 @@
 
 
 
-
+
 
 Example evaluation of FOCUS Laboratory Data L1 to L3
 
@@ -24,7 +24,7 @@
 
 
 
-
+
 
 
 
@@ -187,8 +187,9 @@ div.tocify {
 }
 
 .tocify-subheader .tocify-item {
-  font-size: 0.9em;
-  padding-left: 5px;
+  font-size: 0.90em;
+  padding-left: 25px;
+  text-indent: 0;
 }
 
 .tocify .list-group-item {
@@ -200,7 +201,6 @@ div.tocify {
 }
 .tocify-subheader .tocify-item {
   font-size: 0.95em;
-  padding-left: 10px;
 }
 
 
@@ -223,7 +223,7 @@ div.tocify {
 
 

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2016-11-17

+

2016-11-18

@@ -244,15 +244,15 @@ FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)
summary(m.L1.SFO)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:25 2016 
-## Date of summary: Thu Nov 17 18:44:25 2016 
+## Date of fit:     Fri Nov 18 22:48:55 2016 
+## Date of summary: Fri Nov 18 22:48:55 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 37 model solutions performed in 0.088 s
+## Fitted with method Port using 37 model solutions performed in 0.087 s
 ## 
 ## Weighting: none
 ## 
@@ -337,8 +337,8 @@ summary(m.L1.SFO)
summary(m.L1.FOMC, data = FALSE)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:26 2016 
-## Date of summary: Thu Nov 17 18:44:26 2016 
+## Date of fit:     Fri Nov 18 22:48:55 2016 
+## Date of summary: Fri Nov 18 22:48:55 2016 
 ## 
 ## 
 ## Warning: Optimisation by method Port did not converge.
@@ -350,7 +350,7 @@ summary(m.L1.SFO)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 188 model solutions performed in 0.431 s +## Fitted with method Port using 188 model solutions performed in 0.413 s ## ## Weighting: none ## @@ -434,15 +434,15 @@ plot(m.L2.FOMC, show_residuals = TRUE,
summary(m.L2.FOMC, data = FALSE)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:26 2016 
-## Date of summary: Thu Nov 17 18:44:26 2016 
+## Date of fit:     Fri Nov 18 22:48:56 2016 
+## Date of summary: Fri Nov 18 22:48:56 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 81 model solutions performed in 0.18 s
+## Fitted with method Port using 81 model solutions performed in 0.177 s
 ## 
 ## Weighting: none
 ## 
@@ -504,8 +504,8 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
 
summary(m.L2.DFOP, data = FALSE)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:27 2016 
-## Date of summary: Thu Nov 17 18:44:27 2016 
+## Date of fit:     Fri Nov 18 22:48:57 2016 
+## Date of summary: Fri Nov 18 22:48:57 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -514,7 +514,7 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 336 model solutions performed in 0.768 s
+## Fitted with method Port using 336 model solutions performed in 0.747 s
 ## 
 ## Weighting: none
 ## 
@@ -593,8 +593,8 @@ plot(mm.L3)
summary(mm.L3[["DFOP", 1]])
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:28 2016 
-## Date of summary: Thu Nov 17 18:44:28 2016 
+## Date of fit:     Fri Nov 18 22:48:57 2016 
+## Date of summary: Fri Nov 18 22:48:57 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -603,7 +603,7 @@ plot(mm.L3)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 137 model solutions performed in 0.313 s +## Fitted with method Port using 137 model solutions performed in 0.307 s ## ## Weighting: none ## @@ -693,15 +693,15 @@ plot(mm.L4)
summary(mm.L4[["SFO", 1]], data = FALSE)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:28 2016 
-## Date of summary: Thu Nov 17 18:44:29 2016 
+## Date of fit:     Fri Nov 18 22:48:58 2016 
+## Date of summary: Fri Nov 18 22:48:58 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 46 model solutions performed in 0.1 s
+## Fitted with method Port using 46 model solutions performed in 0.098 s
 ## 
 ## Weighting: none
 ## 
@@ -753,15 +753,15 @@ plot(mm.L4)
summary(mm.L4[["FOMC", 1]], data = FALSE)
## mkin version:    0.9.44.9000 
 ## R version:       3.3.2 
-## Date of fit:     Thu Nov 17 18:44:28 2016 
-## Date of summary: Thu Nov 17 18:44:29 2016 
+## Date of fit:     Fri Nov 18 22:48:58 2016 
+## Date of summary: Fri Nov 18 22:48:58 2016 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 66 model solutions performed in 0.152 s
+## Fitted with method Port using 66 model solutions performed in 0.142 s
 ## 
 ## Weighting: none
 ## 
diff --git a/vignettes/FOCUS_Z.pdf b/vignettes/FOCUS_Z.pdf
index 6f8929ea..d8bfd68c 100644
Binary files a/vignettes/FOCUS_Z.pdf and b/vignettes/FOCUS_Z.pdf differ
diff --git a/vignettes/compiled_models.html b/vignettes/compiled_models.html
index 2cb73ac7..c9501b11 100644
--- a/vignettes/compiled_models.html
+++ b/vignettes/compiled_models.html
@@ -11,7 +11,7 @@
 
 
 
-
+
 
 Performance benefit by using compiled model definitions in mkin
 
@@ -24,7 +24,7 @@
 
 
 
-
+
 
 
 
@@ -187,8 +187,9 @@ div.tocify {
 }
 
 .tocify-subheader .tocify-item {
-  font-size: 0.9em;
-  padding-left: 5px;
+  font-size: 0.90em;
+  padding-left: 25px;
+  text-indent: 0;
 }
 
 .tocify .list-group-item {
@@ -216,7 +217,7 @@ div.tocify {
 
 

Performance benefit by using compiled model definitions in mkin

Johannes Ranke

-

2016-11-17

+

2016-11-18

@@ -257,21 +258,21 @@ mb.1 <- microbenchmark( print(mb.1)
## Unit: milliseconds
 ##                   expr       min        lq      mean    median        uq
-##  deSolve, not compiled 4925.0009 4957.6694 4974.0652 4990.3379 4998.5974
-##       Eigenvalue based  838.9741  839.6651  857.4679  840.3561  866.7149
-##      deSolve, compiled  695.5858  709.3905  717.8062  723.1951  728.9163
+##  deSolve, not compiled 4919.3703 4922.1463 4957.6695 4924.9224 4976.8191
+##       Eigenvalue based  824.0317  840.7962  861.2648  857.5608  879.8813
+##      deSolve, compiled  691.8755  701.7453  706.2023  711.6151  713.3657
 ##        max neval cld
-##  5006.8569     3   c
-##   893.0736     3  b 
-##   734.6375     3 a
+## 5028.7158 3 c +## 902.2019 3 b +## 715.1164 3 a
autoplot(mb.1)
-

+

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

rownames(smb.1) <- smb.1$expr
 smb.1["median"]/smb.1["deSolve, compiled", "median"]
##                         median
-## deSolve, not compiled 6.900403
-## Eigenvalue based      1.162005
+## deSolve, not compiled 6.920767
+## Eigenvalue based      1.205091
 ## deSolve, compiled     1.000000
@@ -292,19 +293,19 @@ smb.1["median"]/smb.1["deSolve, compiled", "median"
smb.2 <- summary(mb.2)
 print(mb.2)
## Unit: seconds
-##                   expr       min        lq      mean    median       uq
-##  deSolve, not compiled 10.905262 11.007527 11.335389 11.109791 11.55045
-##      deSolve, compiled  1.297428  1.304999  1.327356  1.312569  1.34232
+##                   expr       min        lq      mean    median        uq
+##  deSolve, not compiled 10.667049 10.692450 10.719555 10.717851 10.745808
+##      deSolve, compiled  1.279783  1.280014  1.281444  1.280244  1.282274
 ##        max neval cld
-##  11.991114     3   b
-##   1.372071     3  a
+## 10.773765 3 b +## 1.284305 3 a
smb.2["median"]/smb.2["deSolve, compiled", "median"]
##   median
 ## 1     NA
 ## 2     NA
autoplot(mb.2)
-

-

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

+

+

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

This vignette was built with mkin 0.9.44.9000 on

## R version 3.3.2 (2016-10-31)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
-- 
cgit v1.2.1