From 4596667b19f032232ceb8f3f762aaad5d69c15be Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 5 Jul 2019 15:57:24 +0200 Subject: Static documentation rebuilt by pkgdown --- docs/articles/web_only/compiled_models.html | 106 +++++++--------------------- 1 file changed, 26 insertions(+), 80 deletions(-) (limited to 'docs/articles/web_only/compiled_models.html') diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html index 3fc54cfa..ca883f17 100644 --- a/docs/articles/web_only/compiled_models.html +++ b/docs/articles/web_only/compiled_models.html @@ -30,7 +30,7 @@ mkin - 0.9.49.5 + 0.9.49.6 @@ -88,7 +88,7 @@

Performance benefit by using compiled model definitions in mkin

Johannes Ranke

-

2019-07-04

+

2019-07-05

@@ -128,99 +128,45 @@ print("R package rbenchmark is not available") }
## Lade nötiges Paket: rbenchmark
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve",
-## use_compiled = FALSE, : Observations with value of zero were removed from
-## the data
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet =
-## TRUE): Observations with value of zero were removed from the data
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve", quiet
-## = TRUE): Observations with value of zero were removed from the data
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve",
-## use_compiled = FALSE, : Observations with value of zero were removed from
-## the data
-
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve",
-## use_compiled = FALSE, : Observations with value of zero were removed from
-## the data
-
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve",
-## use_compiled = FALSE, : Observations with value of zero were removed from
-## the data
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet =
-## TRUE): Observations with value of zero were removed from the data
-
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet =
-## TRUE): Observations with value of zero were removed from the data
-
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet =
-## TRUE): Observations with value of zero were removed from the data
-
## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve", quiet
-## = TRUE): Observations with value of zero were removed from the data
-
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "deSolve", quiet
-## = TRUE): Observations with value of zero were removed from the data
-
-## 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.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
+## 3     deSolve, compiled            3   2.147    1.000     2.145        0
+## 1 deSolve, not compiled            3  12.653    5.893    12.646        0
+## 2      Eigenvalue based            3   2.690    1.253     2.688        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
 ## 2          0         0
-

We see that using the compiled model is by a factor of around 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.

+

We see that using the compiled model is by a factor of around 6 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.

Model that can not be solved with Eigenvalues

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

-
if (require(rbenchmark)) {
-  FOMC_SFO <- mkinmod(
-    parent = mkinsub("FOMC", "m1"),
-    m1 = mkinsub( "SFO"))
-
-  b.2 <- benchmark(
-    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D,
-                                      use_compiled = FALSE, quiet = TRUE),
-    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
-    replications = 3)
-  print(b.2)
-  factor_FOMC_SFO <- round(b.2["1", "relative"])
-} else {
-  factor_FOMC_SFO <- NA
-  print("R package benchmark is not available")
-}
+
if (require(rbenchmark)) {
+  FOMC_SFO <- mkinmod(
+    parent = mkinsub("FOMC", "m1"),
+    m1 = mkinsub( "SFO"))
+
+  b.2 <- benchmark(
+    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D,
+                                      use_compiled = FALSE, quiet = TRUE),
+    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
+    replications = 3)
+  print(b.2)
+  factor_FOMC_SFO <- round(b.2["1", "relative"])
+} else {
+  factor_FOMC_SFO <- NA
+  print("R package benchmark is not available")
+}
## Successfully compiled differential equation model from auto-generated C code.
-
## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, use_compiled = FALSE, quiet =
-## TRUE): Observations with value of zero were removed from the data
-
## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
-## value of zero were removed from the data
-
## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, use_compiled = FALSE, quiet =
-## TRUE): Observations with value of zero were removed from the data
-
-## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, use_compiled = FALSE, quiet =
-## TRUE): Observations with value of zero were removed from the data
-
-## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, use_compiled = FALSE, quiet =
-## TRUE): Observations with value of zero were removed from the data
-
## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
-## value of zero were removed from the data
-
-## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
-## value of zero were removed from the data
-
-## 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.818    1.000     4.814        0
-## 1 deSolve, not compiled            3  53.275   11.057    53.249        0
+## 2     deSolve, compiled            3   3.773    1.000     3.770        0
+## 1 deSolve, not compiled            3  27.812    7.371    27.798        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
-

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

-

This vignette was built with mkin 0.9.49.5 on

+

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

+

This vignette was built with mkin 0.9.48.1 on

## R version 3.6.0 (2019-04-26)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
 ## Running under: Debian GNU/Linux 10 (buster)
-- cgit v1.2.1