From 91a5834dd701211f929fd25419dc34561ce3b4e7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 14 Feb 2025 09:15:20 +0100 Subject: Initialize dev docs --- docs/dev/articles/web_only/saem_benchmarks.html | 789 ++++++++++++++++++++++++ 1 file changed, 789 insertions(+) create mode 100644 docs/dev/articles/web_only/saem_benchmarks.html (limited to 'docs/dev/articles/web_only/saem_benchmarks.html') diff --git a/docs/dev/articles/web_only/saem_benchmarks.html b/docs/dev/articles/web_only/saem_benchmarks.html new file mode 100644 index 00000000..d4cd0d6f --- /dev/null +++ b/docs/dev/articles/web_only/saem_benchmarks.html @@ -0,0 +1,789 @@ + + + + + + + +Benchmark timings for saem.mmkin • mkin + + + + + + + + + Skip to contents + + +
+ + + + +
+
+ + + +

Each system is characterized by operating system type, CPU type, mkin +version, saemix version and R version. A compiler was available, so if +no analytical solution was available, compiled ODE models are used.

+

Every fit is only performed once, so the accuracy of the benchmarks +is limited.

+

For the initial mmkin fits, we use all available cores.

+
+n_cores <- parallel::detectCores()
+
+

Test data +

+

Please refer to the vignette dimethenamid_2018 for an +explanation of the following preprocessing.

+
+dmta_ds <- lapply(1:7, function(i) {
+  ds_i <- dimethenamid_2018$ds[[i]]$data
+  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"
+  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
+  ds_i
+})
+names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
+dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
+dmta_ds[["Elliot 1"]] <- NULL
+dmta_ds[["Elliot 2"]] <- NULL
+
+
+

Test cases +

+
+

Parent only +

+
+parent_mods <- c("SFO", "DFOP", "SFORB", "HS")
+parent_sep_const <- mmkin(parent_mods, dmta_ds, quiet = TRUE, cores = n_cores)
+parent_sep_tc <- update(parent_sep_const, error_model = "tc")
+
+t1 <- system.time(sfo_const <- saem(parent_sep_const["SFO", ]))[["elapsed"]]
+t2 <- system.time(dfop_const <- saem(parent_sep_const["DFOP", ]))[["elapsed"]]
+t3 <- system.time(sforb_const <- saem(parent_sep_const["SFORB", ]))[["elapsed"]]
+t4 <- system.time(hs_const <- saem(parent_sep_const["HS", ]))[["elapsed"]]
+t5 <- system.time(sfo_tc <- saem(parent_sep_tc["SFO", ]))[["elapsed"]]
+t6 <- system.time(dfop_tc <- saem(parent_sep_tc["DFOP", ]))[["elapsed"]]
+t7 <- system.time(sforb_tc <- saem(parent_sep_tc["SFORB", ]))[["elapsed"]]
+t8 <- system.time(hs_tc <- saem(parent_sep_tc["HS", ]))[["elapsed"]]
+
+anova(
+  sfo_const, dfop_const, sforb_const, hs_const,
+  sfo_tc, dfop_tc, sforb_tc, hs_tc) |> kable(, digits = 1)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nparAICBICLik
sfo_const5796.3795.3-393.2
sfo_tc6798.3797.1-393.2
dfop_const9709.4707.5-345.7
sforb_const9710.0708.1-346.0
hs_const9713.7711.8-347.8
dfop_tc10670.1668.0-325.0
sforb_tc10662.9660.8-321.4
hs_tc10667.2665.1-323.6
+

The above model comparison suggests to use the SFORB model with +two-component error. For comparison, we keep the DFOP model with +two-component error, as it competes with SFORB for biphasic curves.

+
+illparms(dfop_tc)
+
## [1] "sd(log_k2)"
+
+illparms(sforb_tc)
+
## [1] "sd(log_k_DMTA_bound_free)"
+

For these two models, random effects for the transformed parameters +k2 and k_DMTA_bound_free could not be +quantified.

+
+
+

One metabolite +

+

We remove parameters that were found to be ill-defined in the parent +only fits.

+
+one_met_mods <- list(
+  DFOP_SFO = mkinmod(
+    DMTA = mkinsub("DFOP", "M23"),
+    M23 = mkinsub("SFO")),
+  SFORB_SFO = mkinmod(
+    DMTA = mkinsub("SFORB", "M23"),
+    M23 = mkinsub("SFO")))
+
+one_met_sep_const <- mmkin(one_met_mods, dmta_ds, error_model = "const",
+  cores = n_cores, quiet = TRUE)
+one_met_sep_tc <- mmkin(one_met_mods, dmta_ds, error_model = "tc",
+  cores = n_cores, quiet = TRUE)
+
+t9 <- system.time(dfop_sfo_tc <- saem(one_met_sep_tc["DFOP_SFO", ],
+    no_random_effect = "log_k2"))[["elapsed"]]
+t10 <- system.time(sforb_sfo_tc <- saem(one_met_sep_tc["SFORB_SFO", ],
+    no_random_effect = "log_k_DMTA_bound_free"))[["elapsed"]]
+
+
+

Three metabolites +

+

For the case of three metabolites, we only keep the SFORB model in +order to limit the time for compiling this vignette, and as fitting in +parallel may disturb the benchmark. Again, we do not include random +effects that were ill-defined in previous fits of subsets of the +degradation model.

+
+illparms(sforb_sfo_tc)
+
+three_met_mods <- list(
+  SFORB_SFO3_plus = mkinmod(
+    DMTA = mkinsub("SFORB", c("M23", "M27", "M31")),
+    M23 = mkinsub("SFO"),
+    M27 = mkinsub("SFO"),
+    M31 = mkinsub("SFO", "M27", sink = FALSE)))
+
+three_met_sep_tc <- mmkin(three_met_mods, dmta_ds, error_model = "tc",
+  cores = n_cores, quiet = TRUE)
+
+t11 <- system.time(sforb_sfo3_plus_const <- saem(three_met_sep_tc["SFORB_SFO3_plus", ],
+    no_random_effect = "log_k_DMTA_bound_free"))[["elapsed"]]
+
+
+
+

Results +

+

Benchmarks for all available error models are shown. They are +intended for improving mkin, not for comparing CPUs or operating +systems. All trademarks belong to their respective owners.

+
+

Parent only +

+

Constant variance for SFO, DFOP, SFORB and HS.

+ ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CPUOSmkinsaemixt1t2t3t4
Ryzen 7 1700Linux1.2.03.22.1404.6264.3284.998
Ryzen 7 1700Linux1.2.23.22.4274.5504.2174.851
Ryzen 9 7950XLinux1.2.13.21.3522.8132.4012.074
Ryzen 9 7950XLinux1.2.23.21.3282.7382.3362.023
Ryzen 9 7950XLinux1.2.33.21.1182.0362.0102.088
Ryzen 9 7950XLinux1.2.33.21.4192.3741.9262.398
Ryzen 9 7950XLinux1.2.43.20.9722.5501.9872.055
Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHzLinux1.2.63.22.9986.5236.1264.721
Ryzen 9 7950XLinux1.2.63.21.1352.0252.4062.478
Ryzen 9 7950XLinux1.2.93.31.0861.9911.9492.411
Ryzen 9 7950XLinux1.2.103.31.1152.2771.9452.134
+

Two-component error fits for SFO, DFOP, SFORB and HS.

+ ++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CPUOSmkinsaemixt5t6t7t8
Ryzen 7 1700Linux1.2.03.25.6787.4418.0007.980
Ryzen 7 1700Linux1.2.23.25.3527.2018.1748.401
Ryzen 9 7950XLinux1.2.13.22.3883.0333.5323.310
Ryzen 9 7950XLinux1.2.23.22.3412.9683.4653.341
Ryzen 9 7950XLinux1.2.33.22.1593.5843.3073.460
Ryzen 9 7950XLinux1.2.33.22.3483.1343.2533.530
Ryzen 9 7950XLinux1.2.43.22.1273.5873.4333.595
Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHzLinux1.2.63.25.0708.4648.5257.599
Ryzen 9 7950XLinux1.2.63.22.1613.3253.6693.153
Ryzen 9 7950XLinux1.2.93.32.4263.1963.2563.322
Ryzen 9 7950XLinux1.2.103.32.3723.1373.1003.281
+
+
+

One metabolite +

+

Two-component error for DFOP-SFO and SFORB-SFO.

+ ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CPUOSmkinsaemixt9t10
Ryzen 7 1700Linux1.2.03.224.465800.266
Ryzen 7 1700Linux1.2.23.225.193798.580
Ryzen 9 7950XLinux1.2.13.211.247285.216
Ryzen 9 7950XLinux1.2.23.211.242284.258
Ryzen 9 7950XLinux1.2.33.211.796216.012
Ryzen 9 7950XLinux1.2.33.212.841292.688
Ryzen 9 7950XLinux1.2.43.212.160265.934
Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHzLinux1.2.63.230.168748.675
Ryzen 9 7950XLinux1.2.63.212.007286.757
Ryzen 9 7950XLinux1.2.93.312.420289.338
Ryzen 9 7950XLinux1.2.103.311.590279.782
+
+
+

Three metabolites +

+

Two-component error for SFORB-SFO3-plus

+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CPUOSmkinsaemixt11
Ryzen 7 1700Linux1.2.03.21289.198
Ryzen 7 1700Linux1.2.23.21312.445
Ryzen 9 7950XLinux1.2.13.2489.939
Ryzen 9 7950XLinux1.2.23.2482.970
Ryzen 9 7950XLinux1.2.33.2392.364
Ryzen 9 7950XLinux1.2.33.2483.027
Ryzen 9 7950XLinux1.2.43.2456.252
Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHzLinux1.2.63.21235.028
Ryzen 9 7950XLinux1.2.63.2480.577
Ryzen 9 7950XLinux1.2.93.3485.836
Ryzen 9 7950XLinux1.2.103.3469.036
+
+
+
+
+ + + + +
+ + + + + + + -- cgit v1.2.1