From 3ea655cdbefcf2056da456b7debc68ba7b535f55 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 24 Mar 2016 08:35:26 +0100 Subject: Static documentation rebuilt by staticdocs::build_site() --- vignettes/FOCUS_D.html | 20 +- vignettes/FOCUS_L.html | 164 ++++++++-------- vignettes/FOCUS_Z.pdf | Bin 225040 -> 225057 bytes vignettes/compiled_models.html | 420 ++++++++++++----------------------------- vignettes/mkin.pdf | Bin 160263 -> 160263 bytes 5 files changed, 210 insertions(+), 394 deletions(-) (limited to 'vignettes') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index 1f3c6677..964c1ad8 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -10,7 +10,7 @@ - + Example evaluation of FOCUS Example Dataset D @@ -64,7 +64,7 @@ img { @@ -135,10 +135,10 @@ print(FOCUS_2006_D)

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

summary(fit)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:06 2015 
-## Date of summary: Mon Jul 20 14:51:06 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:54 2016 
+## Date of summary: Thu Mar 24 08:30:54 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
@@ -146,7 +146,7 @@ print(FOCUS_2006_D)
## ## Model predictions using solution type deSolve ## -## Fitted with method Port using 153 model solutions performed in 0.66 s +## Fitted with method Port using 153 model solutions performed in 0.659 s ## ## Weighting: none ## @@ -185,9 +185,9 @@ print(FOCUS_2006_D)
## Residual standard error: 3.211 on 36 degrees of freedom ## ## 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. +## 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 61.720 2.024e-38 96.330000 1.029e+02 ## k_parent_sink 0.047920 12.780 3.050e-15 0.040890 5.616e-02 diff --git a/vignettes/FOCUS_L.html b/vignettes/FOCUS_L.html index a7564f72..25551855 100644 --- a/vignettes/FOCUS_L.html +++ b/vignettes/FOCUS_L.html @@ -10,7 +10,7 @@ - + Example evaluation of FOCUS Laboratory Data L1 to L3 @@ -65,7 +65,7 @@ img {
@@ -91,17 +91,17 @@ FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

Since mkin version 0.9-32 (July 2014), we can use shorthand notation like SFO for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.

m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet=TRUE)
 summary(m.L1.SFO)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:06 2015 
-## Date of summary: Mon Jul 20 14:51:07 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:54 2016 
+## Date of summary: Thu Mar 24 08:30:54 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 37 model solutions performed in 0.087 s
+## Fitted with method Port using 37 model solutions performed in 0.091 s
 ## 
 ## Weighting: none
 ## 
@@ -131,9 +131,9 @@ summary(m.L1.SFO)
## Residual standard error: 2.948 on 16 degrees of freedom ## ## 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. +## Confidence intervals for internally transformed parameters are asymmetric. +## t-test (unrealistically) based on the assumption of normal distribution +## for estimators of untransformed parameters. ## Estimate t value Pr(>t) Lower Upper ## parent_0 92.47000 67.58 2.170e-21 89.57000 95.3700 ## k_parent_sink 0.09561 24.65 1.867e-14 0.08773 0.1042 @@ -181,10 +181,10 @@ summary(m.L1.SFO)
## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation by method Port did not converge.
 ## Convergence code is 1
summary(m.L1.FOMC, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:07 2015 
-## Date of summary: Mon Jul 20 14:51:07 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:55 2016 
+## Date of summary: Thu Mar 24 08:30:55 2016 
 ## 
 ## 
 ## Warning: Optimisation by method Port did not converge.
@@ -196,7 +196,7 @@ summary(m.L1.SFO)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 188 model solutions performed in 0.43 s +## Fitted with method Port using 188 model solutions performed in 0.527 s ## ## Weighting: none ## @@ -230,9 +230,9 @@ summary(m.L1.SFO)
## Residual standard error: 3.045 on 15 degrees of freedom ## ## 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. +## 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 9.247e+01 65.150 4.044e-20 8.944e+01 9.550e+01 ## alpha 5.044e+06 1.271 1.115e-01 5.510e-08 4.618e+20 @@ -261,17 +261,17 @@ FOCUS_2006_L2_mkin <- mkin_wide_to_long(FOCUS_2006_L2)

Again, the SFO model is fitted and a summary is obtained:

m.L2.SFO <- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
 summary(m.L2.SFO)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:07 2015 
-## Date of summary: Mon Jul 20 14:51:07 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:55 2016 
+## Date of summary: Thu Mar 24 08:30:55 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 41 model solutions performed in 0.094 s
+## Fitted with method Port using 41 model solutions performed in 0.099 s
 ## 
 ## Weighting: none
 ## 
@@ -301,9 +301,9 @@ summary(m.L2.SFO)
## Residual standard error: 5.51 on 10 degrees of freedom ## ## 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. +## 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 91.4700 24.03 1.773e-10 82.9800 99.9500 ## k_parent_sink 0.6629 9.31 1.525e-06 0.5218 0.8421 @@ -349,17 +349,17 @@ plot(m.L2.FOMC) mkinresplot(m.L2.FOMC)

summary(m.L2.FOMC, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:08 2015 
-## Date of summary: Mon Jul 20 14:51:08 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:56 2016 
+## Date of summary: Thu Mar 24 08:30:56 2016 
 ## 
 ## Equations:
 ## d_parent = - (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.2 s
 ## 
 ## Weighting: none
 ## 
@@ -393,9 +393,9 @@ mkinresplot(m.L2.FOMC)
## Residual standard error: 2.628 on 9 degrees of freedom ## ## 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. +## 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 93.770 50.510 1.173e-12 89.5700 97.970 ## alpha 1.374 5.355 2.296e-04 0.9009 2.097 @@ -421,10 +421,10 @@ plot(m.L2.DFOP)
plot(m.L2.DFOP)

summary(m.L2.DFOP, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:10 2015 
-## Date of summary: Mon Jul 20 14:51:10 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:58 2016 
+## Date of summary: Thu Mar 24 08:30:58 2016 
 ## 
 ## Equations:
 ## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -433,7 +433,7 @@ plot(m.L2.DFOP)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 336 model solutions performed in 0.793 s +## Fitted with method Port using 336 model solutions performed in 0.903 s ## ## Weighting: none ## @@ -467,9 +467,9 @@ plot(m.L2.DFOP)
## Residual standard error: 1.732 on 8 degrees of freedom ## ## 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. +## 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 93.9500 NA NA NA NA ## k1 22.6700 NA NA NA NA @@ -498,17 +498,17 @@ FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3) plot(m.L3.SFO)

summary(m.L3.SFO)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:10 2015 
-## Date of summary: Mon Jul 20 14:51:10 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:58 2016 
+## Date of summary: Thu Mar 24 08:30:58 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 43 model solutions performed in 0.103 s
+## Fitted with method Port using 43 model solutions performed in 0.104 s
 ## 
 ## Weighting: none
 ## 
@@ -538,9 +538,9 @@ plot(m.L3.SFO)
## Residual standard error: 12.91 on 6 degrees of freedom ## ## 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. +## 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 74.87000 8.853 5.776e-05 54.18000 95.57000 ## k_parent_sink 0.02527 3.067 1.102e-02 0.01138 0.05612 @@ -574,17 +574,17 @@ plot(m.L3.SFO)
plot(m.L3.FOMC)

summary(m.L3.FOMC, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:11 2015 
-## Date of summary: Mon Jul 20 14:51:11 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:59 2016 
+## Date of summary: Thu Mar 24 08:30:59 2016 
 ## 
 ## Equations:
 ## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 83 model solutions performed in 0.187 s
+## Fitted with method Port using 83 model solutions performed in 0.208 s
 ## 
 ## Weighting: none
 ## 
@@ -618,9 +618,9 @@ plot(m.L3.FOMC)
## Residual standard error: 4.572 on 5 degrees of freedom ## ## 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. +## 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 96.9700 21.310 2.108e-06 85.2800 108.7000 ## alpha 0.4224 5.867 1.020e-03 0.2725 0.6546 @@ -640,10 +640,10 @@ plot(m.L3.FOMC)
plot(m.L3.DFOP)

summary(m.L3.DFOP, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:11 2015 
-## Date of summary: Mon Jul 20 14:51:11 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:30:59 2016 
+## Date of summary: Thu Mar 24 08:30:59 2016 
 ## 
 ## Equations:
 ## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -652,7 +652,7 @@ plot(m.L3.DFOP)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 137 model solutions performed in 0.322 s +## Fitted with method Port using 137 model solutions performed in 0.351 s ## ## Weighting: none ## @@ -690,9 +690,9 @@ plot(m.L3.DFOP)
## Residual standard error: 1.439 on 4 degrees of freedom ## ## 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. +## 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 97.75000 67.970 1.404e-07 93.75000 101.70000 ## k1 0.51620 7.499 8.460e-04 0.35650 0.74750 @@ -722,17 +722,17 @@ FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4) plot(m.L4.SFO)

summary(m.L4.SFO, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:12 2015 
-## Date of summary: Mon Jul 20 14:51:12 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:31:00 2016 
+## Date of summary: Thu Mar 24 08:31:00 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 46 model solutions performed in 0.101 s
+## Fitted with method Port using 46 model solutions performed in 0.116 s
 ## 
 ## Weighting: none
 ## 
@@ -762,9 +762,9 @@ plot(m.L4.SFO)
## Residual standard error: 3.651 on 6 degrees of freedom ## ## 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. +## 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 96.440000 49.49 2.283e-09 91.670000 1.012e+02 ## k_parent_sink 0.006541 12.50 8.008e-06 0.005378 7.955e-03 @@ -787,17 +787,17 @@ plot(m.L4.SFO)
plot(m.L4.FOMC)

summary(m.L4.FOMC, data = FALSE)
-
## mkin version:    0.9.40 
-## R version:       3.2.1 
-## Date of fit:     Mon Jul 20 14:51:12 2015 
-## Date of summary: Mon Jul 20 14:51:12 2015 
+
## mkin version:    0.9.42 
+## R version:       3.2.4 
+## Date of fit:     Thu Mar 24 08:31:00 2016 
+## Date of summary: Thu Mar 24 08:31:00 2016 
 ## 
 ## Equations:
 ## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 66 model solutions performed in 0.146 s
+## Fitted with method Port using 66 model solutions performed in 0.164 s
 ## 
 ## Weighting: none
 ## 
@@ -831,9 +831,9 @@ plot(m.L4.FOMC)
## Residual standard error: 2.315 on 5 degrees of freedom ## ## 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. +## 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.1400 59.020 1.322e-08 94.8200 103.500 ## alpha 0.7042 2.685 2.178e-02 0.2703 1.835 diff --git a/vignettes/FOCUS_Z.pdf b/vignettes/FOCUS_Z.pdf index 8103cba4..3b804e88 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 3215a386..50db7e9a 100644 --- a/vignettes/compiled_models.html +++ b/vignettes/compiled_models.html @@ -1,248 +1,98 @@ - - - - -Benchmark for a model that can also be solved with Eigenvalues - + - - + + + - - - - - - +
+ - + - +

Benchmark for a model that can also be solved with Eigenvalues

- -

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

- -
Sys.which("gcc")
-
- +

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

+
Sys.which("gcc")
##            gcc 
-## "/usr/bin/gcc"
-
- +## "/usr/bin/gcc"

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

- -
library("mkin")
-
- -
## Loading required package: minpack.lm
-## Loading required package: rootSolve
-## Loading required package: inline
-## Loading required package: methods
-## Loading required package: parallel
-
- -
SFO_SFO <- mkinmod(
+
library("mkin")
+SFO_SFO <- mkinmod(
   parent = mkinsub("SFO", "m1"),
-  m1 = mkinsub("SFO"))
-
- -
## Successfully compiled differential equation model from auto-generated C code.
-
- -

We can compare the performance of the Eigenvalue based solution against the -compiled version and the R implementation of the differential equations using -the microbenchmark package.

- -
library("microbenchmark")
-library("ggplot2")
-mb.1 <- microbenchmark(
+  m1 = mkinsub("SFO"))
+
## Successfully compiled differential equation model from auto-generated C code.
+

We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the microbenchmark package.

+
library("microbenchmark")
+library("ggplot2")
+
## Need help? Try the ggplot2 mailing list:
+## http://groups.google.com/group/ggplot2.
+
mb.1 <- microbenchmark(
   "deSolve, not compiled" = mkinfit(SFO_SFO, FOCUS_2006_D, 
                                     solution_type = "deSolve", 
                                     use_compiled = FALSE, quiet = TRUE),
@@ -250,115 +100,81 @@ mb.1 <- microbenchmark(
                                solution_type = "eigen", quiet = TRUE),
   "deSolve, compiled" = mkinfit(SFO_SFO, FOCUS_2006_D, 
                                 solution_type = "deSolve", quiet = TRUE),
-  times = 3, control = list(warmup = 0))
-
- + times = 3, control = list(warmup = 0))
## Warning in microbenchmark(`deSolve, not compiled` = mkinfit(SFO_SFO,
 ## FOCUS_2006_D, : Could not measure overhead. Your clock might lack
-## precision.
-
- -
smb.1 <- summary(mb.1)
-print(mb.1)
-
- +## precision. +
smb.1 <- summary(mb.1)
+print(mb.1)
## Unit: milliseconds
 ##                   expr       min        lq      mean    median        uq
-##  deSolve, not compiled 4652.4576 4653.2263 4673.1220 4653.9950 4683.4543
-##       Eigenvalue based  749.7771  750.1327  764.7881  750.4882  772.2936
-##      deSolve, compiled  641.9152  647.6028  651.6533  653.2904  656.5223
+##  deSolve, not compiled 9280.0854 9299.6757 9323.2559 9319.2659 9344.8411
+##       Eigenvalue based  885.7475  891.8548  907.2823  897.9621  918.0498
+##      deSolve, compiled  713.2624  721.4990  728.2856  729.7357  735.7972
 ##        max neval cld
-##  4712.9136     3   c
-##   794.0990     3  b 
-##   659.7542     3 a
-
- -
autoplot(mb.1)
-
- -

plot of chunk benchmark_SFO_SFO

- -

We see that using the compiled model is by a factor of -7.1 -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 7.123930
-## Eigenvalue based      1.148782
-## deSolve, compiled     1.000000
-
- +## 9370.4163 3 c +## 938.1374 3 b +## 741.8588 3 a +
autoplot(mb.1)
+

+

We see that using the compiled model is by a factor of 12.8 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 12.770742
+## Eigenvalue based       1.230531
+## deSolve, compiled      1.000000
+
+

Benchmark for a model that can not be solved with Eigenvalues

- -

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

- -
FOMC_SFO <- mkinmod(
+

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

+
FOMC_SFO <- mkinmod(
   parent = mkinsub("FOMC", "m1"),
-  m1 = mkinsub( "SFO"))
-
- -
## Successfully compiled differential equation model from auto-generated C code.
-
- -
mb.2 <- microbenchmark(
+  m1 = mkinsub( "SFO"))
+
## Successfully compiled differential equation model from auto-generated C code.
+
mb.2 <- microbenchmark(
   "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, 
                                     use_compiled = FALSE, quiet = TRUE),
   "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
-  times = 3, control = list(warmup = 0))
-
- + times = 3, control = list(warmup = 0))
## Warning in microbenchmark(`deSolve, not compiled` = mkinfit(FOMC_SFO,
 ## FOCUS_2006_D, : Could not measure overhead. Your clock might lack
-## precision.
-
- -
smb.2 <- summary(mb.2)
-print(mb.2)
-
- +## precision. +
smb.2 <- summary(mb.2)
+print(mb.2)
## Unit: seconds
 ##                   expr       min        lq      mean    median        uq
-##  deSolve, not compiled 10.202245 10.243829 10.260112 10.285413 10.289045
-##      deSolve, compiled  1.176863  1.182699  1.188555  1.188536  1.194402
-##        max neval cld
-##  10.292677     3   b
-##   1.200267     3  a
-
- -
smb.2["median"]/smb.2["deSolve, compiled", "median"]
-
- +## deSolve, not compiled 20.543131 20.661195 20.720383 20.779259 20.809008 +## deSolve, compiled 1.314865 1.316439 1.328049 1.318014 1.334642 +## max neval cld +## 20.83876 3 b +## 1.35127 3 a +
smb.2["median"]/smb.2["deSolve, compiled", "median"]
##   median
 ## 1     NA
-## 2     NA
-
+## 2 NA +
autoplot(mb.2)
+

+

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

+

This vignette was built with mkin 0.9.42 on

+
## R version 3.2.4 Revised (2016-03-16 r70336)
+## Platform: x86_64-pc-linux-gnu (64-bit)
+## Running under: Debian GNU/Linux 8 (jessie)
+
## CPU model: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
+
-
autoplot(mb.2)
-
-

plot of chunk benchmark_FOMC_SFO

+ -

Here we get a performance benefit of a factor of -8.7 -using the version of the differential equation model compiled from C code using -the inline package!

+ -
## CPU model: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
-
- diff --git a/vignettes/mkin.pdf b/vignettes/mkin.pdf index b07cdc72..4e3863d6 100644 Binary files a/vignettes/mkin.pdf and b/vignettes/mkin.pdf differ -- cgit v1.2.1