From d113cd79b178fdc91aecb894707ed356129dfb75 Mon Sep 17 00:00:00 2001
From: Johannes Ranke <jranke@uni-bremen.de>
Date: Sun, 10 May 2020 21:53:00 +0200
Subject: 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
---
 vignettes/web_only/benchmarks.Rmd | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

(limited to 'vignettes/web_only/benchmarks.Rmd')

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")
-- 
cgit v1.2.3

