diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-06 00:03:29 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-06 00:03:29 +0100 |
commit | b5b446b718b15ccaae5b197e147fc1358f0f564e (patch) | |
tree | a36f32ee664c6925b5afdb812daca41075968152 /man/saemix.Rd | |
parent | 2f24fe0ce70d040e491619d7f2413fc902e433f1 (diff) |
Fast analytical solutions for saemix, update.mmkin
Also, use logit transformation for g and for solitary formation
fractions, addressing #10.
Diffstat (limited to 'man/saemix.Rd')
-rw-r--r-- | man/saemix.Rd | 61 |
1 files changed, 27 insertions, 34 deletions
diff --git a/man/saemix.Rd b/man/saemix.Rd index 962526ba..d4a8d0a4 100644 --- a/man/saemix.Rd +++ b/man/saemix.Rd @@ -38,46 +38,39 @@ mmkin. Starting variances of the random effects (argument omega.init) are the variances of the deviations of the parameters from these mean values. } \examples{ +\dontrun{ +library(saemix) ds <- lapply(experimental_data_for_UBA_2019[6:10], function(x) subset(x$data[c("name", "time", "value")])) names(ds) <- paste("Dataset", 6:10) -sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"), +f_mmkin_parent_p0_fixed <- mmkin("FOMC", ds, cores = 1, + state.ini = c(parent = 100), fixed_initials = "parent", quiet = TRUE) +m_saemix_p0_fixed <- saemix_model(f_mmkin_parent_p0_fixed["FOMC", ]) +d_saemix_parent <- saemix_data(f_mmkin_parent_p0_fixed) +saemix_options <- list(seed = 123456, displayProgress = FALSE, + save = FALSE, save.graphs = FALSE, nbiter.saemix = c(200, 80)) +f_saemix_p0_fixed <- saemix(m_saemix_p0_fixed, d_saemix_parent, saemix_options) + +f_mmkin_parent <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE) +m_saemix_sfo <- saemix_model(f_mmkin_parent["SFO", ]) +m_saemix_fomc <- saemix_model(f_mmkin_parent["FOMC", ]) +m_saemix_dfop <- saemix_model(f_mmkin_parent["DFOP", ]) +d_saemix_parent <- saemix_data(f_mmkin_parent["SFO", ]) +f_saemix_sfo <- saemix(m_saemix_sfo, d_saemix_parent, saemix_options) +f_saemix_fomc <- saemix(m_saemix_fomc, d_saemix_parent, saemix_options) +f_saemix_dfop <- saemix(m_saemix_dfop, d_saemix_parent, saemix_options) +compare.saemix(list(f_saemix_sfo, f_saemix_fomc, f_saemix_dfop)) +f_mmkin_parent_tc <- update(f_mmkin_parent, error_model = "tc") +m_saemix_fomc_tc <- saemix_model(f_mmkin_parent_tc["FOMC", ]) +f_saemix_fomc_tc <- saemix(m_saemix_fomc_tc, d_saemix_parent, saemix_options) +compare.saemix(list(f_saemix_fomc, f_saemix_fomc_tc)) + +dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"), A1 = mkinsub("SFO")) -\dontrun{ -f_mmkin <- mmkin(list("SFO-SFO" = sfo_sfo), ds, quiet = TRUE) -library(saemix) -m_saemix <- saemix_model(f_mmkin, cores = 1) +f_mmkin <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE) +m_saemix <- saemix_model(f_mmkin) d_saemix <- saemix_data(f_mmkin) -saemix_options <- list(seed = 123456, - save = FALSE, save.graphs = FALSE, displayProgress = FALSE, - nbiter.saemix = c(200, 80)) f_saemix <- saemix(m_saemix, d_saemix, saemix_options) -plot(f_saemix, plot.type = "convergence") -} -# Synthetic data with two-component error -sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) -dt50_sfo_in <- c(80, 90, 100, 111.111, 125) -k_in <- log(2) / dt50_sfo_in - -SFO <- mkinmod(parent = mkinsub("SFO")) -pred_sfo <- function(k) { - mkinpredict(SFO, c(k_parent = k), - c(parent = 100), sampling_times) -} - -ds_sfo_mean <- lapply(k_in, pred_sfo) -set.seed(123456L) -ds_sfo_syn <- lapply(ds_sfo_mean, function(ds) { - add_err(ds, sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2), - n = 1)[[1]] - }) -\dontrun{ -f_mmkin_syn <- mmkin("SFO", ds_sfo_syn, error_model = "tc", quiet = TRUE) -# plot(f_mmkin_syn) -m_saemix_tc <- saemix_model(f_mmkin_syn, cores = 1) -d_saemix_tc <- saemix_data(f_mmkin_syn) -f_saemix_tc <- saemix(m_saemix_tc, d_saemix_tc, saemix_options) -plot(f_saemix_tc, plot.type = "convergence") } } |