aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
Diffstat (limited to 'man')
-rw-r--r--man/anova.saem.mmkin.Rd36
-rw-r--r--man/aw.Rd6
-rw-r--r--man/illparms.Rd73
-rw-r--r--man/llhist.Rd26
-rw-r--r--man/logLik.saem.mmkin.Rd18
-rw-r--r--man/mhmkin.Rd75
-rw-r--r--man/mkinfit.Rd4
-rw-r--r--man/multistart.Rd103
-rw-r--r--man/parms.Rd40
-rw-r--r--man/parplot.Rd46
-rw-r--r--man/saem.Rd45
-rw-r--r--man/set_nd_nq.Rd103
-rw-r--r--man/status.Rd44
-rw-r--r--man/summary.mkinfit.Rd2
-rw-r--r--man/summary.mmkin.Rd36
-rw-r--r--man/summary.saem.mmkin.Rd7
16 files changed, 640 insertions, 24 deletions
diff --git a/man/anova.saem.mmkin.Rd b/man/anova.saem.mmkin.Rd
new file mode 100644
index 00000000..ab6022bc
--- /dev/null
+++ b/man/anova.saem.mmkin.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/anova.saem.mmkin.R
+\name{anova.saem.mmkin}
+\alias{anova.saem.mmkin}
+\title{Anova method for saem.mmkin objects}
+\usage{
+\method{anova}{saem.mmkin}(
+ object,
+ ...,
+ method = c("is", "lin", "gq"),
+ test = FALSE,
+ model.names = NULL
+)
+}
+\arguments{
+\item{object}{An \link{saem.mmkin} object}
+
+\item{...}{further such objects}
+
+\item{method}{Method for likelihood calculation: "is" (importance sampling),
+"lin" (linear approximation), or "gq" (Gaussian quadrature). Passed
+to \link[saemix:logLik]{saemix::logLik.SaemixObject}}
+
+\item{test}{Should a likelihood ratio test be performed? If TRUE,
+the alternative models are tested against the first model. Should
+only be done for nested models.}
+
+\item{model.names}{Optional character vector of model names}
+}
+\value{
+an "anova" data frame; the traditional (S3) result of anova()
+}
+\description{
+Generate an anova object. The method to calculate the BIC is that from
+the saemix package. As in other prominent anova methods, models are sorted
+}
diff --git a/man/aw.Rd b/man/aw.Rd
index 40676716..9aad2c37 100644
--- a/man/aw.Rd
+++ b/man/aw.Rd
@@ -4,6 +4,8 @@
\alias{aw}
\alias{aw.mkinfit}
\alias{aw.mmkin}
+\alias{aw.mixed.mmkin}
+\alias{aw.multistart}
\title{Calculate Akaike weights for model averaging}
\usage{
aw(object, ...)
@@ -11,6 +13,10 @@ aw(object, ...)
\method{aw}{mkinfit}(object, ...)
\method{aw}{mmkin}(object, ...)
+
+\method{aw}{mixed.mmkin}(object, ...)
+
+\method{aw}{multistart}(object, ...)
}
\arguments{
\item{object}{An \link{mmkin} column object, containing two or more
diff --git a/man/illparms.Rd b/man/illparms.Rd
new file mode 100644
index 00000000..90adf2bb
--- /dev/null
+++ b/man/illparms.Rd
@@ -0,0 +1,73 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/illparms.R
+\name{illparms}
+\alias{illparms}
+\alias{illparms.mkinfit}
+\alias{illparms.mmkin}
+\alias{print.illparms.mmkin}
+\alias{illparms.saem.mmkin}
+\alias{illparms.mhmkin}
+\alias{print.illparms.mhmkin}
+\title{Method to get the names of ill-defined parameters}
+\usage{
+illparms(object, ...)
+
+\method{illparms}{mkinfit}(object, conf.level = 0.95, ...)
+
+\method{illparms}{mmkin}(object, conf.level = 0.95, ...)
+
+\method{print}{illparms.mmkin}(x, ...)
+
+\method{illparms}{saem.mmkin}(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...)
+
+\method{illparms}{mhmkin}(object, conf.level = 0.95, random = TRUE, errmod = TRUE, ...)
+
+\method{print}{illparms.mhmkin}(x, ...)
+}
+\arguments{
+\item{object}{The object to investigate}
+
+\item{\dots}{For potential future extensions}
+
+\item{conf.level}{The confidence level for checking p values}
+
+\item{x}{The object to be printed}
+
+\item{random}{For hierarchical fits, should random effects be tested?}
+
+\item{errmod}{For hierarchical fits, should error model parameters be
+tested?}
+}
+\value{
+For \link{mkinfit} or \link{saem} objects, a character vector of parameter
+names. For \link{mmkin} or \link{mhmkin} objects, a matrix like object of class
+'illparms.mmkin' or 'illparms.mhmkin'. The latter objects have a suitable
+printing method.
+}
+\description{
+The method for generalised nonlinear regression fits as obtained
+with \link{mkinfit} and \link{mmkin} checks if the degradation parameters
+pass the Wald test (in degradation kinetics often simply called t-test) for
+significant difference from zero. For this test, the parameterisation
+without parameter transformations is used.
+}
+\details{
+The method for hierarchical model fits, also known as nonlinear
+mixed-effects model fits as obtained with \link{saem} and \link{mhmkin}
+checks if any of the confidence intervals for the random
+effects expressed as standard deviations include zero, and if
+the confidence intervals for the error model parameters include
+zero.
+}
+\examples{
+fit <- mkinfit("FOMC", FOCUS_2006_A, quiet = TRUE)
+illparms(fit)
+\dontrun{
+fits <- mmkin(
+ c("SFO", "FOMC"),
+ list("FOCUS A" = FOCUS_2006_A,
+ "FOCUS C" = FOCUS_2006_C),
+ quiet = TRUE)
+illparms(fits)
+}
+}
diff --git a/man/llhist.Rd b/man/llhist.Rd
new file mode 100644
index 00000000..bec30ecf
--- /dev/null
+++ b/man/llhist.Rd
@@ -0,0 +1,26 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/llhist.R
+\name{llhist}
+\alias{llhist}
+\title{Plot the distribution of log likelihoods from multistart objects}
+\usage{
+llhist(object, breaks = "Sturges", lpos = "topleft", main = "", ...)
+}
+\arguments{
+\item{object}{The \link{multistart} object}
+
+\item{breaks}{Passed to \link{hist}}
+
+\item{lpos}{Positioning of the legend.}
+
+\item{main}{Title of the plot}
+
+\item{\dots}{Passed to \link{hist}}
+}
+\description{
+Produces a histogram of log-likelihoods. In addition, the likelihood of the
+original fit is shown as a red vertical line.
+}
+\seealso{
+\link{multistart}
+}
diff --git a/man/logLik.saem.mmkin.Rd b/man/logLik.saem.mmkin.Rd
new file mode 100644
index 00000000..bd0bb72e
--- /dev/null
+++ b/man/logLik.saem.mmkin.Rd
@@ -0,0 +1,18 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/saem.R
+\name{logLik.saem.mmkin}
+\alias{logLik.saem.mmkin}
+\title{logLik method for saem.mmkin objects}
+\usage{
+\method{logLik}{saem.mmkin}(object, ..., method = c("is", "lin", "gq"))
+}
+\arguments{
+\item{object}{The fitted \link{saem.mmkin} object}
+
+\item{\dots}{Passed to \link[saemix:logLik]{saemix::logLik.SaemixObject}}
+
+\item{method}{Passed to \link[saemix:logLik]{saemix::logLik.SaemixObject}}
+}
+\description{
+logLik method for saem.mmkin objects
+}
diff --git a/man/mhmkin.Rd b/man/mhmkin.Rd
new file mode 100644
index 00000000..0ef1599e
--- /dev/null
+++ b/man/mhmkin.Rd
@@ -0,0 +1,75 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/mhmkin.R
+\name{mhmkin}
+\alias{mhmkin}
+\alias{mhmkin.list}
+\alias{[.mhmkin}
+\alias{print.mhmkin}
+\title{Fit nonlinear mixed-effects models built from one or more kinetic
+degradation models and one or more error models}
+\usage{
+mhmkin(objects, backend = "saemix", algorithm = "saem", ...)
+
+\method{mhmkin}{list}(
+ objects,
+ backend = "saemix",
+ ...,
+ cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
+ cluster = NULL
+)
+
+\method{[}{mhmkin}(x, i, j, ..., drop = FALSE)
+
+\method{print}{mhmkin}(x, ...)
+}
+\arguments{
+\item{objects}{A list of \link{mmkin} objects containing fits of the same
+degradation models to the same data, but using different error models.}
+
+\item{backend}{The backend to be used for fitting. Currently, only saemix is
+supported}
+
+\item{algorithm}{The algorithm to be used for fitting (currently not used)}
+
+\item{\dots}{Further arguments that will be passed to the nonlinear mixed-effects
+model fitting function.}
+
+\item{cores}{The number of cores to be used for multicore processing. This
+is only used when the \code{cluster} argument is \code{NULL}. On Windows
+machines, cores > 1 is not supported, you need to use the \code{cluster}
+argument to use multiple logical processors. Per default, all cores detected
+by \code{\link[parallel:detectCores]{parallel::detectCores()}} are used, except on Windows where the default
+is 1.}
+
+\item{cluster}{A cluster as returned by \link{makeCluster} to be used for
+parallel execution.}
+
+\item{x}{An \link{mhmkin} object.}
+
+\item{i}{Row index selecting the fits for specific models}
+
+\item{j}{Column index selecting the fits to specific datasets}
+
+\item{drop}{If FALSE, the method always returns an mhmkin object, otherwise
+either a list of fit objects or a single fit object.}
+}
+\value{
+A two-dimensional \link{array} of fit objects and/or try-errors that can
+be indexed using the degradation model names for the first index (row index)
+and the error model names for the second index (column index), with class
+attribute 'mhmkin'.
+
+An object of class \code{\link{mhmkin}}.
+}
+\description{
+The name of the methods expresses that (\strong{m}ultiple) \strong{h}ierarchichal
+(also known as multilevel) \strong{m}ulticompartment \strong{kin}etic models are
+fitted. Our kinetic models are nonlinear, so we can use various nonlinear
+mixed-effects model fitting functions.
+}
+\seealso{
+\code{\link{[.mhmkin}} for subsetting \link{mhmkin} objects
+}
+\author{
+Johannes Ranke
+}
diff --git a/man/mkinfit.Rd b/man/mkinfit.Rd
index b5b24449..f96b4d22 100644
--- a/man/mkinfit.Rd
+++ b/man/mkinfit.Rd
@@ -23,8 +23,8 @@ mkinfit(
atol = 1e-08,
rtol = 1e-10,
error_model = c("const", "obs", "tc"),
- error_model_algorithm = c("auto", "d_3", "direct", "twostep", "threestep",
- "fourstep", "IRLS", "OLS"),
+ error_model_algorithm = c("auto", "d_3", "direct", "twostep", "threestep", "fourstep",
+ "IRLS", "OLS"),
reweight.tol = 1e-08,
reweight.max.iter = 10,
trace_parms = FALSE,
diff --git a/man/multistart.Rd b/man/multistart.Rd
new file mode 100644
index 00000000..5a5f7b44
--- /dev/null
+++ b/man/multistart.Rd
@@ -0,0 +1,103 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/multistart.R
+\name{multistart}
+\alias{multistart}
+\alias{multistart.saem.mmkin}
+\alias{print.multistart}
+\alias{best}
+\alias{best.default}
+\alias{which.best}
+\alias{which.best.default}
+\title{Perform a hierarchical model fit with multiple starting values}
+\usage{
+multistart(
+ object,
+ n = 50,
+ cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
+ cluster = NULL,
+ ...
+)
+
+\method{multistart}{saem.mmkin}(object, n = 50, cores = 1, cluster = NULL, ...)
+
+\method{print}{multistart}(x, ...)
+
+best(object, ...)
+
+\method{best}{default}(object, ...)
+
+which.best(object, ...)
+
+\method{which.best}{default}(object, ...)
+}
+\arguments{
+\item{object}{The fit object to work with}
+
+\item{n}{How many different combinations of starting parameters should be
+used?}
+
+\item{cores}{How many fits should be run in parallel (only on posix platforms)?}
+
+\item{cluster}{A cluster as returned by \link[parallel:makeCluster]{parallel::makeCluster} to be used
+for parallel execution.}
+
+\item{\dots}{Passed to the update function.}
+
+\item{x}{The multistart object to print}
+}
+\value{
+A list of \link{saem.mmkin} objects, with class attributes
+'multistart.saem.mmkin' and 'multistart'.
+
+The object with the highest likelihood
+
+The index of the object with the highest likelihood
+}
+\description{
+The purpose of this method is to check if a certain algorithm for fitting
+nonlinear hierarchical models (also known as nonlinear mixed-effects models)
+will reliably yield results that are sufficiently similar to each other, if
+started with a certain range of reasonable starting parameters. It is
+inspired by the article on practical identifiabiliy in the frame of nonlinear
+mixed-effects models by Duchesne et al (2021).
+}
+\examples{
+\dontrun{
+library(mkin)
+dmta_ds <- lapply(1:7, function(i) {
+ ds_i <- dimethenamid_2018$ds[[i]]$data
+ ds_i[ds_i$name == "DMTAP", "name"] <- "DMTA"
+ ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
+ ds_i
+})
+names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
+dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
+dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
+
+f_mmkin <- mmkin("DFOP", dmta_ds, error_model = "tc", cores = 7, quiet = TRUE)
+f_saem_full <- saem(f_mmkin)
+f_saem_full_multi <- multistart(f_saem_full, n = 16, cores = 16)
+parplot(f_saem_full_multi, lpos = "topleft")
+illparms(f_saem_full)
+
+f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2")
+illparms(f_saem_reduced)
+# On Windows, we need to create a cluster first. When working with
+# such a cluster, we need to export the mmkin object to the cluster
+# nodes, as it is referred to when updating the saem object on the nodes.
+library(parallel)
+cl <- makePSOCKcluster(12)
+f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl)
+parplot(f_saem_reduced_multi, lpos = "topright")
+stopCluster(cl)
+}
+}
+\references{
+Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical
+identifiability in the frame of nonlinear mixed effects models: the example
+of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478.
+doi: 10.1186/s12859-021-04373-4.
+}
+\seealso{
+\link{parplot}, \link{llhist}
+}
diff --git a/man/parms.Rd b/man/parms.Rd
index af92bd2a..5c0e8895 100644
--- a/man/parms.Rd
+++ b/man/parms.Rd
@@ -1,36 +1,43 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/parms.mkinfit.R
+% Please edit documentation in R/parms.R
\name{parms}
\alias{parms}
\alias{parms.mkinfit}
\alias{parms.mmkin}
-\title{Extract model parameters from mkinfit models}
+\alias{parms.multistart}
+\title{Extract model parameters}
\usage{
parms(object, ...)
-\method{parms}{mkinfit}(object, transformed = FALSE, ...)
+\method{parms}{mkinfit}(object, transformed = FALSE, errparms = TRUE, ...)
-\method{parms}{mmkin}(object, transformed = FALSE, ...)
+\method{parms}{mmkin}(object, transformed = FALSE, errparms = TRUE, ...)
+
+\method{parms}{multistart}(object, exclude_failed = TRUE, ...)
}
\arguments{
-\item{object}{A fitted model object. Methods are implemented for
-\code{\link[=mkinfit]{mkinfit()}} objects and for \code{\link[=mmkin]{mmkin()}} objects.}
+\item{object}{A fitted model object.}
\item{\dots}{Not used}
-\item{transformed}{Should the parameters be returned
-as used internally during the optimisation?}
+\item{transformed}{Should the parameters be returned as used internally
+during the optimisation?}
+
+\item{errparms}{Should the error model parameters be returned
+in addition to the degradation parameters?}
+
+\item{exclude_failed}{For \link{multistart} objects, should rows for failed fits
+be removed from the returned parameter matrix?}
}
\value{
-For mkinfit objects, a numeric vector of fitted model parameters.
-For mmkin row objects, a matrix with the parameters with a
-row for each dataset. If the mmkin object has more than one row, a list of
-such matrices is returned.
+Depending on the object, a numeric vector of fitted model parameters,
+a matrix (e.g. for mmkin row objects), or a list of matrices (e.g. for
+mmkin objects with more than one row).
}
\description{
-This function always returns degradation model parameters as well as error
-model parameters, in order to avoid working with a fitted model without
-considering the error structure that was assumed for the fit.
+This function returns degradation model parameters as well as error
+model parameters per default, in order to avoid working with a fitted model
+without considering the error structure that was assumed for the fit.
}
\examples{
# mkinfit objects
@@ -50,3 +57,6 @@ parms(fits)
parms(fits, transformed = TRUE)
}
}
+\seealso{
+\link{saem}, \link{multistart}
+}
diff --git a/man/parplot.Rd b/man/parplot.Rd
new file mode 100644
index 00000000..37c5841d
--- /dev/null
+++ b/man/parplot.Rd
@@ -0,0 +1,46 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/parplot.R
+\name{parplot}
+\alias{parplot}
+\alias{parplot.multistart.saem.mmkin}
+\title{Plot parameter variability of multistart objects}
+\usage{
+parplot(object, ...)
+
+\method{parplot}{multistart.saem.mmkin}(
+ object,
+ llmin = -Inf,
+ scale = c("best", "median"),
+ lpos = "bottomleft",
+ main = "",
+ ...
+)
+}
+\arguments{
+\item{object}{The \link{multistart} object}
+
+\item{\dots}{Passed to \link{boxplot}}
+
+\item{llmin}{The minimum likelihood of objects to be shown}
+
+\item{scale}{By default, scale parameters using the best available fit.
+If 'median', parameters are scaled using the median parameters from all fits.}
+
+\item{lpos}{Positioning of the legend.}
+
+\item{main}{Title of the plot}
+}
+\description{
+Produces a boxplot with all parameters from the multiple runs, scaled
+either by the parameters of the run with the highest likelihood,
+or by their medians as proposed in the paper by Duchesne et al. (2021).
+}
+\references{
+Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical
+identifiability in the frame of nonlinear mixed effects models: the example
+of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478.
+doi: 10.1186/s12859-021-04373-4.
+}
+\seealso{
+\link{multistart}
+}
diff --git a/man/saem.Rd b/man/saem.Rd
index 0c066dd2..d7b04691 100644
--- a/man/saem.Rd
+++ b/man/saem.Rd
@@ -6,6 +6,7 @@
\alias{print.saem.mmkin}
\alias{saemix_model}
\alias{saemix_data}
+\alias{parms.saem.mmkin}
\title{Fit nonlinear mixed models with SAEM}
\usage{
saem(object, ...)
@@ -17,6 +18,10 @@ saem(object, ...)
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),
@@ -33,13 +38,19 @@ saemix_model(
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, ...)
+
+\method{parms}{saem.mmkin}(object, ci = FALSE, ...)
}
\arguments{
\item{object}{An \link{mmkin} row object containing several fits of the same
@@ -49,9 +60,9 @@ saemix_data(object, verbose = FALSE, ...)
\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.}
+are done in 'saemix' for the supported cases, i.e. (as of version 1.1.2)
+SFO, FOMC, DFOP and HS without fixing \code{parent_0}, and SFO or DFOP with
+one SFO metabolite.}
\item{degparms_start}{Parameter values given as a named numeric vector will
be used to override the starting values obtained from the 'mmkin' object.}
@@ -67,6 +78,21 @@ for parameter that are tested if requested by 'test_log_parms'.}
\item{solution_type}{Possibility to specify the solution type in case the
automatic choice is not desired}
+\item{covariance.model}{Will be passed to \code{\link[saemix:SaemixModel-class]{saemix::SaemixModel()}}. Per
+default, uncorrelated random effects are specified for all degradation
+parameters.}
+
+\item{covariates}{A data frame with covariate data for use in
+'covariate_models', with dataset names as row names.}
+
+\item{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.}
+
+\item{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.}
+
\item{nbiter.saemix}{Convenience option to increase the number of
iterations}
@@ -84,6 +110,9 @@ and the end of the optimisation process?}
\item{x}{An saem.mmkin object to print}
\item{digits}{Number of digits to use for printing}
+
+\item{ci}{Should a matrix with estimates and confidence interval boundaries
+be returned? If FALSE (default), a vector of estimates is returned.}
}
\value{
An S3 object of class 'saem.mmkin', containing the fitted
@@ -120,7 +149,13 @@ f_mmkin_parent <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE)
f_saem_sfo <- saem(f_mmkin_parent["SFO", ])
f_saem_fomc <- saem(f_mmkin_parent["FOMC", ])
f_saem_dfop <- saem(f_mmkin_parent["DFOP", ])
+anova(f_saem_sfo, f_saem_fomc, f_saem_dfop)
+anova(f_saem_sfo, f_saem_dfop, test = TRUE)
+illparms(f_saem_dfop)
+f_saem_dfop_red <- update(f_saem_dfop, no_random_effect = "g_qlogis")
+anova(f_saem_dfop, f_saem_dfop_red, test = TRUE)
+anova(f_saem_sfo, f_saem_fomc, f_saem_dfop)
# The returned saem.mmkin object contains an SaemixObject, therefore we can use
# functions from saemix
library(saemix)
@@ -132,7 +167,7 @@ plot(f_saem_fomc$so, plot.type = "vpc")
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)
+anova(f_saem_fomc, f_saem_fomc_tc, test = TRUE)
sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"),
A1 = mkinsub("SFO"))
diff --git a/man/set_nd_nq.Rd b/man/set_nd_nq.Rd
new file mode 100644
index 00000000..87a3fae1
--- /dev/null
+++ b/man/set_nd_nq.Rd
@@ -0,0 +1,103 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/set_nd_nq.R
+\name{set_nd_nq}
+\alias{set_nd_nq}
+\alias{set_nd_nq_focus}
+\title{Set non-detects and unquantified values in residue series without replicates}
+\usage{
+set_nd_nq(res_raw, lod, loq = NA, time_zero_presence = FALSE)
+
+set_nd_nq_focus(
+ res_raw,
+ lod,
+ loq = NA,
+ set_first_sample_nd = TRUE,
+ first_sample_nd_value = 0,
+ ignore_below_loq_after_first_nd = TRUE
+)
+}
+\arguments{
+\item{res_raw}{Character vector of a residue time series, or matrix of
+residue values with rows representing depth profiles for a specific sampling
+time, and columns representing time series of residues at the same depth.
+Values below the limit of detection (lod) have to be coded as "nd", values
+between the limit of detection and the limit of quantification, if any, have
+to be coded as "nq". Samples not analysed have to be coded as "na". All
+values that are not "na", "nd" or "nq" have to be coercible to numeric}
+
+\item{lod}{Limit of detection (numeric)}
+
+\item{loq}{Limit of quantification(numeric). Must be specified if the FOCUS rule to
+stop after the first non-detection is to be applied}
+
+\item{time_zero_presence}{Do we assume that residues occur at time zero?
+This only affects samples from the first sampling time that have been
+reported as "nd" (not detected).}
+
+\item{set_first_sample_nd}{Should the first sample be set to "first_sample_nd_value"
+in case it is a non-detection?}
+
+\item{first_sample_nd_value}{Value to be used for the first sample if it is a non-detection}
+
+\item{ignore_below_loq_after_first_nd}{Should we ignore values below the LOQ after the first
+non-detection that occurs after the quantified values?}
+}
+\value{
+A numeric vector, if a vector was supplied, or a numeric matrix otherwise
+}
+\description{
+This function automates replacing unquantified values in residue time and
+depth series. For time series, the function performs part of the residue
+processing proposed in the FOCUS kinetics guidance for parent compounds
+and metabolites. For two-dimensional residue series over time and depth,
+it automates the proposal of Boesten et al (2015).
+}
+\section{Functions}{
+\itemize{
+\item \code{set_nd_nq_focus()}: Set non-detects in residue time series according to FOCUS rules
+
+}}
+\examples{
+# FOCUS (2014) p. 75/76 and 131/132
+parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd")
+set_nd_nq(parent_1, 0.02)
+parent_2 <- c(.12, .09, .05, .03, "nd", "nd", .03, "nd", "nd", "nd")
+set_nd_nq(parent_2, 0.02)
+set_nd_nq_focus(parent_2, 0.02, loq = 0.05)
+parent_3 <- c(.12, .09, .05, .03, "nd", "nd", .06, "nd", "nd", "nd")
+set_nd_nq(parent_3, 0.02)
+set_nd_nq_focus(parent_3, 0.02, loq = 0.05)
+metabolite <- c("nd", "nd", "nd", 0.03, 0.06, 0.10, 0.11, 0.10, 0.09, 0.05, 0.03, "nd", "nd")
+set_nd_nq(metabolite, 0.02)
+set_nd_nq_focus(metabolite, 0.02, 0.05)
+#
+# Boesten et al. (2015), p. 57/58
+table_8 <- matrix(
+ c(10, 10, rep("nd", 4),
+ 10, 10, rep("nq", 2), rep("nd", 2),
+ 10, 10, 10, "nq", "nd", "nd",
+ "nq", 10, "nq", rep("nd", 3),
+ "nd", "nq", "nq", rep("nd", 3),
+ rep("nd", 6), rep("nd", 6)),
+ ncol = 6, byrow = TRUE)
+set_nd_nq(table_8, 0.5, 1.5, time_zero_presence = TRUE)
+table_10 <- matrix(
+ c(10, 10, rep("nd", 4),
+ 10, 10, rep("nd", 4),
+ 10, 10, 10, rep("nd", 3),
+ "nd", 10, rep("nd", 4),
+ rep("nd", 18)),
+ ncol = 6, byrow = TRUE)
+set_nd_nq(table_10, 0.5, time_zero_presence = TRUE)
+}
+\references{
+Boesten, J. J. T. I., van der Linden, A. M. A., Beltman, W. H.
+J. and Pol, J. W. (2015). Leaching of plant protection products and their
+transformation products; Proposals for improving the assessment of leaching
+to groundwater in the Netherlands — Version 2. Alterra report 2630, Alterra
+Wageningen UR (University & Research centre)
+
+FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation
+Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1,
+18 December 2014, p. 251
+}
diff --git a/man/status.Rd b/man/status.Rd
new file mode 100644
index 00000000..1cadbfcc
--- /dev/null
+++ b/man/status.Rd
@@ -0,0 +1,44 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/status.R
+\name{status}
+\alias{status}
+\alias{status.mmkin}
+\alias{print.status.mmkin}
+\alias{status.mhmkin}
+\alias{print.status.mhmkin}
+\title{Method to get status information for fit array objects}
+\usage{
+status(object, ...)
+
+\method{status}{mmkin}(object, ...)
+
+\method{print}{status.mmkin}(x, ...)
+
+\method{status}{mhmkin}(object, ...)
+
+\method{print}{status.mhmkin}(x, ...)
+}
+\arguments{
+\item{object}{The object to investigate}
+
+\item{\dots}{For potential future extensions}
+
+\item{x}{The object to be printed}
+}
+\value{
+An object with the same dimensions as the fit array
+suitable printing method.
+}
+\description{
+Method to get status information for fit array objects
+}
+\examples{
+\dontrun{
+fits <- mmkin(
+ c("SFO", "FOMC"),
+ list("FOCUS A" = FOCUS_2006_A,
+ "FOCUS B" = FOCUS_2006_C),
+ quiet = TRUE)
+status(fits)
+}
+}
diff --git a/man/summary.mkinfit.Rd b/man/summary.mkinfit.Rd
index 24991d71..b6c1fb87 100644
--- a/man/summary.mkinfit.Rd
+++ b/man/summary.mkinfit.Rd
@@ -60,7 +60,7 @@ values.
}
\examples{
- summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
+ summary(mkinfit("SFO", FOCUS_2006_A, quiet = TRUE))
}
\references{
diff --git a/man/summary.mmkin.Rd b/man/summary.mmkin.Rd
new file mode 100644
index 00000000..32e5824f
--- /dev/null
+++ b/man/summary.mmkin.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/summary.mmkin.R
+\name{summary.mmkin}
+\alias{summary.mmkin}
+\alias{print.summary.mmkin}
+\title{Summary method for class "mmkin"}
+\usage{
+\method{summary}{mmkin}(object, conf.level = 0.95, ...)
+
+\method{print}{summary.mmkin}(x, digits = max(3, getOption("digits") - 3), ...)
+}
+\arguments{
+\item{object}{an object of class \link{mmkin}}
+
+\item{conf.level}{confidence level for testing parameters}
+
+\item{\dots}{optional arguments passed to methods like \code{print}.}
+
+\item{x}{an object of class \code{summary.mmkin}.}
+
+\item{digits}{number of digits to use for printing}
+}
+\description{
+Shows status information on the \link{mkinfit} objects contained in the object
+and gives an overview of ill-defined parameters calculated by \link{illparms}.
+}
+\examples{
+
+fits <- mmkin(
+ c("SFO", "FOMC"),
+ list("FOCUS A" = FOCUS_2006_A,
+ "FOCUS C" = FOCUS_2006_C),
+ quiet = TRUE, cores = 1)
+ summary(fits)
+
+}
diff --git a/man/summary.saem.mmkin.Rd b/man/summary.saem.mmkin.Rd
index 67cb3cbb..fb099899 100644
--- a/man/summary.saem.mmkin.Rd
+++ b/man/summary.saem.mmkin.Rd
@@ -90,7 +90,12 @@ ds_syn_dfop_sfo <- lapply(ds_mean_dfop_sfo, function(ds) {
f_mmkin_dfop_sfo <- mmkin(list(dfop_sfo), ds_syn_dfop_sfo,
quiet = TRUE, error_model = "tc", cores = 5)
f_saem_dfop_sfo <- saem(f_mmkin_dfop_sfo)
-summary(f_saem_dfop_sfo, data = TRUE)
+print(f_saem_dfop_sfo)
+illparms(f_saem_dfop_sfo)
+f_saem_dfop_sfo_2 <- update(f_saem_dfop_sfo, covariance.model = diag(c(0, 0, 1, 1, 1, 0)))
+illparms(f_saem_dfop_sfo_2)
+intervals(f_saem_dfop_sfo_2)
+summary(f_saem_dfop_sfo_2, data = TRUE)
}
}

Contact - Imprint