aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-11-06 00:03:29 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2020-11-06 00:03:29 +0100
commitb5b446b718b15ccaae5b197e147fc1358f0f564e (patch)
treea36f32ee664c6925b5afdb812daca41075968152 /R/mkinfit.R
parent2f24fe0ce70d040e491619d7f2413fc902e433f1 (diff)
Fast analytical solutions for saemix, update.mmkin
Also, use logit transformation for g and for solitary formation fractions, addressing #10.
Diffstat (limited to 'R/mkinfit.R')
-rw-r--r--R/mkinfit.R18
1 files changed, 8 insertions, 10 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index 1b1bb73d..7fa1c56e 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -89,12 +89,11 @@ if(getRversion() >= '2.15.1') utils::globalVariables(c("name", "time", "value"))
#' models and the break point tb of the HS model. If FALSE, zero is used as
#' a lower bound for the rates in the optimisation.
#' @param transform_fractions Boolean specifying if formation fractions
-#' constants should be transformed in the model specification used in the
-#' fitting for better compliance with the assumption of normal distribution
-#' of the estimator. The default (TRUE) is to do transformations. If TRUE,
-#' the g parameter of the DFOP and HS models are also transformed, as they
-#' can also be seen as compositional data. The transformation used for these
-#' transformations is the [ilr()] transformation.
+#' should be transformed in the model specification used in the fitting for
+#' better compliance with the assumption of normal distribution of the
+#' estimator. The default (TRUE) is to do transformations. If TRUE,
+#' the g parameter of the DFOP model is also transformed. Transformations
+#' are described in [transform_odeparms].
#' @param quiet Suppress printing out the current value of the negative
#' log-likelihood after each improvement?
#' @param atol Absolute error tolerance, passed to [deSolve::ode()]. Default
@@ -187,15 +186,14 @@ if(getRversion() >= '2.15.1') utils::globalVariables(c("name", "time", "value"))
#'
#' # Fit the model quietly to the FOCUS example dataset D using defaults
#' fit <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE)
-#' # Since mkin 0.9.50.3, we get a warning about non-normality of residuals,
-#' # so we try an alternative error model
+#' plot_sep(fit)
+#' # As lower parent values appear to have lower variance, we try an alternative error model
#' fit.tc <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE, error_model = "tc")
#' # This avoids the warning, and the likelihood ratio test confirms it is preferable
#' lrtest(fit.tc, fit)
#' # We can also allow for different variances of parent and metabolite as error model
#' fit.obs <- mkinfit(SFO_SFO, FOCUS_D, quiet = TRUE, error_model = "obs")
-#' # This also avoids the warning about non-normality, but the two-component error model
-#' # has significantly higher likelihood
+#' # The two-component error model has significantly higher likelihood
#' lrtest(fit.obs, fit.tc)
#' parms(fit.tc)
#' endpoints(fit.tc)

Contact - Imprint