diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-12-08 22:08:38 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-12-08 22:08:38 +0100 |
commit | f606838c5310f365eea1c0d6421f5c3636a4dc79 (patch) | |
tree | bdf4fdb5cb3a94cc46176f9e69132af11e81f749 /man | |
parent | 2663158c85fca9c088d1f8cfa3bc05ad1ac36f94 (diff) |
mixed.mmkin and test coverage
Diffstat (limited to 'man')
-rw-r--r-- | man/mixed.Rd | 69 | ||||
-rw-r--r-- | man/mkinmod.Rd | 4 | ||||
-rw-r--r-- | man/plot.mixed.mmkin.Rd | 2 | ||||
-rw-r--r-- | man/saem.Rd | 26 |
4 files changed, 94 insertions, 7 deletions
diff --git a/man/mixed.Rd b/man/mixed.Rd new file mode 100644 index 00000000..8b00382d --- /dev/null +++ b/man/mixed.Rd @@ -0,0 +1,69 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mixed.mmkin.R +\name{mixed} +\alias{mixed} +\alias{mixed.mmkin} +\alias{print.mixed.mmkin} +\title{Create a mixed effects model from an mmkin row object} +\usage{ +mixed(object, ...) + +\method{mixed}{mmkin}(object, method = c("none"), ...) + +\method{print}{mixed.mmkin}(x, digits = max(3, getOption("digits") - 3), ...) +} +\arguments{ +\item{object}{An \link{mmkin} row object} + +\item{\dots}{Currently not used} + +\item{method}{The method to be used} + +\item{x}{A mixed.mmkin object to print} + +\item{digits}{Number of digits to use for printing.} +} +\description{ +Create a mixed effects model from an mmkin row object +} +\examples{ +sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) +n_biphasic <- 8 +err_1 = list(const = 1, prop = 0.07) + +DFOP_SFO <- mkinmod( + parent = mkinsub("DFOP", "m1"), + m1 = mkinsub("SFO"), + quiet = TRUE) + +set.seed(123456) +log_sd <- 0.3 +syn_biphasic_parms <- as.matrix(data.frame( + k1 = rlnorm(n_biphasic, log(0.05), log_sd), + k2 = rlnorm(n_biphasic, log(0.01), log_sd), + g = plogis(rnorm(n_biphasic, 0, log_sd)), + f_parent_to_m1 = plogis(rnorm(n_biphasic, 0, log_sd)), + k_m1 = rlnorm(n_biphasic, log(0.002), log_sd))) + +ds_biphasic_mean <- lapply(1:n_biphasic, + function(i) { + mkinpredict(DFOP_SFO, syn_biphasic_parms[i, ], + c(parent = 100, m1 = 0), sampling_times) + } +) + +set.seed(123456L) +ds_biphasic <- lapply(ds_biphasic_mean, function(ds) { + add_err(ds, + sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2), + n = 1, secondary = "m1")[[1]] +}) + +\dontrun{ +f_mmkin <- mmkin(list("DFOP-SFO" = DFOP_SFO), ds_biphasic, error_model = "tc", quiet = TRUE) + +f_mixed <- mixed(f_mmkin) +print(f_mixed) +plot(f_mixed) +} +} diff --git a/man/mkinmod.Rd b/man/mkinmod.Rd index 95cec09a..bf073634 100644 --- a/man/mkinmod.Rd +++ b/man/mkinmod.Rd @@ -41,8 +41,8 @@ In print.mkinmod, this argument is currently not used.} \item{use_of_ff}{Specification of the use of formation fractions in the model equations and, if applicable, the coefficient matrix. If "max", formation fractions are always used (default). If "min", a minimum use of -formation fractions is made, i.e. each pathway to a metabolite has its -own rate constant.} +formation fractions is made, i.e. each first-order pathway to a metabolite +has its own rate constant.} \item{name}{A name for the model. Should be a valid R object name.} diff --git a/man/plot.mixed.mmkin.Rd b/man/plot.mixed.mmkin.Rd index 66e79f09..b90a4b3a 100644 --- a/man/plot.mixed.mmkin.Rd +++ b/man/plot.mixed.mmkin.Rd @@ -26,7 +26,7 @@ ) } \arguments{ -\item{x}{An object of class \link{saem.mmkin} or \link{nlme.mmkin}} +\item{x}{An object of class \link{mixed.mmkin}, \link{saem.mmkin} or \link{nlme.mmkin}} \item{i}{A numeric index to select datasets for which to plot the individual predictions, in case plots get too large} diff --git a/man/saem.Rd b/man/saem.Rd index ef5480f1..d8d6ea0f 100644 --- a/man/saem.Rd +++ b/man/saem.Rd @@ -8,10 +8,12 @@ \alias{saemix_data} \title{Fit nonlinear mixed models with SAEM} \usage{ -saem(object, control, ...) +saem(object, ...) \method{saem}{mmkin}( object, + transformations = c("mkin", "saemix"), + solution_type = "auto", control = list(displayProgress = FALSE, print = FALSE, save = FALSE, save.graphs = FALSE), cores = 1, @@ -23,7 +25,14 @@ saem(object, control, ...) \method{print}{saem.mmkin}(x, digits = max(3, getOption("digits") - 3), ...) -saemix_model(object, cores = 1, verbose = FALSE, ...) +saemix_model( + object, + solution_type = "auto", + transformations = c("mkin", "saemix"), + cores = 1, + verbose = FALSE, + ... +) saemix_data(object, verbose = FALSE, ...) } @@ -31,10 +40,19 @@ saemix_data(object, verbose = FALSE, ...) \item{object}{An \link{mmkin} row object containing several fits of the same \link{mkinmod} model to different datasets} -\item{control}{Passed to \link[saemix:saemix]{saemix::saemix}} - \item{\dots}{Further parameters passed to \link[saemix:saemixModel]{saemix::saemixModel}.} +\item{transformations}{Per default, all parameter transformations are done +in mkin. If this argument is set to 'saemix', parameter transformations +are done in 'saemix' for the supported cases. Currently this is only +supported in cases where the initial concentration of the parent is not fixed, +SFO or DFOP is used for the parent and there is either no metabolite or one.} + +\item{solution_type}{Possibility to specify the solution type in case the +automatic choice is not desired} + +\item{control}{Passed to \link[saemix:saemix]{saemix::saemix}} + \item{cores}{The number of cores to be used for multicore processing using \code{\link[parallel:mclapply]{parallel::mclapply()}}. Using more than 1 core is experimental and may lead to excessive forking, apparently depending on the BLAS version |