From d25974f643ee46b7cd5ccd8331dd7bb0b14ab27a Mon Sep 17 00:00:00 2001
From: Johannes Ranke
Date: Wed, 26 Oct 2022 09:36:44 +0200
Subject: Don't test parhist and llhist on travis, docs
---
docs/dev/reference/saem.html | 133 +++++++++++++++++++++++++++++--------------
1 file changed, 89 insertions(+), 44 deletions(-)
(limited to 'docs/dev/reference/saem.html')
diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html
index ce3d428c..c8a7504f 100644
--- a/docs/dev/reference/saem.html
+++ b/docs/dev/reference/saem.html
@@ -46,11 +46,14 @@ Expectation Maximisation algorithm (SAEM).">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
- Example evaluation of FOCUS Example Dataset Z
+ Short demo of the multistart method
Performance benefit by using compiled model definitions in mkin
+
+ Example evaluation of FOCUS Example Dataset Z
+
Calculation of time weighted average concentrations with mkin
@@ -101,6 +104,10 @@ Expectation Maximisation algorithm (SAEM).
test_log_parms = TRUE,
conf.level = 0.6,
solution_type = "auto",
+ covariance.model = "auto",
+ covariates = NULL,
+ covariate_models = NULL,
+ no_random_effect = NULL,
nbiter.saemix = c(300, 100),
control = list(displayProgress = FALSE, print = FALSE, nbiter.saemix = nbiter.saemix,
save = FALSE, save.graphs = FALSE),
@@ -118,13 +125,17 @@ Expectation Maximisation algorithm (SAEM).
solution_type = "auto",
transformations = c("mkin", "saemix"),
degparms_start = numeric(),
+ covariance.model = "auto",
+ no_random_effect = NULL,
+ covariates = NULL,
+ covariate_models = NULL,
test_log_parms = FALSE,
conf.level = 0.6,
verbose = FALSE,
...
)
-saemix_data(object, verbose = FALSE, ...)
+saemix_data(object, covariates = NULL, verbose = FALSE, ...)
# S3 method for saem.mmkin
parms(object, ci = FALSE, ...)
@@ -171,6 +182,29 @@ for parameter that are tested if requested by 'test_log_parms'.
automatic choice is not desired
+covariance.model
+Will be passed to saemix::SaemixModel()
. Per
+default, uncorrelated random effects are specified for all degradation
+parameters.
+
+
+covariates
+A data frame with covariate data for use in
+'covariate_models', with dataset names as row names.
+
+
+covariate_models
+A list containing linear model formulas with one explanatory
+variable, i.e. of the type 'parameter ~ covariate'. Covariates must be available
+in the 'covariates' data frame.
+
+
+no_random_effect
+Character vector of degradation parameters for
+which there should be no variability over the groups. Only used
+if the covariance model is not explicitly specified.
+
+
nbiter.saemix
Convenience option to increase the number of
iterations
@@ -249,40 +283,43 @@ using mmkin.
f_saem_sfo <- saem(f_mmkin_parent["SFO", ])
f_saem_fomc <- saem(f_mmkin_parent["FOMC", ])
f_saem_dfop <- saem(f_mmkin_parent["DFOP", ])
-illparms(f_saem_dfop)
-#> [1] "sd(g_qlogis)"
-update(f_saem_dfop, covariance.model = diag(c(1, 1, 1, 0)))
-#> Kinetic nonlinear mixed-effects model fit by SAEM
-#> Structural model:
-#> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
-#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
-#> * parent
+anova(f_saem_sfo, f_saem_fomc, f_saem_dfop)
+#> Data: 90 observations of 1 variable(s) grouped in 5 datasets
#>
-#> Data:
-#> 90 observations of 1 variable(s) grouped in 5 datasets
+#> npar AIC BIC Lik
+#> f_saem_sfo 5 624.26 622.31 -307.13
+#> f_saem_fomc 7 467.87 465.13 -226.93
+#> f_saem_dfop 9 493.98 490.47 -237.99
+anova(f_saem_sfo, f_saem_dfop, test = TRUE)
+#> Data: 90 observations of 1 variable(s) grouped in 5 datasets
#>
-#> Likelihood computed by importance sampling
-#> AIC BIC logLik
-#> 490.6 487.5 -237.3
+#> npar AIC BIC Lik Chisq Df Pr(>Chisq)
+#> f_saem_sfo 5 624.26 622.31 -307.13
+#> f_saem_dfop 9 493.98 490.47 -237.99 138.28 4 < 2.2e-16 ***
+#> ---
+#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+illparms(f_saem_dfop)
+#> [1] "sd(g_qlogis)"
+f_saem_dfop_red <- update(f_saem_dfop, no_random_effect = "g_qlogis")
+anova(f_saem_dfop, f_saem_dfop_red, test = TRUE)
+#> Data: 90 observations of 1 variable(s) grouped in 5 datasets
#>
-#> Fitted parameters:
-#> estimate lower upper
-#> parent_0 93.902 91.3695 96.4339
-#> log_k1 -2.936 -3.9950 -1.8762
-#> log_k2 -3.091 -4.9290 -1.2523
-#> g_qlogis -0.366 -0.6484 -0.0836
-#> a.1 2.385 2.0033 2.7664
-#> SD.parent_0 2.476 0.3890 4.5623
-#> SD.log_k1 1.195 0.4381 1.9517
-#> SD.log_k2 2.092 0.7906 3.3932
-AIC(f_saem_dfop)
-#> [1] 493.9811
+#> npar AIC BIC Lik Chisq Df Pr(>Chisq)
+#> f_saem_dfop_red 8 490.64 487.52 -237.32
+#> f_saem_dfop 9 493.98 490.47 -237.99 0 1 1
+anova(f_saem_sfo, f_saem_fomc, f_saem_dfop)
+#> Data: 90 observations of 1 variable(s) grouped in 5 datasets
+#>
+#> npar AIC BIC Lik
+#> f_saem_sfo 5 624.26 622.31 -307.13
+#> f_saem_fomc 7 467.87 465.13 -226.93
+#> f_saem_dfop 9 493.98 490.47 -237.99
# The returned saem.mmkin object contains an SaemixObject, therefore we can use
# functions from saemix
library(saemix)
#> Loading required package: npde
-#> Package saemix, version 3.1
+#> Package saemix, version 3.2
#> please direct bugs, questions and feedback to emmanuelle.comets@inserm.fr
#>
#> Attaching package: ‘saemix’
@@ -308,11 +345,12 @@ using mmkin.
f_mmkin_parent_tc <- update(f_mmkin_parent, error_model = "tc")
f_saem_fomc_tc <- saem(f_mmkin_parent_tc["FOMC", ])
-compare.saemix(f_saem_fomc$so, f_saem_fomc_tc$so)
-#> Likelihoods calculated by importance sampling
-#> AIC BIC
-#> 1 467.8664 465.1324
-#> 2 469.8018 466.6773
+anova(f_saem_fomc, f_saem_fomc_tc, test = TRUE)
+#> Data: 90 observations of 1 variable(s) grouped in 5 datasets
+#>
+#> npar AIC BIC Lik Chisq Df Pr(>Chisq)
+#> f_saem_fomc 7 467.87 465.13 -226.93
+#> f_saem_fomc_tc 8 469.80 466.68 -226.90 0.0645 1 0.7995
sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"),
A1 = mkinsub("SFO"))
@@ -370,11 +408,11 @@ using mmkin.
plot(f_saem_dfop_sfo)
summary(f_saem_dfop_sfo, data = TRUE)
-#> saemix version used for fitting: 3.1
+#> saemix version used for fitting: 3.2
#> mkin version used for pre-fitting: 1.1.2
#> R version used for fitting: 4.2.1
-#> Date of fit: Fri Sep 16 10:30:47 2022
-#> Date of summary: Fri Sep 16 10:30:47 2022
+#> Date of fit: Wed Oct 26 09:20:37 2022
+#> Date of summary: Wed Oct 26 09:20:37 2022
#>
#> Equations:
#> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -389,7 +427,7 @@ using mmkin.
#>
#> Model predictions using solution type analytical
#>
-#> Fitted in 9.651 s
+#> Fitted in 8.902 s
#> Using 300, 100 iterations and 10 chains
#>
#> Variance model: Constant variance
@@ -410,13 +448,20 @@ using mmkin.
#> 842 836.9 -408
#>
#> Optimised parameters:
-#> est. lower upper
-#> parent_0 93.7701 91.1458 96.3945
-#> log_k_A1 -5.8116 -7.5998 -4.0234
-#> f_parent_qlogis -0.9608 -1.3654 -0.5562
-#> log_k1 -2.5841 -3.6876 -1.4805
-#> log_k2 -3.5228 -5.3254 -1.7203
-#> g_qlogis -0.1027 -0.8719 0.6665
+#> est. lower upper
+#> parent_0 93.7701 91.1458 96.3945
+#> log_k_A1 -5.8116 -7.5998 -4.0234
+#> f_parent_qlogis -0.9608 -1.3654 -0.5562
+#> log_k1 -2.5841 -3.6876 -1.4805
+#> log_k2 -3.5228 -5.3254 -1.7203
+#> g_qlogis -0.1027 -0.8719 0.6665
+#> a.1 1.8856 1.6676 2.1037
+#> SD.parent_0 2.7682 0.7668 4.7695
+#> SD.log_k_A1 1.7447 0.4047 3.0848
+#> SD.f_parent_qlogis 0.4525 0.1620 0.7431
+#> SD.log_k1 1.2423 0.4560 2.0285
+#> SD.log_k2 2.0390 0.7601 3.3180
+#> SD.g_qlogis 0.4439 -0.3069 1.1947
#>
#> Correlation:
#> parnt_0 lg_k_A1 f_prnt_ log_k1 log_k2
--
cgit v1.2.1