From c73b2f30ec836c949885784ab576e814eb8070a9 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 9 Mar 2021 17:35:47 +0100 Subject: Some improvements for borderline cases - fit_with_errors for saem() - test_log_parms for mean_degparms() and saem() --- R/nlme.mmkin.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'R/nlme.mmkin.R') diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R index ff1f2fff..306600c6 100644 --- a/R/nlme.mmkin.R +++ b/R/nlme.mmkin.R @@ -24,7 +24,7 @@ get_deg_func <- function() { #' This functions sets up a nonlinear mixed effects model for an mmkin row #' object. An mmkin row object is essentially a list of mkinfit objects that #' have been obtained by fitting the same model to a list of datasets. -#' +#' #' Note that the convergence of the nlme algorithms depends on the quality #' of the data. In degradation kinetics, we often only have few datasets #' (e.g. data for few soils) and complicated degradation models, which may -- cgit v1.2.1 From c6eb6b2bb598002523c3d34d71b0e4a99671ccd6 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 9 Jun 2021 16:53:31 +0200 Subject: Rudimentary support for setting up nlmixr models - All degradation models are specified as ODE models. This appears to be fast enough - Error models are being translated to nlmixr as close to the mkin error model as possible. When using the 'saem' backend, it appears not to be possible to use the same error model for more than one observed variable - No support yet for models with parallel formation of metabolites, where the ilr transformation is used in mkin per default - There is a bug in nlmixr which appears to be triggered if the data are not balanced, see nlmixrdevelopment/nlmixr#530 - There is a print and a plot method, the summary method is not finished --- R/nlme.mmkin.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'R/nlme.mmkin.R') diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R index 306600c6..a1aa32e5 100644 --- a/R/nlme.mmkin.R +++ b/R/nlme.mmkin.R @@ -135,7 +135,7 @@ nlme.mmkin <- function(model, data = "auto", function(el) eval(parse(text = paste(el, 1, sep = "~")))), random = pdDiag(fixed), groups, - start = mean_degparms(model, random = TRUE), + start = mean_degparms(model, random = TRUE, test_log_parms = TRUE), correlation = NULL, weights = NULL, subset, method = c("ML", "REML"), na.action = na.fail, naPattern, -- cgit v1.2.1 From d9577db290a7fb8944d9a79af59ae90fc00a3eaa Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 23 Jun 2021 17:01:25 +0200 Subject: Fix documentation of default random effects for nlme.mmkin --- R/nlme.mmkin.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'R/nlme.mmkin.R') diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R index a1aa32e5..7049a9a1 100644 --- a/R/nlme.mmkin.R +++ b/R/nlme.mmkin.R @@ -34,10 +34,9 @@ get_deg_func <- function() { #' @param data Ignored, data are taken from the mmkin model #' @param fixed Ignored, all degradation parameters fitted in the #' mmkin model are used as fixed parameters -#' @param random If not specified, correlated random effects are set up -#' for all optimised degradation model parameters using the log-Cholesky -#' parameterization [nlme::pdLogChol] that is also the default of -#' the generic [nlme] method. +#' @param random If not specified, no correlations between random effects are +#' set up for the optimised degradation model parameters. This is +#' achieved by using the [nlme::pdDiag] method. #' @param groups See the documentation of nlme #' @param start If not specified, mean values of the fitted degradation #' parameters taken from the mmkin object are used -- cgit v1.2.1