aboutsummaryrefslogtreecommitdiff
path: root/vignettes/web_only/benchmarks.Rmd
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-10 21:53:00 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-10 21:53:00 +0200
commitd113cd79b178fdc91aecb894707ed356129dfb75 (patch)
treedc28e049e94eb3ee9745f9cd86387de96a894c93 /vignettes/web_only/benchmarks.Rmd
parentefab37957381919c21d874906ce870f4941c760a (diff)
Default to analytical for coupled models if available
This revealed that transforming rates is necessary for fitting the analytical solution of the SFO-SFO model to the FOCUS D dataset. Benchmarks show that fitting coupled models with deSolve got a bit slower through the latest changes
Diffstat (limited to 'vignettes/web_only/benchmarks.Rmd')
-rw-r--r--vignettes/web_only/benchmarks.Rmd14
1 files changed, 8 insertions, 6 deletions
diff --git a/vignettes/web_only/benchmarks.Rmd b/vignettes/web_only/benchmarks.Rmd
index 4849635f..cc28735a 100644
--- a/vignettes/web_only/benchmarks.Rmd
+++ b/vignettes/web_only/benchmarks.Rmd
@@ -40,9 +40,11 @@ if (mkin_version > "0.9.48.1") {
```
```{r timings}
+FOCUS_C <- FOCUS_2006_C
+FOCUS_D <- subset(FOCUS_2006_D, value != 0)
# Parent only
-t1 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_2006_C, FOCUS_2006_D)))[["elapsed"]]
-t2 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_2006_C, FOCUS_2006_D), error_model = "tc"))[["elapsed"]]
+t1 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_C, FOCUS_D)))[["elapsed"]]
+t2 <- system.time(mmkin_bench(c("SFO", "FOMC", "DFOP", "HS"), list(FOCUS_C, FOCUS_D), error_model = "tc"))[["elapsed"]]
# One metabolite
SFO_SFO <- mkinmod(
@@ -54,9 +56,9 @@ FOMC_SFO <- mkinmod(
DFOP_SFO <- mkinmod(
parent = mkinsub("FOMC", "m1"),
m1 = mkinsub("SFO"))
-t3 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_2006_D)))[["elapsed"]]
-t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(subset(FOCUS_2006_D, value != 0)), error_model = "tc"))[["elapsed"]]
-t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_2006_D), error_model = "obs"))[["elapsed"]]
+t3 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D)))[["elapsed"]]
+t4 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), error_model = "tc"))[["elapsed"]]
+t5 <- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D), error_model = "obs"))[["elapsed"]]
# Two metabolites, synthetic data
m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"),
@@ -83,7 +85,7 @@ t10 <- system.time(mmkin_bench(list(m_synth_SFO_lin), list(SFO_lin_a), error_mod
t11 <- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c), error_model = "obs"))["elapsed"]
mkin_benchmarks[system_string, paste0("t", 1:11)] <- c(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11)
-mkin_benchmarks
+mkin_benchmarks[, -c(1:3)]
save(mkin_benchmarks, file = "~/git/mkin/vignettes/mkin_benchmarks.rda")

Contact - Imprint