diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-09 09:18:58 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-09 09:18:58 +0100 |
commit | a3e058f8bceca903e7952e66abb4744f66115921 (patch) | |
tree | f029eded457914459ecc111511e468905d56172d /man | |
parent | e2cb0d4668f17f57c65f3ff94a7e17c784eaf4ba (diff) |
Some work on example code, pkgdown update
Diffstat (limited to 'man')
-rw-r--r-- | man/saem.Rd | 9 | ||||
-rw-r--r-- | man/summary.saem.mmkin.Rd | 39 |
2 files changed, 31 insertions, 17 deletions
diff --git a/man/saem.Rd b/man/saem.Rd index b2daf419..56b54fbf 100644 --- a/man/saem.Rd +++ b/man/saem.Rd @@ -81,6 +81,10 @@ f_saem_dfop <- saem(f_mmkin_parent["DFOP", ]) # functions from saemix library(saemix) compare.saemix(list(f_saem_sfo$so, f_saem_fomc$so, f_saem_dfop$so)) +plot(f_saem_fomc$so, plot.type = "convergence") +plot(f_saem_fomc$so, plot.type = "individual.fit") +plot(f_saem_fomc$so, plot.type = "npde") +plot(f_saem_fomc$so, plot.type = "vpc") f_mmkin_parent_tc <- update(f_mmkin_parent, error_model = "tc") f_saem_fomc_tc <- saem(f_mmkin_parent_tc["FOMC", ]) @@ -101,11 +105,12 @@ f_mmkin <- mmkin(list( # analytical solutions written for saemix. When using the analytical # solutions written for mkin this took around four minutes f_saem_sfo_sfo <- saem(f_mmkin["SFO-SFO", ]) -f_saem_dfop_sfo <- saem(f_mmkin["SFO-SFO", ]) +f_saem_dfop_sfo <- saem(f_mmkin["DFOP-SFO", ]) +summary(f_saem_dfop_sfo, data = FALSE) # Using a single core, the following takes about 6 minutes, using 10 cores # it is slower instead of faster -f_saem_fomc <- saem(f_mmkin["FOMC-SFO", ], cores = 1) +#f_saem_fomc <- saem(f_mmkin["FOMC-SFO", ], cores = 1) } } \seealso{ diff --git a/man/summary.saem.mmkin.Rd b/man/summary.saem.mmkin.Rd index 0f0d8264..828691e6 100644 --- a/man/summary.saem.mmkin.Rd +++ b/man/summary.saem.mmkin.Rd @@ -51,25 +51,34 @@ endpoints such as formation fractions and DT50 values. Optionally (default is FALSE), the data are listed in full. } \examples{ -# Generate five datasets following SFO kinetics +# Generate five datasets following DFOP-SFO kinetics sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) -dt50_sfo_in_pop <- 50 -k_in_pop <- log(2) / dt50_sfo_in_pop +dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "m1"), + m1 = mkinsub("SFO"), quiet = TRUE) set.seed(1234) -k_in <- rlnorm(5, log(k_in_pop), 0.5) -SFO <- mkinmod(parent = mkinsub("SFO")) +k1_in <- rlnorm(5, log(0.1), 0.3) +k2_in <- rlnorm(5, log(0.02), 0.3) +g_in <- plogis(rnorm(5, qlogis(0.5), 0.3)) +f_parent_to_m1_in <- plogis(rnorm(5, qlogis(0.3), 0.3)) +k_m1_in <- rlnorm(5, log(0.02), 0.3) -pred_sfo <- function(k) { - mkinpredict(SFO, - c(k_parent = k), - c(parent = 100), +pred_dfop_sfo <- function(k1, k2, g, f_parent_to_m1, k_m1) { + mkinpredict(dfop_sfo, + c(k1 = k1, k2 = k2, g = g, f_parent_to_m1 = f_parent_to_m1, k_m1 = k_m1), + c(parent = 100, m1 = 0), sampling_times) } -ds_sfo_mean <- lapply(k_in, pred_sfo) -names(ds_sfo_mean) <- paste("ds", 1:5) +ds_mean_dfop_sfo <- lapply(1:5, function(i) { + mkinpredict(dfop_sfo, + c(k1 = k1_in[i], k2 = k2_in[i], g = g_in[i], + f_parent_to_m1 = f_parent_to_m1_in[i], k_m1 = k_m1_in[i]), + c(parent = 100, m1 = 0), + sampling_times) +}) +names(ds_mean_dfop_sfo) <- paste("ds", 1:5) -ds_sfo_syn <- lapply(ds_sfo_mean, function(ds) { +ds_syn_dfop_sfo <- lapply(ds_mean_dfop_sfo, function(ds) { add_err(ds, sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2), n = 1)[[1]] @@ -77,9 +86,9 @@ ds_sfo_syn <- lapply(ds_sfo_mean, function(ds) { \dontrun{ # Evaluate using mmkin and saem -f_mmkin <- mmkin("SFO", ds_sfo_syn, quiet = TRUE, error_model = "tc", cores = 1) -f_saem <- saem(f_mmkin) -summary(f_saem, data = TRUE) +f_mmkin_dfop_sfo <- mmkin(list(dfop_sfo), ds_syn_dfop_sfo, quiet = TRUE, error_model = "tc", cores = 5) +f_saem_dfop_sfo <- saem(f_mmkin_dfop_sfo) +summary(f_saem_dfop_sfo, data = TRUE) } } |