diff options
199 files changed, 4966 insertions, 3097 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index fa6c1c90..8bef6055 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,15 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data -Version: 0.9.50.4 -Date: 2021-01-06 -Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), - email = "jranke@uni-bremen.de", - comment = c(ORCID = "0000-0003-4371-6538")), - person("Katrin", "Lindenberger", role = "ctb"), - person("René", "Lehmann", role = "ctb"), - person("Eurofins Regulatory AG", role = "cph")) +Version: 1.0.0 +Date: 2021-02-03 +Authors@R: c( + person("Johannes", "Ranke", role = c("aut", "cre", "cph"), + email = "jranke@uni-bremen.de", + comment = c(ORCID = "0000-0003-4371-6538")), + person("Katrin", "Lindenberger", role = "ctb", comment = "contributed to mkinresplot()"), + person("René", "Lehmann", role = "ctb", comment = "ilr() and invilr()"), + person("Eurofins Regulatory AG", role = "cph", comment = "copyright for some of the contributions of JR 2012-2014")) Description: Calculation routines based on the FOCUS Kinetics Report (2006, 2014). Includes a function for conveniently defining differential equation models, model solution based on eigenvalues if possible or using numerical @@ -20,8 +21,7 @@ Depends: R (>= 2.15.1), parallel Imports: stats, graphics, methods, deSolve, R6, inline (>= 0.3.17), numDeriv, lmtest, pkgbuild, nlme (>= 3.1-151), purrr Suggests: knitr, rbenchmark, tikzDevice, testthat, rmarkdown, covr, vdiffr, - benchmarkme, tibble, stats4, saemix (>= 3.1.9000) -Additional_repositories: https://jranke.github.io/drat + benchmarkme, tibble, stats4 License: GPL LazyLoad: yes LazyData: yes diff --git a/GNUmakefile b/GNUmakefile index aaa8cdf0..8604d3b3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -93,7 +93,7 @@ slowtests: install vdiffr: "$(RBIN)/Rscript" -e 'vdiffr::manage_cases(filter = "plot|nafta")' -testcheck: test check +testcheck: roxygen test check README.html: README.md "$(RBIN)/Rscript" -e "rmarkdown::render('README.md', output_format = 'html_document', output_options = list(mathjax = NULL))" @@ -30,15 +30,11 @@ S3method(print,mkinmod) S3method(print,mmkin) S3method(print,nafta) S3method(print,nlme.mmkin) -S3method(print,saem.mmkin) S3method(print,summary.mkinfit) S3method(print,summary.nlme.mmkin) -S3method(print,summary.saem.mmkin) S3method(residuals,mkinfit) -S3method(saem,mmkin) S3method(summary,mkinfit) S3method(summary,nlme.mmkin) -S3method(summary,saem.mmkin) S3method(update,mkinfit) S3method(update,mmkin) S3method(update,nlme.mmkin) @@ -90,9 +86,6 @@ export(parms) export(plot_err) export(plot_res) export(plot_sep) -export(saem) -export(saemix_data) -export(saemix_model) export(sigma_twocomp) export(transform_odeparms) import(deSolve) @@ -133,6 +126,5 @@ importFrom(stats,residuals) importFrom(stats,rnorm) importFrom(stats,shapiro.test) importFrom(stats,update) -importFrom(stats,vcov) importFrom(utils,getFromNamespace) importFrom(utils,write.table) @@ -1,6 +1,6 @@ -# mkin 0.9.50.4 (unreleased) +# mkin 1.0.0 -## General new features +## General - 'mkinmod' models gain arguments 'name' and 'dll_dir' which, in conjunction with a current version of the 'inline' package, make it possible to still use the DLL used for fast ODE solutions with 'deSolve' after saving and restoring the 'mkinmod' object. @@ -24,19 +24,10 @@ - 'mixed.mmkin' New container for mmkin objects for plotting with the 'plot.mixed.mmkin' method -- 'plot.mixed.mmkin' method used for 'nlme.mmkin' and 'saem.mmkin', both inheriting from 'mixed.mmkin' (currently virtual) +- 'plot.mixed.mmkin' method used for 'nlme.mmkin' inheriting from 'mixed.mmkin' (currently virtual) - 'plot', 'summary' and 'print' methods for 'nlme.mmkin' objects -- Add the current development version of the saemix package as a second, optional backend for mixed-effects models - -- DESCRIPTION: Additional_repositories entry pointing to my drat repository on github for a suitable saemix version - -- 'saemix_model', 'saemix_data': Helper functions to fit nonlinear mixed-effects models for mmkin row objects. - -- 'saem' generic function to fit saemix models using 'saemix_model' and 'saemix_data', with a generator 'saem.mmkin', summary and plot methods - - # mkin 0.9.50.3 (2020-10-08) - 'parms': Add a method for mmkin objects diff --git a/R/endpoints.R b/R/endpoints.R index f1f47581..b5872e68 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -10,8 +10,8 @@ #' Additional DT50 values are calculated from the FOMC DT90 and k1 and k2 from #' HS and DFOP, as well as from Eigenvalues b1 and b2 of any SFORB models #' -#' @param fit An object of class [mkinfit], [nlme.mmkin] or -#' [saem.mmkin]. Or another object that has list components +#' @param fit An object of class [mkinfit] or [nlme.mmkin] +#' or another object that has list components #' mkinmod containing an [mkinmod] degradation model, and two numeric vectors, #' bparms.optim and bparms.fixed, that contain parameter values #' for that model. @@ -20,8 +20,8 @@ #' and, if applicable, a vector of formation fractions named ff #' and, if the SFORB model was in use, a vector of eigenvalues #' of these SFORB models, equivalent to DFOP rate constants -#' @note The function is used internally by [summary.mkinfit], -#' [summary.nlme.mmkin] and [summary.saem.mmkin]. +#' @note The function is used internally by [summary.mkinfit] +#' and [summary.nlme.mmkin] #' @author Johannes Ranke #' @examples #' diff --git a/R/plot.mixed.mmkin.R b/R/plot.mixed.mmkin.R index 1674d855..5a0b7412 100644 --- a/R/plot.mixed.mmkin.R +++ b/R/plot.mixed.mmkin.R @@ -2,7 +2,7 @@ utils::globalVariables("ds") #' Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object #' -#' @param x An object of class [mixed.mmkin], [saem.mmkin] or [nlme.mmkin] +#' @param x An object of class [mixed.mmkin], [nlme.mmkin] #' @param i A numeric index to select datasets for which to plot the individual predictions, #' in case plots get too large #' @inheritParams plot.mkinfit @@ -39,15 +39,6 @@ utils::globalVariables("ds") #' f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3)) #' plot(f_nlme) #' -#' f_saem <- saem(f, transformations = "saemix") -#' plot(f_saem) -#' -#' # We can overlay the two variants if we generate predictions -#' pred_nlme <- mkinpredict(dfop_sfo, -#' f_nlme$bparms.optim[-1], -#' c(parent = f_nlme$bparms.optim[[1]], A1 = 0), -#' seq(0, 180, by = 0.2)) -#' plot(f_saem, pred_over = list(nlme = pred_nlme)) #' } #' @export plot.mixed.mmkin <- function(x, @@ -91,18 +82,6 @@ plot.mixed.mmkin <- function(x, type = ifelse(standardized, "pearson", "response")) } - if (inherits(x, "saem.mmkin")) { - if (x$transformations == "saemix") backtransform = FALSE - degparms_i <- saemix::psi(x$so) - rownames(degparms_i) <- ds_names - degparms_i_names <- setdiff(x$so@results@name.fixed, names(fit_1$errparms)) - colnames(degparms_i) <- degparms_i_names - residual_type = ifelse(standardized, "standardized", "residual") - residuals <- x$data[[residual_type]] - degparms_pop <- x$so@results@fixed.effects - names(degparms_pop) <- degparms_i_names - } - degparms_fixed <- fit_1$fixed$value names(degparms_fixed) <- rownames(fit_1$fixed) degparms_all <- cbind(as.matrix(degparms_i), diff --git a/R/saem.R b/R/saem.R deleted file mode 100644 index fd2a77b4..00000000 --- a/R/saem.R +++ /dev/null @@ -1,512 +0,0 @@ -utils::globalVariables(c("predicted", "std")) - -#' Fit nonlinear mixed models with SAEM -#' -#' This function uses [saemix::saemix()] as a backend for fitting nonlinear mixed -#' effects models created from [mmkin] row objects using the Stochastic Approximation -#' Expectation Maximisation algorithm (SAEM). -#' -#' 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 using [mkinfit]. -#' -#' Starting values for the fixed effects (population mean parameters, argument -#' psi0 of [saemix::saemixModel()] are the mean values of the parameters found -#' using [mmkin]. -#' -#' @param object An [mmkin] row object containing several fits of the same -#' [mkinmod] model to different datasets -#' @param verbose Should we print information about created objects of -#' type [saemix::SaemixModel] and [saemix::SaemixData]? -#' @param 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. -#' @param degparms_start Parameter values given as a named numeric vector will -#' be used to override the starting values obtained from the 'mmkin' object. -#' @param solution_type Possibility to specify the solution type in case the -#' automatic choice is not desired -#' @param quiet Should we suppress the messages saemix prints at the beginning -#' and the end of the optimisation process? -#' @param control Passed to [saemix::saemix] -#' @param \dots Further parameters passed to [saemix::saemixModel]. -#' @return An S3 object of class 'saem.mmkin', containing the fitted -#' [saemix::SaemixObject] as a list component named 'so'. The -#' object also inherits from 'mixed.mmkin'. -#' @seealso [summary.saem.mmkin] [plot.mixed.mmkin] -#' @examples -#' \dontrun{ -#' ds <- lapply(experimental_data_for_UBA_2019[6:10], -#' function(x) subset(x$data[c("name", "time", "value")])) -#' names(ds) <- paste("Dataset", 6:10) -#' f_mmkin_parent_p0_fixed <- mmkin("FOMC", ds, -#' state.ini = c(parent = 100), fixed_initials = "parent", quiet = TRUE) -#' f_saem_p0_fixed <- saem(f_mmkin_parent_p0_fixed) -#' -#' 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", ]) -#' -#' # The returned saem.mmkin object contains an SaemixObject, therefore we can use -#' # functions from saemix -#' library(saemix) -#' compare.saemix(list(f_saem_sfo$so, f_saem_fomc$so, f_saem_dfop$so)) -#' plot(f_saem_fomc$so, plot.type = "convergence") -#' plot(f_saem_fomc$so, plot.type = "individual.fit") -#' plot(f_saem_fomc$so, plot.type = "npde") -#' 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(list(f_saem_fomc$so, f_saem_fomc_tc$so)) -#' -#' sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"), -#' A1 = mkinsub("SFO")) -#' fomc_sfo <- mkinmod(parent = mkinsub("FOMC", "A1"), -#' A1 = mkinsub("SFO")) -#' dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"), -#' A1 = mkinsub("SFO")) -#' # The following fit uses analytical solutions for SFO-SFO and DFOP-SFO, -#' # and compiled ODEs for FOMC that are much slower -#' f_mmkin <- mmkin(list( -#' "SFO-SFO" = sfo_sfo, "FOMC-SFO" = fomc_sfo, "DFOP-SFO" = dfop_sfo), -#' ds, quiet = TRUE) -#' # saem fits of SFO-SFO and DFOP-SFO to these data take about five seconds -#' # each on this system, as we use analytical solutions written for saemix. -#' # When using the analytical solutions written for mkin this took around -#' # four minutes -#' f_saem_sfo_sfo <- saem(f_mmkin["SFO-SFO", ]) -#' f_saem_dfop_sfo <- saem(f_mmkin["DFOP-SFO", ]) -#' # We can use print, plot and summary methods to check the results -#' print(f_saem_dfop_sfo) -#' plot(f_saem_dfop_sfo) -#' summary(f_saem_dfop_sfo, data = TRUE) -#' -#' # The following takes about 6 minutes -#' #f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve", -#' # control = list(nbiter.saemix = c(200, 80), nbdisplay = 10)) -#' -#' #saemix::compare.saemix(list( -#' # f_saem_dfop_sfo$so, -#' # f_saem_dfop_sfo_deSolve$so)) -#' -#' # If the model supports it, we can also use eigenvalue based solutions, which -#' # take a similar amount of time -#' #f_saem_sfo_sfo_eigen <- saem(f_mmkin["SFO-SFO", ], solution_type = "eigen", -#' # control = list(nbiter.saemix = c(200, 80), nbdisplay = 10)) -#' } -#' @export -saem <- function(object, ...) UseMethod("saem") - -#' @rdname saem -#' @export -saem.mmkin <- function(object, - transformations = c("mkin", "saemix"), - degparms_start = numeric(), - solution_type = "auto", - control = list(displayProgress = FALSE, print = FALSE, - save = FALSE, save.graphs = FALSE), - verbose = FALSE, quiet = FALSE, ...) -{ - transformations <- match.arg(transformations) - m_saemix <- saemix_model(object, verbose = verbose, - degparms_start = degparms_start, solution_type = solution_type, - transformations = transformations, ...) - d_saemix <- saemix_data(object, verbose = verbose) - - fit_time <- system.time({ - utils::capture.output(f_saemix <- saemix::saemix(m_saemix, d_saemix, control), split = !quiet) - }) - - transparms_optim <- f_saemix@results@fixed.effects - names(transparms_optim) <- f_saemix@results@name.fixed - - if (transformations == "mkin") { - bparms_optim <- backtransform_odeparms(transparms_optim, - object[[1]]$mkinmod, - object[[1]]$transform_rates, - object[[1]]$transform_fractions) - } else { - bparms_optim <- transparms_optim - } - - return_data <- nlme_data(object) - - return_data$predicted <- f_saemix@model@model( - psi = saemix::psi(f_saemix), - id = as.numeric(return_data$ds), - xidep = return_data[c("time", "name")]) - - return_data <- transform(return_data, - residual = predicted - value, - std = sigma_twocomp(predicted, - f_saemix@results@respar[1], f_saemix@results@respar[2])) - return_data <- transform(return_data, - standardized = residual / std) - - result <- list( - mkinmod = object[[1]]$mkinmod, - mmkin = object, - solution_type = object[[1]]$solution_type, - transformations = transformations, - transform_rates = object[[1]]$transform_rates, - transform_fractions = object[[1]]$transform_fractions, - so = f_saemix, - time = fit_time, - mean_dp_start = attr(m_saemix, "mean_dp_start"), - bparms.optim = bparms_optim, - bparms.fixed = object[[1]]$bparms.fixed, - data = return_data, - err_mod = object[[1]]$err_mod, - date.fit = date(), - saemixversion = as.character(utils::packageVersion("saemix")), - mkinversion = as.character(utils::packageVersion("mkin")), - Rversion = paste(R.version$major, R.version$minor, sep=".") - ) - - class(result) <- c("saem.mmkin", "mixed.mmkin") - return(result) -} - -#' @export -#' @rdname saem -#' @param x An saem.mmkin object to print -#' @param digits Number of digits to use for printing -print.saem.mmkin <- function(x, digits = max(3, getOption("digits") - 3), ...) { - cat( "Kinetic nonlinear mixed-effects model fit by SAEM" ) - cat("\nStructural model:\n") - diffs <- x$mmkin[[1]]$mkinmod$diffs - nice_diffs <- gsub("^(d.*) =", "\\1/dt =", diffs) - writeLines(strwrap(nice_diffs, exdent = 11)) - cat("\nData:\n") - cat(nrow(x$data), "observations of", - length(unique(x$data$name)), "variable(s) grouped in", - length(unique(x$data$ds)), "datasets\n") - - cat("\nLikelihood computed by importance sampling\n") - print(data.frame( - AIC = AIC(x$so, type = "is"), - BIC = BIC(x$so, type = "is"), - logLik = logLik(x$so, type = "is"), - row.names = " "), digits = digits) - - cat("\nFitted parameters:\n") - conf.int <- x$so@results@conf.int[c("estimate", "lower", "upper")] - rownames(conf.int) <- x$so@results@conf.int[["name"]] - print(conf.int, digits = digits) - - invisible(x) -} - -#' @rdname saem -#' @return An [saemix::SaemixModel] object. -#' @export -saemix_model <- function(object, solution_type = "auto", transformations = c("mkin", "saemix"), - degparms_start = numeric(), verbose = FALSE, ...) -{ - if (nrow(object) > 1) stop("Only row objects allowed") - - mkin_model <- object[[1]]$mkinmod - - degparms_optim <- mean_degparms(object) - if (transformations == "saemix") { - degparms_optim <- backtransform_odeparms(degparms_optim, - object[[1]]$mkinmod, - object[[1]]$transform_rates, - object[[1]]$transform_fractions) - } - degparms_fixed <- object[[1]]$bparms.fixed - - # Transformations are done in the degradation function - transform.par = rep(0, length(degparms_optim)) - - odeini_optim_parm_names <- grep('_0$', names(degparms_optim), value = TRUE) - odeini_fixed_parm_names <- grep('_0$', names(degparms_fixed), value = TRUE) - - odeparms_fixed_names <- setdiff(names(degparms_fixed), odeini_fixed_parm_names) - odeparms_fixed <- degparms_fixed[odeparms_fixed_names] - - odeini_fixed <- degparms_fixed[odeini_fixed_parm_names] - names(odeini_fixed) <- gsub('_0$', '', odeini_fixed_parm_names) - - model_function <- FALSE - - # Model functions with analytical solutions - # Fixed parameters, use_of_ff = "min" and turning off sinks currently not supported here - # In general, we need to consider exactly how the parameters in mkinfit were specified, - # as the parameters are currently mapped by position in these solutions - sinks <- sapply(mkin_model$spec, function(x) x$sink) - if (length(odeparms_fixed) == 0 & mkin_model$use_of_ff == "max" & all(sinks)) { - # Parent only - if (length(mkin_model$spec) == 1) { - parent_type <- mkin_model$spec[[1]]$type - if (length(odeini_fixed) == 1) { - if (parent_type == "SFO") { - stop("saemix needs at least two parameters to work on.") - } - if (parent_type == "FOMC") { - model_function <- function(psi, id, xidep) { - odeini_fixed / (xidep[, "time"]/exp(psi[id, 2]) + 1)^exp(psi[id, 1]) - } - } - if (parent_type == "DFOP") { - model_function <- function(psi, id, xidep) { - g <- plogis(psi[id, 3]) - t <- xidep[, "time"] - odeini_fixed * (g * exp(- exp(psi[id, 1]) * t) + - (1 - g) * exp(- exp(psi[id, 2]) * t)) - } - } - if (parent_type == "HS") { - model_function <- function(psi, id, xidep) { - tb <- exp(psi[id, 3]) - t <- xidep[, "time"] - k1 = exp(psi[id, 1]) - odeini_fixed * ifelse(t <= tb, - exp(- k1 * t), - exp(- k1 * tb) * exp(- exp(psi[id, 2]) * (t - tb))) - } - } - } else { - if (parent_type == "SFO") { - if (transformations == "mkin") { - model_function <- function(psi, id, xidep) { - psi[id, 1] * exp( - exp(psi[id, 2]) * xidep[, "time"]) - } - } else { - model_function <- function(psi, id, xidep) { - psi[id, 1] * exp( - psi[id, 2] * xidep[, "time"]) - } - transform.par = c(0, 1) - } - } - if (parent_type == "FOMC") { - model_function <- function(psi, id, xidep) { - psi[id, 1] / (xidep[, "time"]/exp(psi[id, 3]) + 1)^exp(psi[id, 2]) - } - } - if (parent_type == "DFOP") { - if (transformations == "mkin") { - model_function <- function(psi, id, xidep) { - g <- plogis(psi[id, 4]) - t <- xidep[, "time"] - psi[id, 1] * (g * exp(- exp(psi[id, 2]) * t) + - (1 - g) * exp(- exp(psi[id, 3]) * t)) - } - } else { - model_function <- function(psi, id, xidep) { - g <- psi[id, 4] - t <- xidep[, "time"] - psi[id, 1] * (g * exp(- psi[id, 2] * t) + - (1 - g) * exp(- psi[id, 3] * t)) - } - transform.par = c(0, 1, 1, 3) - } - } - if (parent_type == "HS") { - model_function <- function(psi, id, xidep) { - tb <- exp(psi[id, 4]) - t <- xidep[, "time"] - k1 = exp(psi[id, 2]) - psi[id, 1] * ifelse(t <= tb, - exp(- k1 * t), - exp(- k1 * tb) * exp(- exp(psi[id, 3]) * (t - tb))) - } - } - } - } - - # Parent with one metabolite - # Parameter names used in the model functions are as in - # https://nbviewer.jupyter.org/urls/jrwb.de/nb/Symbolic%20ODE%20solutions%20for%20mkin.ipynb - types <- unname(sapply(mkin_model$spec, function(x) x$type)) - if (length(mkin_model$spec) == 2 &! "SFORB" %in% types ) { - # Initial value for the metabolite (n20) must be fixed - if (names(odeini_fixed) == names(mkin_model$spec)[2]) { - n20 <- odeini_fixed - parent_name <- names(mkin_model$spec)[1] - if (identical(types, c("SFO", "SFO"))) { - if (transformations == "mkin") { - model_function <- function(psi, id, xidep) { - t <- xidep[, "time"] - n10 <- psi[id, 1] - k1 <- exp(psi[id, 2]) - k2 <- exp(psi[id, 3]) - f12 <- plogis(psi[id, 4]) - ifelse(xidep[, "name"] == parent_name, - n10 * exp(- k1 * t), - (((k2 - k1) * n20 - f12 * k1 * n10) * exp(- k2 * t)) / (k2 - k1) + - (f12 * k1 * n10 * exp(- k1 * t)) / (k2 - k1) - ) - } - } else { - model_function <- function(psi, id, xidep) { - t <- xidep[, "time"] - n10 <- psi[id, 1] - k1 <- psi[id, 2] - k2 <- psi[id, 3] - f12 <- psi[id, 4] - ifelse(xidep[, "name"] == parent_name, - n10 * exp(- k1 * t), - (((k2 - k1) * n20 - f12 * k1 * n10) * exp(- k2 * t)) / (k2 - k1) + - (f12 * k1 * n10 * exp(- k1 * t)) / (k2 - k1) - ) - } - transform.par = c(0, 1, 1, 3) - } - } - if (identical(types, c("DFOP", "SFO"))) { - if (transformations == "mkin") { - model_function <- function(psi, id, xidep) { - t <- xidep[, "time"] - n10 <- psi[id, 1] - k2 <- exp(psi[id, 2]) - f12 <- plogis(psi[id, 3]) - l1 <- exp(psi[id, 4]) - l2 <- exp(psi[id, 5]) - g <- plogis(psi[id, 6]) - ifelse(xidep[, "name"] == parent_name, - n10 * (g * exp(- l1 * t) + (1 - g) * exp(- l2 * t)), - ((f12 * g - f12) * l2 * n10 * exp(- l2 * t)) / (l2 - k2) - - (f12 * g * l1 * n10 * exp(- l1 * t)) / (l1 - k2) + - ((((l1 - k2) * l2 - k2 * l1 + k2^2) * n20 + - ((f12 * l1 + (f12 * g - f12) * k2) * l2 - - f12 * g * k2 * l1) * n10) * exp( - k2 * t)) / - ((l1 - k2) * l2 - k2 * l1 + k2^2) - ) - } - } else { - model_function <- function(psi, id, xidep) { - t <- xidep[, "time"] - n10 <- psi[id, 1] - k2 <- psi[id, 2] - f12 <- psi[id, 3] - l1 <- psi[id, 4] - l2 <- psi[id, 5] - g <- psi[id, 6] - ifelse(xidep[, "name"] == parent_name, - n10 * (g * exp(- l1 * t) + (1 - g) * exp(- l2 * t)), - ((f12 * g - f12) * l2 * n10 * exp(- l2 * t)) / (l2 - k2) - - (f12 * g * l1 * n10 * exp(- l1 * t)) / (l1 - k2) + - ((((l1 - k2) * l2 - k2 * l1 + k2^2) * n20 + - ((f12 * l1 + (f12 * g - f12) * k2) * l2 - - f12 * g * k2 * l1) * n10) * exp( - k2 * t)) / - ((l1 - k2) * l2 - k2 * l1 + k2^2) - ) - } - transform.par = c(0, 1, 3, 1, 1, 3) - } - } - } - } - } - - if (is.function(model_function) & solution_type == "auto") { - solution_type = "analytical saemix" - } else { - - if (solution_type == "auto") - solution_type <- object[[1]]$solution_type - - model_function <- function(psi, id, xidep) { - - uid <- unique(id) - - res_list <- lapply(uid, function(i) { - - transparms_optim <- as.numeric(psi[i, ]) # psi[i, ] is a dataframe when called in saemix.predict - names(transparms_optim) <- names(degparms_optim) - - odeini_optim <- transparms_optim[odeini_optim_parm_names] - names(odeini_optim) <- gsub('_0$', '', odeini_optim_parm_names) - - odeini <- c(odeini_optim, odeini_fixed)[names(mkin_model$diffs)] - - ode_transparms_optim_names <- setdiff(names(transparms_optim), odeini_optim_parm_names) - odeparms_optim <- backtransform_odeparms(transparms_optim[ode_transparms_optim_names], mkin_model, - transform_rates = object[[1]]$transform_rates, - transform_fractions = object[[1]]$transform_fractions) - odeparms <- c(odeparms_optim, odeparms_fixed) - - xidep_i <- subset(xidep, id == i) - - if (solution_type == "analytical") { - out_values <- mkin_model$deg_func(xidep_i, odeini, odeparms) - } else { - - i_time <- xidep_i$time - i_name <- xidep_i$name - - out_wide <- mkinpredict(mkin_model, - odeparms = odeparms, odeini = odeini, - solution_type = solution_type, - outtimes = sort(unique(i_time)), - na_stop = FALSE - ) - - out_index <- cbind(as.character(i_time), as.character(i_name)) - out_values <- out_wide[out_index] - } - return(out_values) - }) - res <- unlist(res_list) - return(res) - } - } - - error.model <- switch(object[[1]]$err_mod, - const = "constant", - tc = "combined", - obs = "constant") - - if (object[[1]]$err_mod == "obs") { - warning("The error model 'obs' (variance by variable) can currently not be transferred to an saemix model") - } - - error.init <- switch(object[[1]]$err_mod, - const = c(a = mean(sapply(object, function(x) x$errparms)), b = 1), - tc = c(a = mean(sapply(object, function(x) x$errparms[1])), - b = mean(sapply(object, function(x) x$errparms[2]))), - obs = c(a = mean(sapply(object, function(x) x$errparms)), b = 1)) - - degparms_psi0 <- degparms_optim - degparms_psi0[names(degparms_start)] <- degparms_start - psi0_matrix <- matrix(degparms_psi0, nrow = 1) - colnames(psi0_matrix) <- names(degparms_psi0) - - res <- saemix::saemixModel(model_function, - psi0 = psi0_matrix, - "Mixed model generated from mmkin object", - transform.par = transform.par, - error.model = error.model, - verbose = verbose - ) - attr(res, "mean_dp_start") <- degparms_optim - return(res) -} - -#' @rdname saem -#' @return An [saemix::SaemixData] object. -#' @export -saemix_data <- function(object, verbose = FALSE, ...) { - if (nrow(object) > 1) stop("Only row objects allowed") - ds_names <- colnames(object) - - ds_list <- lapply(object, function(x) x$data[c("time", "variable", "observed")]) - names(ds_list) <- ds_names - ds_saemix_all <- purrr::map_dfr(ds_list, function(x) x, .id = "ds") - ds_saemix <- data.frame(ds = ds_saemix_all$ds, - name = as.character(ds_saemix_all$variable), - time = ds_saemix_all$time, - value = ds_saemix_all$observed, - stringsAsFactors = FALSE) - - res <- saemix::saemixData(ds_saemix, - name.group = "ds", - name.predictors = c("time", "name"), - name.response = "value", - verbose = verbose, - ...) - return(res) -} diff --git a/R/summary.saem.mmkin.R b/R/summary.saem.mmkin.R deleted file mode 100644 index e92c561c..00000000 --- a/R/summary.saem.mmkin.R +++ /dev/null @@ -1,268 +0,0 @@ -#' Summary method for class "saem.mmkin" -#' -#' Lists model equations, initial parameter values, optimised parameters -#' for fixed effects (population), random effects (deviations from the -#' population mean) and residual error model, as well as the resulting -#' endpoints such as formation fractions and DT50 values. Optionally -#' (default is FALSE), the data are listed in full. -#' -#' @param object an object of class [saem.mmkin] -#' @param x an object of class [summary.saem.mmkin] -#' @param data logical, indicating whether the full data should be included in -#' the summary. -#' @param verbose Should the summary be verbose? -#' @param distimes logical, indicating whether DT50 and DT90 values should be -#' included. -#' @param digits Number of digits to use for printing -#' @param \dots optional arguments passed to methods like \code{print}. -#' @return The summary function returns a list based on the [saemix::SaemixObject] -#' obtained in the fit, with at least the following additional components -#' \item{saemixversion, mkinversion, Rversion}{The saemix, mkin and R versions used} -#' \item{date.fit, date.summary}{The dates where the fit and the summary were -#' produced} -#' \item{diffs}{The differential equations used in the degradation model} -#' \item{use_of_ff}{Was maximum or minimum use made of formation fractions} -#' \item{data}{The data} -#' \item{confint_trans}{Transformed parameters as used in the optimisation, with confidence intervals} -#' \item{confint_back}{Backtransformed parameters, with confidence intervals if available} -#' \item{confint_errmod}{Error model parameters with confidence intervals} -#' \item{ff}{The estimated formation fractions derived from the fitted -#' model.} -#' \item{distimes}{The DT50 and DT90 values for each observed variable.} -#' \item{SFORB}{If applicable, eigenvalues of SFORB components of the model.} -#' The print method is called for its side effect, i.e. printing the summary. -#' @importFrom stats predict vcov -#' @author Johannes Ranke for the mkin specific parts -#' saemix authors for the parts inherited from saemix. -#' @examples -#' # Generate five datasets following DFOP-SFO kinetics -#' sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) -#' dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "m1"), -#' m1 = mkinsub("SFO"), quiet = TRUE) -#' set.seed(1234) -#' k1_in <- rlnorm(5, log(0.1), 0.3) -#' k2_in <- rlnorm(5, log(0.02), 0.3) -#' g_in <- plogis(rnorm(5, qlogis(0.5), 0.3)) -#' f_parent_to_m1_in <- plogis(rnorm(5, qlogis(0.3), 0.3)) -#' k_m1_in <- rlnorm(5, log(0.02), 0.3) -#' -#' pred_dfop_sfo <- function(k1, k2, g, f_parent_to_m1, k_m1) { -#' mkinpredict(dfop_sfo, -#' c(k1 = k1, k2 = k2, g = g, f_parent_to_m1 = f_parent_to_m1, k_m1 = k_m1), -#' c(parent = 100, m1 = 0), -#' sampling_times) -#' } -#' -#' ds_mean_dfop_sfo <- lapply(1:5, function(i) { -#' mkinpredict(dfop_sfo, -#' c(k1 = k1_in[i], k2 = k2_in[i], g = g_in[i], -#' f_parent_to_m1 = f_parent_to_m1_in[i], k_m1 = k_m1_in[i]), -#' c(parent = 100, m1 = 0), -#' sampling_times) -#' }) -#' names(ds_mean_dfop_sfo) <- paste("ds", 1:5) -#' -#' ds_syn_dfop_sfo <- lapply(ds_mean_dfop_sfo, function(ds) { -#' add_err(ds, -#' sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2), -#' n = 1)[[1]] -#' }) -#' -#' \dontrun{ -#' # Evaluate using mmkin and saem -#' 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) -#' } -#' -#' @export -summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = TRUE, ...) { - - mod_vars <- names(object$mkinmod$diffs) - - pnames <- names(object$mean_dp_start) - np <- length(pnames) - - conf.int <- object$so@results@conf.int - rownames(conf.int) <- conf.int$name - confint_trans <- as.matrix(conf.int[pnames, c("estimate", "lower", "upper")]) - colnames(confint_trans)[1] <- "est." - - # In case objects were produced by earlier versions of saem - if (is.null(object$transformations)) object$transformations <- "mkin" - - if (object$transformations == "mkin") { - bp <- backtransform_odeparms(confint_trans[, "est."], object$mkinmod, - object$transform_rates, object$transform_fractions) - bpnames <- names(bp) - - # Transform boundaries of CI for one parameter at a time, - # with the exception of sets of formation fractions (single fractions are OK). - f_names_skip <- character(0) - for (box in mod_vars) { # Figure out sets of fractions to skip - f_names <- grep(paste("^f", box, sep = "_"), pnames, value = TRUE) - n_paths <- length(f_names) - if (n_paths > 1) f_names_skip <- c(f_names_skip, f_names) - } - - confint_back <- matrix(NA, nrow = length(bp), ncol = 3, - dimnames = list(bpnames, colnames(confint_trans))) - confint_back[, "est."] <- bp - - for (pname in pnames) { - if (!pname %in% f_names_skip) { - par.lower <- confint_trans[pname, "lower"] - par.upper <- confint_trans[pname, "upper"] - names(par.lower) <- names(par.upper) <- pname - bpl <- backtransform_odeparms(par.lower, object$mkinmod, - object$transform_rates, - object$transform_fractions) - bpu <- backtransform_odeparms(par.upper, object$mkinmod, - object$transform_rates, - object$transform_fractions) - confint_back[names(bpl), "lower"] <- bpl - confint_back[names(bpu), "upper"] <- bpu - } - } - } else { - confint_back <- confint_trans - } - - # Correlation of fixed effects (inspired by summary.nlme) - varFix <- vcov(object$so)[1:np, 1:np] - stdFix <- sqrt(diag(varFix)) - object$corFixed <- array( - t(varFix/stdFix)/stdFix, - dim(varFix), - list(pnames, pnames)) - - # Random effects - rnames <- paste0("SD.", pnames) - confint_ranef <- as.matrix(conf.int[rnames, c("estimate", "lower", "upper")]) - colnames(confint_ranef)[1] <- "est." - - # Error model - enames <- if (object$err_mod == "const") "a.1" else c("a.1", "b.1") - confint_errmod <- as.matrix(conf.int[enames, c("estimate", "lower", "upper")]) - colnames(confint_errmod)[1] <- "est." - - - object$confint_trans <- confint_trans - object$confint_ranef <- confint_ranef - object$confint_errmod <- confint_errmod - object$confint_back <- confint_back - - object$date.summary = date() - object$use_of_ff = object$mkinmod$use_of_ff - object$error_model_algorithm = object$mmkin_orig[[1]]$error_model_algorithm - err_mod = object$mmkin_orig[[1]]$err_mod - - object$diffs <- object$mkinmod$diffs - object$print_data <- data # boolean: Should we print the data? - so_pred <- object$so@results@predictions - - names(object$data)[4] <- "observed" # rename value to observed - - object$verbose <- verbose - - object$fixed <- object$mmkin_orig[[1]]$fixed - object$AIC = AIC(object$so) - object$BIC = BIC(object$so) - object$logLik = logLik(object$so, method = "is") - - ep <- endpoints(object) - if (length(ep$ff) != 0) - object$ff <- ep$ff - if (distimes) object$distimes <- ep$distimes - if (length(ep$SFORB) != 0) object$SFORB <- ep$SFORB - class(object) <- c("summary.saem.mmkin") - return(object) -} - -#' @rdname summary.saem.mmkin -#' @export -print.summary.saem.mmkin <- function(x, digits = max(3, getOption("digits") - 3), verbose = x$verbose, ...) { - cat("saemix version used for fitting: ", x$saemixversion, "\n") - cat("mkin version used for pre-fitting: ", x$mkinversion, "\n") - cat("R version used for fitting: ", x$Rversion, "\n") - - cat("Date of fit: ", x$date.fit, "\n") - cat("Date of summary:", x$date.summary, "\n") - - cat("\nEquations:\n") - nice_diffs <- gsub("^(d.*) =", "\\1/dt =", x[["diffs"]]) - writeLines(strwrap(nice_diffs, exdent = 11)) - - cat("\nData:\n") - cat(nrow(x$data), "observations of", - length(unique(x$data$name)), "variable(s) grouped in", - length(unique(x$data$ds)), "datasets\n") - - cat("\nModel predictions using solution type", x$solution_type, "\n") - - cat("\nFitted in", x$time[["elapsed"]], "s using", paste(x$so@options$nbiter.saemix, collapse = ", "), "iterations\n") - - cat("\nVariance model: ") - cat(switch(x$err_mod, - const = "Constant variance", - obs = "Variance unique to each observed variable", - tc = "Two-component variance function"), "\n") - - cat("\nMean of starting values for individual parameters:\n") - print(x$mean_dp_start, digits = digits) - - cat("\nFixed degradation parameter values:\n") - if(length(x$fixed$value) == 0) cat("None\n") - else print(x$fixed, digits = digits) - - cat("\nResults:\n\n") - cat("Likelihood computed by importance sampling\n") - print(data.frame(AIC = x$AIC, BIC = x$BIC, logLik = x$logLik, - row.names = " "), digits = digits) - - cat("\nOptimised parameters:\n") - print(x$confint_trans, digits = digits) - - if (nrow(x$confint_trans) > 1) { - corr <- x$corFixed - class(corr) <- "correlation" - print(corr, title = "\nCorrelation:", ...) - } - - cat("\nRandom effects:\n") - print(x$confint_ranef, digits = digits) - - cat("\nVariance model:\n") - print(x$confint_errmod, digits = digits) - - if (x$transformations == "mkin") { - cat("\nBacktransformed parameters:\n") - print(x$confint_back, digits = digits) - } - - printSFORB <- !is.null(x$SFORB) - if(printSFORB){ - cat("\nEstimated Eigenvalues of SFORB model(s):\n") - print(x$SFORB, digits = digits,...) - } - - printff <- !is.null(x$ff) - if(printff){ - cat("\nResulting formation fractions:\n") - print(data.frame(ff = x$ff), digits = digits,...) - } - - printdistimes <- !is.null(x$distimes) - if(printdistimes){ - cat("\nEstimated disappearance times:\n") - print(x$distimes, digits = digits,...) - } - - if (x$print_data){ - cat("\nData:\n") - print(format(x$data, digits = digits, ...), row.names = FALSE) - } - - invisible(x) -} diff --git a/_pkgdown.yml b/_pkgdown.yml index 57f12fbf..7d66f5b0 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,10 +1,8 @@ url: https://pkgdown.jrwb.de/mkin -title: mkin - development: - mode: devel - version_label: info + mode: release + version_label: default template: bootswatch: spacelab @@ -42,13 +40,10 @@ reference: desc: Create and work with nonlinear mixed effects models contents: - nlme.mmkin - - saem.mmkin - plot.mixed.mmkin - summary.nlme.mmkin - - summary.saem.mmkin - nlme_function - get_deg_func - - saemix_model - mixed - title: Datasets and known results contents: @@ -6,6 +6,5 @@ * creating vignettes ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories -Removed empty directory ‘mkin/tests/testthat/_snaps’ -* building ‘mkin_0.9.50.4.tar.gz’ +* building ‘mkin_1.0.0.tar.gz’ @@ -5,13 +5,12 @@ * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘0.9.50.4’ +* this is package ‘mkin’ version ‘1.0.0’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’ * checking package namespace information ... OK -* checking package dependencies ... NOTE -Package suggested but not available for checking: ‘saemix’ +* checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK @@ -46,8 +45,7 @@ Package suggested but not available for checking: ‘saemix’ * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK -* checking Rd cross-references ... NOTE -Package unavailable to check Rd xrefs: ‘saemix’ +* checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK @@ -58,10 +56,7 @@ Package unavailable to check Rd xrefs: ‘saemix’ * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... NOTE -Examples with CPU (user + system) or elapsed time > 5s - user system elapsed -D24_2014 1.808 3.425 0.986 +* checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK @@ -72,9 +67,5 @@ D24_2014 1.808 3.425 0.986 * checking for detritus in the temp directory ... OK * DONE -Status: 3 NOTEs -See - ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ -for details. - +Status: OK diff --git a/docs/404.html b/docs/404.html index 55b92696..42423c5d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="https://pkgdown.jrwb.de/mkin/index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -120,7 +120,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index dd5fe08e..786b2c47 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Example evaluation of FOCUS Example Dataset D</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/FOCUS_D.rmd"><code>vignettes/FOCUS_D.rmd</code></a></small> <div class="hidden name"><code>FOCUS_D.rmd</code></div> @@ -110,9 +110,9 @@ <p>This is just a very simple vignette showing how to fit a degradation model for a parent compound with one transformation product using <code>mkin</code>. After loading the library we look at the data. We have observed concentrations in the column named <code>value</code> at the times specified in column <code>time</code> for the two observed variables named <code>parent</code> and <code>m1</code>.</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">FOCUS_2006_D</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">FOCUS_2006_D</span><span class="op">)</span></code></pre></div> <pre><code>## name time value ## 1 parent 0 99.46 ## 2 parent 0 102.04 @@ -160,37 +160,35 @@ ## 44 m1 120 33.31</code></pre> <p>Next we specify the degradation model: The parent compound degrades with simple first-order kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.</p> <p>The call to mkinmod returns a degradation model. The differential equations represented in R code can be found in the character vector <code>$diffs</code> of the <code>mkinmod</code> object. If a C compiler (gcc) is installed and functional, the differential equation model will be compiled from auto-generated C code.</p> -<div class="sourceCode" id="cb3"><pre class="downlit"> -<span class="va">SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, m1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb5"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">SFO_SFO</span><span class="op">$</span><span class="va">diffs</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, m1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">SFO_SFO</span><span class="op">$</span><span class="va">diffs</span><span class="op">)</span></code></pre></div> <pre><code>## parent ## "d_parent = - k_parent * parent" ## m1 ## "d_m1 = + f_parent_to_m1 * k_parent * parent - k_m1 * m1"</code></pre> <p>We do the fitting without progress report (<code>quiet = TRUE</code>).</p> -<div class="sourceCode" id="cb7"><pre class="downlit"> -<span class="va">fit</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">fit</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Observations with value ## of zero were removed from the data</code></pre> -<pre><code>## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Shapiro-Wilk test for -## standardized residuals: p = 0.0165</code></pre> <p>A plot of the fit including a residual plot for both observed variables is obtained using the <code>plot_sep</code> method for <code>mkinfit</code> objects, which shows separate graphs for all compounds and their residuals.</p> -<div class="sourceCode" id="cb10"><pre class="downlit"> -<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">fit</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">fit</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_D_files/figure-html/plot-1.png" width="768"></p> <p>Confidence intervals for the parameter estimates are obtained using the <code>mkinparplot</code> function.</p> -<div class="sourceCode" id="cb11"><pre class="downlit"> -<span class="fu"><a href="../reference/mkinparplot.html">mkinparplot</a></span><span class="op">(</span><span class="va">fit</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../reference/mkinparplot.html">mkinparplot</a></span><span class="op">(</span><span class="va">fit</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_D_files/figure-html/plot_2-1.png" width="768"></p> <p>A comprehensive report of the results is obtained using the <code>summary</code> method for <code>mkinfit</code> objects.</p> -<div class="sourceCode" id="cb12"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">fit</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">fit</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:00 2020 -## Date of summary: Thu Oct 15 12:42:00 2020 +## Date of fit: Wed Feb 3 17:32:13 2021 +## Date of summary: Wed Feb 3 17:32:14 2021 ## ## Equations: ## d_parent/dt = - k_parent * parent @@ -198,7 +196,7 @@ ## ## Model predictions using solution type analytical ## -## Fitted using 421 model solutions performed in 0.172 s +## Fitted using 401 model solutions performed in 0.161 s ## ## Error model: Constant variance ## @@ -212,11 +210,11 @@ ## f_parent_to_m1 0.5000 deparm ## ## Starting values for the transformed parameters actually optimised: -## value lower upper -## parent_0 100.750000 -Inf Inf -## log_k_parent -2.302585 -Inf Inf -## log_k_m1 -2.301586 -Inf Inf -## f_parent_ilr_1 0.000000 -Inf Inf +## value lower upper +## parent_0 100.750000 -Inf Inf +## log_k_parent -2.302585 -Inf Inf +## log_k_m1 -2.301586 -Inf Inf +## f_parent_qlogis 0.000000 -Inf Inf ## ## Fixed parameter values: ## value type @@ -225,7 +223,6 @@ ## ## Warning(s): ## Observations with value of zero were removed from the data -## Shapiro-Wilk test for standardized residuals: p = 0.0165 ## ## Results: ## @@ -233,20 +230,20 @@ ## 204.4486 212.6365 -97.22429 ## ## Optimised, transformed parameters with symmetric confidence intervals: -## Estimate Std. Error Lower Upper -## parent_0 99.60000 1.57000 96.40000 102.8000 -## log_k_parent -2.31600 0.04087 -2.39900 -2.2330 -## log_k_m1 -5.24800 0.13320 -5.51800 -4.9770 -## f_parent_ilr_1 0.04096 0.06312 -0.08746 0.1694 -## sigma 3.12600 0.35850 2.39600 3.8550 +## Estimate Std. Error Lower Upper +## parent_0 99.60000 1.57000 96.4000 102.8000 +## log_k_parent -2.31600 0.04087 -2.3990 -2.2330 +## log_k_m1 -5.24700 0.13320 -5.5180 -4.9770 +## f_parent_qlogis 0.05792 0.08926 -0.1237 0.2395 +## sigma 3.12600 0.35850 2.3960 3.8550 ## ## Parameter correlation: -## parent_0 log_k_parent log_k_m1 f_parent_ilr_1 sigma -## parent_0 1.000e+00 5.174e-01 -1.688e-01 -5.471e-01 -3.214e-07 -## log_k_parent 5.174e-01 1.000e+00 -3.263e-01 -5.426e-01 3.168e-07 -## log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 -1.410e-07 -## f_parent_ilr_1 -5.471e-01 -5.426e-01 7.478e-01 1.000e+00 5.093e-10 -## sigma -3.214e-07 3.168e-07 -1.410e-07 5.093e-10 1.000e+00 +## parent_0 log_k_parent log_k_m1 f_parent_qlogis sigma +## parent_0 1.000e+00 5.174e-01 -1.688e-01 -5.471e-01 -1.171e-06 +## log_k_parent 5.174e-01 1.000e+00 -3.263e-01 -5.426e-01 -8.481e-07 +## log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 8.209e-07 +## f_parent_qlogis -5.471e-01 -5.426e-01 7.478e-01 1.000e+00 1.305e-06 +## sigma -1.171e-06 -8.481e-07 8.209e-07 1.305e-06 1.000e+00 ## ## Backtransformed parameters: ## Confidence intervals for internally transformed parameters are asymmetric. @@ -283,10 +280,10 @@ ## 1 parent 92.50 90.23787 2.262e+00 ## 3 parent 63.23 74.07319 -1.084e+01 ## 3 parent 68.99 74.07319 -5.083e+00 -## 7 parent 52.32 49.91206 2.408e+00 -## 7 parent 55.13 49.91206 5.218e+00 -## 14 parent 27.27 25.01257 2.257e+00 -## 14 parent 26.64 25.01257 1.627e+00 +## 7 parent 52.32 49.91207 2.408e+00 +## 7 parent 55.13 49.91207 5.218e+00 +## 14 parent 27.27 25.01258 2.257e+00 +## 14 parent 26.64 25.01258 1.627e+00 ## 21 parent 11.50 12.53462 -1.035e+00 ## 21 parent 11.64 12.53462 -8.946e-01 ## 35 parent 2.85 3.14787 -2.979e-01 @@ -294,25 +291,25 @@ ## 50 parent 0.69 0.71624 -2.624e-02 ## 50 parent 0.63 0.71624 -8.624e-02 ## 75 parent 0.05 0.06074 -1.074e-02 -## 75 parent 0.06 0.06074 -7.381e-04 +## 75 parent 0.06 0.06074 -7.382e-04 ## 1 m1 4.84 4.80296 3.704e-02 ## 1 m1 5.64 4.80296 8.370e-01 ## 3 m1 12.91 13.02400 -1.140e-01 ## 3 m1 12.96 13.02400 -6.400e-02 ## 7 m1 22.97 25.04476 -2.075e+00 ## 7 m1 24.47 25.04476 -5.748e-01 -## 14 m1 41.69 36.69002 5.000e+00 -## 14 m1 33.21 36.69002 -3.480e+00 +## 14 m1 41.69 36.69003 5.000e+00 +## 14 m1 33.21 36.69003 -3.480e+00 ## 21 m1 44.37 41.65310 2.717e+00 ## 21 m1 46.44 41.65310 4.787e+00 -## 35 m1 41.22 43.31312 -2.093e+00 -## 35 m1 37.95 43.31312 -5.363e+00 -## 50 m1 41.19 41.21831 -2.831e-02 -## 50 m1 40.01 41.21831 -1.208e+00 -## 75 m1 40.09 36.44703 3.643e+00 -## 75 m1 33.85 36.44703 -2.597e+00 -## 100 m1 31.04 31.98163 -9.416e-01 -## 100 m1 33.13 31.98163 1.148e+00 +## 35 m1 41.22 43.31313 -2.093e+00 +## 35 m1 37.95 43.31313 -5.363e+00 +## 50 m1 41.19 41.21832 -2.832e-02 +## 50 m1 40.01 41.21832 -1.208e+00 +## 75 m1 40.09 36.44704 3.643e+00 +## 75 m1 33.85 36.44704 -2.597e+00 +## 100 m1 31.04 31.98162 -9.416e-01 +## 100 m1 33.13 31.98162 1.148e+00 ## 120 m1 25.15 28.78984 -3.640e+00 ## 120 m1 33.31 28.78984 4.520e+00</code></pre> </div> diff --git a/docs/articles/FOCUS_D_files/figure-html/plot-1.png b/docs/articles/FOCUS_D_files/figure-html/plot-1.png Binary files differindex 60433c42..5278038a 100644 --- a/docs/articles/FOCUS_D_files/figure-html/plot-1.png +++ b/docs/articles/FOCUS_D_files/figure-html/plot-1.png diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html index 77774263..4c3bed4c 100644 --- a/docs/articles/FOCUS_L.html +++ b/docs/articles/FOCUS_L.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Example evaluation of FOCUS Laboratory Data L1 to L3</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/FOCUS_L.rmd"><code>vignettes/FOCUS_L.rmd</code></a></small> <div class="hidden name"><code>FOCUS_L.rmd</code></div> @@ -113,30 +113,30 @@ <h1 class="hasAnchor"> <a href="#laboratory-data-l1" class="anchor"></a>Laboratory Data L1</h1> <p>The following code defines example dataset L1 from the FOCUS kinetics report, p. 284:</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="va">FOCUS_2006_L1</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> t <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">5</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">21</span>, <span class="fl">30</span><span class="op">)</span>, each <span class="op">=</span> <span class="fl">2</span><span class="op">)</span>, parent <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">88.3</span>, <span class="fl">91.4</span>, <span class="fl">85.6</span>, <span class="fl">84.5</span>, <span class="fl">78.9</span>, <span class="fl">77.6</span>, <span class="fl">72.0</span>, <span class="fl">71.9</span>, <span class="fl">50.3</span>, <span class="fl">59.4</span>, <span class="fl">47.0</span>, <span class="fl">45.1</span>, <span class="fl">27.7</span>, <span class="fl">27.3</span>, <span class="fl">10.0</span>, <span class="fl">10.4</span>, <span class="fl">2.9</span>, <span class="fl">4.0</span><span class="op">)</span><span class="op">)</span> -<span class="va">FOCUS_2006_L1_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L1</span><span class="op">)</span></pre></div> +<span class="va">FOCUS_2006_L1_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L1</span><span class="op">)</span></code></pre></div> <p>Here we use the assumptions of simple first order (SFO), the case of declining rate constant over time (FOMC) and the case of two different phases of the kinetics (DFOP). For a more detailed discussion of the models, please see the FOCUS kinetics report.</p> <p>Since mkin version 0.9-32 (July 2014), we can use shorthand notation like <code>"SFO"</code> for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.</p> -<div class="sourceCode" id="cb2"><pre class="downlit"> -<span class="va">m.L1.SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="va">FOCUS_2006_L1_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L1.SFO</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.L1.SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="va">FOCUS_2006_L1_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L1.SFO</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:03 2020 -## Date of summary: Thu Oct 15 12:42:03 2020 +## Date of fit: Wed Feb 3 17:32:16 2021 +## Date of summary: Wed Feb 3 17:32:16 2021 ## ## Equations: ## d_parent/dt = - k_parent * parent ## ## Model predictions using solution type analytical ## -## Fitted using 133 model solutions performed in 0.032 s +## Fitted using 133 model solutions performed in 0.031 s ## ## Error model: Constant variance ## @@ -211,38 +211,38 @@ ## 30 parent 2.9 5.251 -2.3513 ## 30 parent 4.0 5.251 -1.2513</code></pre> <p>A plot of the fit is obtained with the plot function for mkinfit objects.</p> -<div class="sourceCode" id="cb4"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L1.SFO</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, main <span class="op">=</span> <span class="st">"FOCUS L1 - SFO"</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L1.SFO</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, main <span class="op">=</span> <span class="st">"FOCUS L1 - SFO"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-4-1.png" width="576"></p> <p>The residual plot can be easily obtained by</p> -<div class="sourceCode" id="cb5"><pre class="downlit"> -<span class="fu"><a href="../reference/mkinresplot.html">mkinresplot</a></span><span class="op">(</span><span class="va">m.L1.SFO</span>, ylab <span class="op">=</span> <span class="st">"Observed"</span>, xlab <span class="op">=</span> <span class="st">"Time"</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../reference/mkinresplot.html">mkinresplot</a></span><span class="op">(</span><span class="va">m.L1.SFO</span>, ylab <span class="op">=</span> <span class="st">"Observed"</span>, xlab <span class="op">=</span> <span class="st">"Time"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-5-1.png" width="576"></p> <p>For comparison, the FOMC model is fitted as well, and the <span class="math inline">\(\chi^2\)</span> error level is checked.</p> -<div class="sourceCode" id="cb6"><pre class="downlit"> -<span class="va">m.L1.FOMC</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="va">FOCUS_2006_L1_mkin</span>, quiet<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.L1.FOMC</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="va">FOCUS_2006_L1_mkin</span>, quiet<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation did not converge: ## false convergence (8)</code></pre> -<div class="sourceCode" id="cb8"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L1.FOMC</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, main <span class="op">=</span> <span class="st">"FOCUS L1 - FOMC"</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L1.FOMC</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, main <span class="op">=</span> <span class="st">"FOCUS L1 - FOMC"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-6-1.png" width="576"></p> -<div class="sourceCode" id="cb9"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L1.FOMC</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L1.FOMC</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> <pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> <pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is ## doubtful</code></pre> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:03 2020 -## Date of summary: Thu Oct 15 12:42:03 2020 +## Date of fit: Wed Feb 3 17:32:16 2021 +## Date of summary: Wed Feb 3 17:32:16 2021 ## ## Equations: ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent ## ## Model predictions using solution type analytical ## -## Fitted using 380 model solutions performed in 0.086 s +## Fitted using 380 model solutions performed in 0.085 s ## ## Error model: Constant variance ## @@ -313,21 +313,21 @@ <h1 class="hasAnchor"> <a href="#laboratory-data-l2" class="anchor"></a>Laboratory Data L2</h1> <p>The following code defines example dataset L2 from the FOCUS kinetics report, p. 287:</p> -<div class="sourceCode" id="cb14"><pre class="downlit"> -<span class="va">FOCUS_2006_L2</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> +<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">FOCUS_2006_L2</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> t <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span><span class="op">)</span>, each <span class="op">=</span> <span class="fl">2</span><span class="op">)</span>, parent <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">96.1</span>, <span class="fl">91.8</span>, <span class="fl">41.4</span>, <span class="fl">38.7</span>, <span class="fl">19.3</span>, <span class="fl">22.3</span>, <span class="fl">4.6</span>, <span class="fl">4.6</span>, <span class="fl">2.6</span>, <span class="fl">1.2</span>, <span class="fl">0.3</span>, <span class="fl">0.6</span><span class="op">)</span><span class="op">)</span> -<span class="va">FOCUS_2006_L2_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L2</span><span class="op">)</span></pre></div> +<span class="va">FOCUS_2006_L2_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L2</span><span class="op">)</span></code></pre></div> <div id="sfo-fit-for-l2" class="section level2"> <h2 class="hasAnchor"> <a href="#sfo-fit-for-l2" class="anchor"></a>SFO fit for L2</h2> <p>Again, the SFO model is fitted and the result is plotted. The residual plot can be obtained simply by adding the argument <code>show_residuals</code> to the plot command.</p> -<div class="sourceCode" id="cb15"><pre class="downlit"> -<span class="va">m.L2.SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.L2.SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L2.SFO</span>, show_residuals <span class="op">=</span> <span class="cn">TRUE</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, - main <span class="op">=</span> <span class="st">"FOCUS L2 - SFO"</span><span class="op">)</span></pre></div> + main <span class="op">=</span> <span class="st">"FOCUS L2 - SFO"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-8-1.png" width="672"></p> <p>The <span class="math inline">\(\chi^2\)</span> error level of 14% suggests that the model does not fit very well. This is also obvious from the plots of the fit, in which we have included the residual plot.</p> <p>In the FOCUS kinetics report, it is stated that there is no apparent systematic error observed from the residual plot up to the measured DT90 (approximately at day 5), and there is an underestimation beyond that point.</p> @@ -337,24 +337,24 @@ <h2 class="hasAnchor"> <a href="#fomc-fit-for-l2" class="anchor"></a>FOMC fit for L2</h2> <p>For comparison, the FOMC model is fitted as well, and the <span class="math inline">\(\chi^2\)</span> error level is checked.</p> -<div class="sourceCode" id="cb16"><pre class="downlit"> -<span class="va">m.L2.FOMC</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.L2.FOMC</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L2.FOMC</span>, show_residuals <span class="op">=</span> <span class="cn">TRUE</span>, - main <span class="op">=</span> <span class="st">"FOCUS L2 - FOMC"</span><span class="op">)</span></pre></div> + main <span class="op">=</span> <span class="st">"FOCUS L2 - FOMC"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-9-1.png" width="672"></p> -<div class="sourceCode" id="cb17"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L2.FOMC</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L2.FOMC</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:04 2020 -## Date of summary: Thu Oct 15 12:42:04 2020 +## Date of fit: Wed Feb 3 17:32:17 2021 +## Date of summary: Wed Feb 3 17:32:17 2021 ## ## Equations: ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent ## ## Model predictions using solution type analytical ## -## Fitted using 239 model solutions performed in 0.049 s +## Fitted using 239 model solutions performed in 0.05 s ## ## Error model: Constant variance ## @@ -418,17 +418,17 @@ <h2 class="hasAnchor"> <a href="#dfop-fit-for-l2" class="anchor"></a>DFOP fit for L2</h2> <p>Fitting the four parameter DFOP model further reduces the <span class="math inline">\(\chi^2\)</span> error level.</p> -<div class="sourceCode" id="cb19"><pre class="downlit"> -<span class="va">m.L2.DFOP</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.L2.DFOP</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="va">FOCUS_2006_L2_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">m.L2.DFOP</span>, show_residuals <span class="op">=</span> <span class="cn">TRUE</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span>, - main <span class="op">=</span> <span class="st">"FOCUS L2 - DFOP"</span><span class="op">)</span></pre></div> + main <span class="op">=</span> <span class="st">"FOCUS L2 - DFOP"</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-10-1.png" width="672"></p> -<div class="sourceCode" id="cb20"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L2.DFOP</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.L2.DFOP</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:04 2020 -## Date of summary: Thu Oct 15 12:42:04 2020 +## Date of fit: Wed Feb 3 17:32:17 2021 +## Date of summary: Wed Feb 3 17:32:17 2021 ## ## Equations: ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -437,7 +437,7 @@ ## ## Model predictions using solution type analytical ## -## Fitted using 572 model solutions performed in 0.139 s +## Fitted using 581 model solutions performed in 0.133 s ## ## Error model: Constant variance ## @@ -455,7 +455,7 @@ ## parent_0 93.950000 -Inf Inf ## log_k1 -2.302585 -Inf Inf ## log_k2 -4.605170 -Inf Inf -## g_ilr 0.000000 -Inf Inf +## g_qlogis 0.000000 -Inf Inf ## ## Fixed parameter values: ## None @@ -467,19 +467,19 @@ ## ## Optimised, transformed parameters with symmetric confidence intervals: ## Estimate Std. Error Lower Upper -## parent_0 93.9500 9.998e-01 91.5900 96.3100 -## log_k1 3.1370 2.376e+03 -5615.0000 5622.0000 -## log_k2 -1.0880 6.285e-02 -1.2370 -0.9394 -## g_ilr -0.2821 7.033e-02 -0.4484 -0.1158 -## sigma 1.4140 2.886e-01 0.7314 2.0960 +## parent_0 93.950 9.998e-01 91.5900 96.3100 +## log_k1 3.117 1.929e+03 -4558.0000 4564.0000 +## log_k2 -1.088 6.285e-02 -1.2370 -0.9394 +## g_qlogis -0.399 9.946e-02 -0.6342 -0.1638 +## sigma 1.414 2.886e-01 0.7314 2.0960 ## ## Parameter correlation: -## parent_0 log_k1 log_k2 g_ilr sigma -## parent_0 1.000e+00 5.157e-07 2.376e-09 2.665e-01 -6.837e-09 -## log_k1 5.157e-07 1.000e+00 8.434e-05 -1.659e-04 -7.786e-06 -## log_k2 2.376e-09 8.434e-05 1.000e+00 -7.903e-01 -1.263e-08 -## g_ilr 2.665e-01 -1.659e-04 -7.903e-01 1.000e+00 3.248e-08 -## sigma -6.837e-09 -7.786e-06 -1.263e-08 3.248e-08 1.000e+00 +## parent_0 log_k1 log_k2 g_qlogis sigma +## parent_0 1.000e+00 6.459e-07 9.147e-11 2.665e-01 8.413e-11 +## log_k1 6.459e-07 1.000e+00 1.061e-04 -2.087e-04 -9.802e-06 +## log_k2 9.147e-11 1.061e-04 1.000e+00 -7.903e-01 -2.429e-09 +## g_qlogis 2.665e-01 -2.087e-04 -7.903e-01 1.000e+00 4.049e-09 +## sigma 8.413e-11 -9.802e-06 -2.429e-09 4.049e-09 1.000e+00 ## ## Backtransformed parameters: ## Confidence intervals for internally transformed parameters are asymmetric. @@ -487,7 +487,7 @@ ## for estimators of untransformed parameters. ## Estimate t value Pr(>t) Lower Upper ## parent_0 93.9500 9.397e+01 2.036e-12 91.5900 96.3100 -## k1 23.0400 4.303e-04 4.998e-01 0.0000 Inf +## k1 22.5800 5.303e-04 4.998e-01 0.0000 Inf ## k2 0.3369 1.591e+01 4.697e-07 0.2904 0.3909 ## g 0.4016 1.680e+01 3.238e-07 0.3466 0.4591 ## sigma 1.4140 4.899e+00 8.776e-04 0.7314 2.0960 @@ -499,7 +499,7 @@ ## ## Estimated disappearance times: ## DT50 DT90 DT50back DT50_k1 DT50_k2 -## parent 0.5335 5.311 1.599 0.03009 2.058</code></pre> +## parent 0.5335 5.311 1.599 0.0307 2.058</code></pre> <p>Here, the DFOP model is clearly the best-fit model for dataset L2 based on the chi^2 error level criterion. However, the failure to calculate the covariance matrix indicates that the parameter estimates correlate excessively. Therefore, the FOMC model may be preferred for this dataset.</p> </div> </div> @@ -507,20 +507,20 @@ <h1 class="hasAnchor"> <a href="#laboratory-data-l3" class="anchor"></a>Laboratory Data L3</h1> <p>The following code defines example dataset L3 from the FOCUS kinetics report, p. 290.</p> -<div class="sourceCode" id="cb22"><pre class="downlit"> -<span class="va">FOCUS_2006_L3</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> +<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">FOCUS_2006_L3</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> t <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">30</span>, <span class="fl">60</span>, <span class="fl">91</span>, <span class="fl">120</span><span class="op">)</span>, parent <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">97.8</span>, <span class="fl">60</span>, <span class="fl">51</span>, <span class="fl">43</span>, <span class="fl">35</span>, <span class="fl">22</span>, <span class="fl">15</span>, <span class="fl">12</span><span class="op">)</span><span class="op">)</span> -<span class="va">FOCUS_2006_L3_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L3</span><span class="op">)</span></pre></div> +<span class="va">FOCUS_2006_L3_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L3</span><span class="op">)</span></code></pre></div> <div id="fit-multiple-models" class="section level2"> <h2 class="hasAnchor"> <a href="#fit-multiple-models" class="anchor"></a>Fit multiple models</h2> <p>As of mkin version 0.9-39 (June 2015), we can fit several models to one or more datasets in one call to the function <code>mmkin</code>. The datasets have to be passed in a list, in this case a named list holding only the L3 dataset prepared above.</p> -<div class="sourceCode" id="cb23"><pre class="downlit"> -<span class="co"># Only use one core here, not to offend the CRAN checks</span> +<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="co"># Only use one core here, not to offend the CRAN checks</span> <span class="va">mm.L3</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mmkin.html">mmkin</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, cores <span class="op">=</span> <span class="fl">1</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="st">"FOCUS L3"</span> <span class="op">=</span> <span class="va">FOCUS_2006_L3_mkin</span><span class="op">)</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">)</span></pre></div> +<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-12-1.png" width="700"></p> <p>The <span class="math inline">\(\chi^2\)</span> error level of 21% as well as the plot suggest that the SFO model does not fit very well. The FOMC model performs better, with an error level at which the <span class="math inline">\(\chi^2\)</span> test passes of 7%. Fitting the four parameter DFOP model further reduces the <span class="math inline">\(\chi^2\)</span> error level considerably.</p> </div> @@ -529,12 +529,12 @@ <a href="#accessing-mmkin-objects" class="anchor"></a>Accessing mmkin objects</h2> <p>The objects returned by mmkin are arranged like a matrix, with models as a row index and datasets as a column index.</p> <p>We can extract the summary and plot for <em>e.g.</em> the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.</p> -<div class="sourceCode" id="cb24"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">[[</span><span class="st">"DFOP"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">[[</span><span class="st">"DFOP"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:05 2020 -## Date of summary: Thu Oct 15 12:42:05 2020 +## Date of fit: Wed Feb 3 17:32:18 2021 +## Date of summary: Wed Feb 3 17:32:18 2021 ## ## Equations: ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -543,7 +543,7 @@ ## ## Model predictions using solution type analytical ## -## Fitted using 373 model solutions performed in 0.084 s +## Fitted using 376 model solutions performed in 0.081 s ## ## Error model: Constant variance ## @@ -561,7 +561,7 @@ ## parent_0 97.800000 -Inf Inf ## log_k1 -2.302585 -Inf Inf ## log_k2 -4.605170 -Inf Inf -## g_ilr 0.000000 -Inf Inf +## g_qlogis 0.000000 -Inf Inf ## ## Fixed parameter values: ## None @@ -576,16 +576,16 @@ ## parent_0 97.7500 1.01900 94.5000 101.000000 ## log_k1 -0.6612 0.10050 -0.9812 -0.341300 ## log_k2 -4.2860 0.04322 -4.4230 -4.148000 -## g_ilr -0.1229 0.03727 -0.2415 -0.004343 +## g_qlogis -0.1739 0.05270 -0.3416 -0.006142 ## sigma 1.0170 0.25430 0.2079 1.827000 ## ## Parameter correlation: -## parent_0 log_k1 log_k2 g_ilr sigma -## parent_0 1.000e+00 1.732e-01 2.282e-02 4.009e-01 -6.868e-07 -## log_k1 1.732e-01 1.000e+00 4.945e-01 -5.809e-01 3.175e-07 -## log_k2 2.282e-02 4.945e-01 1.000e+00 -6.812e-01 7.631e-07 -## g_ilr 4.009e-01 -5.809e-01 -6.812e-01 1.000e+00 -8.694e-07 -## sigma -6.868e-07 3.175e-07 7.631e-07 -8.694e-07 1.000e+00 +## parent_0 log_k1 log_k2 g_qlogis sigma +## parent_0 1.000e+00 1.732e-01 2.282e-02 4.009e-01 -9.671e-08 +## log_k1 1.732e-01 1.000e+00 4.945e-01 -5.809e-01 7.148e-07 +## log_k2 2.282e-02 4.945e-01 1.000e+00 -6.812e-01 1.022e-06 +## g_qlogis 4.009e-01 -5.809e-01 -6.812e-01 1.000e+00 -7.929e-07 +## sigma -9.671e-08 7.148e-07 1.022e-06 -7.929e-07 1.000e+00 ## ## Backtransformed parameters: ## Confidence intervals for internally transformed parameters are asymmetric. @@ -617,8 +617,8 @@ ## 60 parent 22.0 23.26 -1.25919 ## 91 parent 15.0 15.18 -0.18181 ## 120 parent 12.0 10.19 1.81395</code></pre> -<div class="sourceCode" id="cb26"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">[[</span><span class="st">"DFOP"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L3</span><span class="op">[[</span><span class="st">"DFOP"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-13-1.png" width="700"></p> <p>Here, a look to the model plot, the confidence intervals of the parameters and the correlation matrix suggest that the parameter estimates are reliable, and the DFOP model can be used as the best-fit model based on the <span class="math inline">\(\chi^2\)</span> error level criterion for laboratory data L3.</p> <p>This is also an example where the standard t-test for the parameter <code>g_ilr</code> is misleading, as it tests for a significant difference from zero. In this case, zero appears to be the correct value for this parameter, and the confidence interval for the backtransformed parameter <code>g</code> is quite narrow.</p> @@ -628,26 +628,26 @@ <h1 class="hasAnchor"> <a href="#laboratory-data-l4" class="anchor"></a>Laboratory Data L4</h1> <p>The following code defines example dataset L4 from the FOCUS kinetics report, p. 293:</p> -<div class="sourceCode" id="cb27"><pre class="downlit"> -<span class="va">FOCUS_2006_L4</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> +<div class="sourceCode" id="cb27"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">FOCUS_2006_L4</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> t <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">30</span>, <span class="fl">60</span>, <span class="fl">91</span>, <span class="fl">120</span><span class="op">)</span>, parent <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">96.6</span>, <span class="fl">96.3</span>, <span class="fl">94.3</span>, <span class="fl">88.8</span>, <span class="fl">74.9</span>, <span class="fl">59.9</span>, <span class="fl">53.5</span>, <span class="fl">49.0</span><span class="op">)</span><span class="op">)</span> -<span class="va">FOCUS_2006_L4_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L4</span><span class="op">)</span></pre></div> +<span class="va">FOCUS_2006_L4_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_L4</span><span class="op">)</span></code></pre></div> <p>Fits of the SFO and FOMC models, plots and summaries are produced below:</p> -<div class="sourceCode" id="cb28"><pre class="downlit"> -<span class="co"># Only use one core here, not to offend the CRAN checks</span> +<div class="sourceCode" id="cb28"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="co"># Only use one core here, not to offend the CRAN checks</span> <span class="va">mm.L4</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mmkin.html">mmkin</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"FOMC"</span><span class="op">)</span>, cores <span class="op">=</span> <span class="fl">1</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="st">"FOCUS L4"</span> <span class="op">=</span> <span class="va">FOCUS_2006_L4_mkin</span><span class="op">)</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">)</span></pre></div> +<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_L_files/figure-html/unnamed-chunk-15-1.png" width="700"></p> <p>The <span class="math inline">\(\chi^2\)</span> error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the <span class="math inline">\(\chi^2\)</span> test passes is slightly lower for the FOMC model. However, the difference appears negligible.</p> -<div class="sourceCode" id="cb29"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">[[</span><span class="st">"SFO"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb29"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">[[</span><span class="st">"SFO"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:05 2020 -## Date of summary: Thu Oct 15 12:42:06 2020 +## Date of fit: Wed Feb 3 17:32:19 2021 +## Date of summary: Wed Feb 3 17:32:19 2021 ## ## Equations: ## d_parent/dt = - k_parent * parent @@ -707,12 +707,12 @@ ## Estimated disappearance times: ## DT50 DT90 ## parent 106 352</code></pre> -<div class="sourceCode" id="cb31"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">[[</span><span class="st">"FOMC"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></pre></div> -<pre><code>## mkin version used for fitting: 0.9.50.3 +<div class="sourceCode" id="cb31"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">mm.L4</span><span class="op">[[</span><span class="st">"FOMC"</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> +<pre><code>## mkin version used for fitting: 1.0.0 ## R version used for fitting: 4.0.3 -## Date of fit: Thu Oct 15 12:42:05 2020 -## Date of summary: Thu Oct 15 12:42:06 2020 +## Date of fit: Wed Feb 3 17:32:19 2021 +## Date of summary: Wed Feb 3 17:32:19 2021 ## ## Equations: ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png Binary files differindex a5418249..80ca888e 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png Binary files differindex 521c7079..12e380da 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png Binary files differindex 1aa97f8c..8b2954c7 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png Binary files differindex 36e862f6..922d1f0e 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png Binary files differindex 68b24b5e..be3cbcd0 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png Binary files differindex 53e33b68..55080b33 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png Binary files differindex 47d5b335..d7b0793a 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png Binary files differindex f644c299..570f0026 100644 --- a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png +++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png diff --git a/docs/articles/index.html b/docs/articles/index.html index 0ff8d97f..369b506c 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -71,7 +71,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -120,7 +120,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html index 0c417f13..e240323f 100644 --- a/docs/articles/mkin.html +++ b/docs/articles/mkin.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Introduction to mkin</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/mkin.rmd"><code>vignettes/mkin.rmd</code></a></small> <div class="hidden name"><code>mkin.rmd</code></div> @@ -114,12 +114,12 @@ <h1 class="hasAnchor"> <a href="#abstract" class="anchor"></a>Abstract</h1> <p>In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance has been developed, based on nonlinear optimisation. The <code>R</code> add-on package <code>mkin</code> implements fitting some of the models recommended in this guidance from within R and calculates some statistical measures for data series within one or more compartments, for parent and metabolites.</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="co"># Define the kinetic model</span> -<span class="va">m_SFO_SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>, - M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>, - M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, +<span class="va">m_SFO_SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>, + M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>, + M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> @@ -142,7 +142,7 @@ <span class="va">f_SFO_SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>, <span class="va">d_SFO_SFO_SFO_err</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="co"># Plot the results separately for parent and metabolites</span> -<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">f_SFO_SFO_SFO</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></pre></div> +<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">f_SFO_SFO_SFO</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></code></pre></div> <p><img src="mkin_files/figure-html/unnamed-chunk-2-1.png" width="768"></p> </div> <div id="background" class="section level1"> diff --git a/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png Binary files differindex 2f3d7a46..8acd92af 100644 --- a/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png +++ b/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png diff --git a/docs/articles/twa.html b/docs/articles/twa.html index 3f7820b4..c270659b 100644 --- a/docs/articles/twa.html +++ b/docs/articles/twa.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Calculation of time weighted average concentrations with mkin</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/twa.rmd"><code>vignettes/twa.rmd</code></a></small> <div class="hidden name"><code>twa.rmd</code></div> diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html index b740b5ed..8bdcbe30 100644 --- a/docs/articles/web_only/FOCUS_Z.html +++ b/docs/articles/web_only/FOCUS_Z.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Example evaluation of FOCUS dataset Z</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/web_only/FOCUS_Z.rmd"><code>vignettes/web_only/FOCUS_Z.rmd</code></a></small> <div class="hidden name"><code>FOCUS_Z.rmd</code></div> @@ -114,8 +114,8 @@ <h1 class="hasAnchor"> <a href="#the-data" class="anchor"></a>The data</h1> <p>The following code defines the example dataset from Appendix 7 to the FOCUS kinetics report <span class="citation">(FOCUS Work Group on Degradation Kinetics 2014, 354)</span>.</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="va">LOD</span> <span class="op">=</span> <span class="fl">0.5</span> <span class="va">FOCUS_2006_Z</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> t <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">0.04</span>, <span class="fl">0.125</span>, <span class="fl">0.29</span>, <span class="fl">0.54</span>, <span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">4</span>, <span class="fl">7</span>, <span class="fl">10</span>, <span class="fl">14</span>, <span class="fl">21</span>, @@ -129,25 +129,25 @@ Z3 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="cn">NA</span>, <span class="cn">NA</span>, <span class="cn">NA</span>, <span class="cn">NA</span>, <span class="fl">0.5</span> <span class="op">*</span> <span class="va">LOD</span>, <span class="fl">9.2</span>, <span class="fl">13.1</span>, <span class="fl">22.3</span>, <span class="fl">28.4</span>, <span class="fl">32.5</span>, <span class="fl">25.2</span>, <span class="fl">17.2</span>, <span class="fl">4.8</span>, <span class="fl">4.5</span>, <span class="fl">2.8</span>, <span class="fl">4.4</span><span class="op">)</span><span class="op">)</span> -<span class="va">FOCUS_2006_Z_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_Z</span><span class="op">)</span></pre></div> +<span class="va">FOCUS_2006_Z_mkin</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span><span class="op">(</span><span class="va">FOCUS_2006_Z</span><span class="op">)</span></code></pre></div> </div> <div id="parent-and-one-metabolite" class="section level1"> <h1 class="hasAnchor"> <a href="#parent-and-one-metabolite" class="anchor"></a>Parent and one metabolite</h1> <p>The next step is to set up the models used for the kinetic analysis. As the simultaneous fit of parent and the first metabolite is usually straightforward, Step 1 (SFO for parent only) is skipped here. We start with the model 2a, with formation and decline of metabolite Z1 and the pathway from parent directly to sink included (default in mkin).</p> -<div class="sourceCode" id="cb2"><pre class="downlit"> -<span class="va">Z.2a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb4"><pre class="downlit"> -<span class="va">m.Z.2a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.2a</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.2a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.2a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.2a</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb6"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.2a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.2a</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png" width="700"></p> -<div class="sourceCode" id="cb7"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.2a</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></pre></div> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.2a</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></code></pre></div> <pre><code>## Estimate se_notrans t value Pr(>t) Lower Upper ## Z0_0 97.01488 3.301084 29.3888 3.2971e-21 91.66556 102.3642 ## k_Z0 2.23601 0.207078 10.7979 3.3309e-11 1.95303 2.5600 @@ -156,20 +156,20 @@ ## sigma 4.80411 0.635638 7.5579 3.2592e-08 3.52677 6.0815</code></pre> <p>As obvious from the parameter summary (the component of the summary), the kinetic rate constant from parent compound Z to sink is very small and the t-test for this parameter suggests that it is not significantly different from zero. This suggests, in agreement with the analysis in the FOCUS kinetics report, to simplify the model by removing the pathway to sink.</p> <p>A similar result can be obtained when formation fractions are used in the model formulation:</p> -<div class="sourceCode" id="cb9"><pre class="downlit"> -<span class="va">Z.2a.ff</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, - use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb11"><pre class="downlit"> -<span class="va">m.Z.2a.ff</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.2a.ff</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.2a.ff</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, + use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.2a.ff</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.2a.ff</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb13"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.2a.ff</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.2a.ff</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png" width="700"></p> -<div class="sourceCode" id="cb14"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.2a.ff</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></pre></div> +<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.2a.ff</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></code></pre></div> <pre><code>## Estimate se_notrans t value Pr(>t) Lower Upper ## Z0_0 97.01488 3.301084 29.3888 3.2971e-21 91.66556 102.3642 ## k_Z0 2.23601 0.207078 10.7979 3.3309e-11 1.95303 2.5600 @@ -179,19 +179,19 @@ <p>Here, the ilr transformed formation fraction fitted in the model takes a very large value, and the backtransformed formation fraction from parent Z to Z1 is practically unity. Here, the covariance matrix used for the calculation of confidence intervals is not returned as the model is overparameterised.</p> <p>A simplified model is obtained by removing the pathway to the sink. </p> <p>In the following, we use the parameterisation with formation fractions in order to be able to compare with the results in the FOCUS guidance, and as it makes it easier to use parameters obtained in a previous fit when adding a further metabolite.</p> -<div class="sourceCode" id="cb16"><pre class="downlit"> -<span class="va">Z.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb18"><pre class="downlit"> -<span class="va">m.Z.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.3</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.3</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb20"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.3</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.3</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png" width="700"></p> -<div class="sourceCode" id="cb21"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.3</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></pre></div> +<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.3</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></code></pre></div> <pre><code>## Estimate se_notrans t value Pr(>t) Lower Upper ## Z0_0 97.01488 2.597342 37.352 2.0106e-24 91.67597 102.3538 ## k_Z0 2.23601 0.146904 15.221 9.1477e-15 1.95354 2.5593 @@ -203,59 +203,59 @@ <h1 class="hasAnchor"> <a href="#metabolites-z2-and-z3" class="anchor"></a>Metabolites Z2 and Z3</h1> <p>As suggested in the FOCUS report, the pathway to sink was removed for metabolite Z1 as well in the next step. While this step appears questionable on the basis of the above results, it is followed here for the purpose of comparison. Also, in the FOCUS report, it is assumed that there is additional empirical evidence that Z1 quickly and exclusively hydrolyses to Z2.</p> -<div class="sourceCode" id="cb23"><pre class="downlit"> -<span class="va">Z.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb25"><pre class="downlit"> -<span class="va">m.Z.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb27"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.5</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb27"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.5</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png" width="700"></p> <p>Finally, metabolite Z3 is added to the model. We use the optimised differential equation parameter values from the previous fit in order to accelerate the optimization.</p> -<div class="sourceCode" id="cb28"><pre class="downlit"> -<span class="va">Z.FOCUS</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, - Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, - use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb30"><pre class="downlit"> -<span class="va">m.Z.FOCUS</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.FOCUS</span>, <span class="va">FOCUS_2006_Z_mkin</span>, +<div class="sourceCode" id="cb28"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.FOCUS</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, + Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, + use_of_ff <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb30"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.FOCUS</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.FOCUS</span>, <span class="va">FOCUS_2006_Z_mkin</span>, parms.ini <span class="op">=</span> <span class="va">m.Z.5</span><span class="op">$</span><span class="va">bparms.ode</span>, - quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> + quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : ## Observations with value of zero were removed from the data</code></pre> <pre><code>## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : Optimisation did not converge: ## false convergence (8)</code></pre> -<div class="sourceCode" id="cb33"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb33"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png" width="700"></p> -<div class="sourceCode" id="cb34"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></pre></div> +<div class="sourceCode" id="cb34"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">bpar</span></code></pre></div> <pre><code>## Estimate se_notrans t value Pr(>t) Lower Upper -## Z0_0 96.838721 1.994275 48.5584 4.0283e-42 92.826878 100.850563 -## k_Z0 2.215400 0.118459 18.7019 1.0414e-23 1.989462 2.466998 -## k_Z1 0.478301 0.028257 16.9267 6.2411e-22 0.424705 0.538662 -## k_Z2 0.451623 0.042138 10.7176 1.6313e-14 0.374336 0.544867 -## k_Z3 0.058694 0.015246 3.8499 1.7804e-04 0.034809 0.098967 -## f_Z2_to_Z3 0.471510 0.058352 8.0804 9.6640e-11 0.357775 0.588283 +## Z0_0 96.839001 1.994273 48.5585 4.0276e-42 92.827060 100.850943 +## k_Z0 2.215367 0.118456 18.7021 1.0410e-23 1.989432 2.466960 +## k_Z1 0.478310 0.028258 16.9265 6.2430e-22 0.424712 0.538673 +## k_Z2 0.451628 0.042139 10.7176 1.6313e-14 0.374337 0.544877 +## k_Z3 0.058692 0.015245 3.8498 1.7806e-04 0.034806 0.098972 +## f_Z2_to_Z3 0.471498 0.058350 8.0805 9.6614e-11 0.357741 0.588294 ## sigma 3.984431 0.383402 10.3923 4.5575e-14 3.213126 4.755736</code></pre> -<div class="sourceCode" id="cb36"><pre class="downlit"> -<span class="fu"><a href="../../reference/endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb36"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">m.Z.FOCUS</span><span class="op">)</span></code></pre></div> <pre><code>## $ff ## Z2_Z3 Z2_sink -## 0.47151 0.52849 +## 0.4715 0.5285 ## ## $distimes ## DT50 DT90 ## Z0 0.31288 1.0394 -## Z1 1.44919 4.8141 -## Z2 1.53479 5.0985 -## Z3 11.80955 39.2305</code></pre> +## Z1 1.44916 4.8140 +## Z2 1.53478 5.0984 +## Z3 11.80983 39.2314</code></pre> <p>This fit corresponds to the final result chosen in Appendix 7 of the FOCUS report. Confidence intervals returned by mkin are based on internally transformed parameters, however.</p> </div> <div id="using-the-sforb-model" class="section level1"> @@ -263,107 +263,101 @@ <a href="#using-the-sforb-model" class="anchor"></a>Using the SFORB model</h1> <p>As the FOCUS report states, there is a certain tailing of the time course of metabolite Z3. Also, the time course of the parent compound is not fitted very well using the SFO model, as residues at a certain low level remain.</p> <p>Therefore, an additional model is offered here, using the single first-order reversible binding (SFORB) model for metabolite Z3. As expected, the <span class="math inline">\(\chi^2\)</span> error level is lower for metabolite Z3 using this model and the graphical fit for Z3 is improved. However, the covariance matrix is not returned.</p> -<div class="sourceCode" id="cb38"><pre class="downlit"> -<span class="va">Z.mkin.1</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, - Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb40"><pre class="downlit"> -<span class="va">m.Z.mkin.1</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.1</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb38"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.mkin.1</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, + Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb40"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.mkin.1</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.1</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb42"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.1</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.1</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png" width="700"></p> -<div class="sourceCode" id="cb43"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.mkin.1</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">cov.unscaled</span></pre></div> +<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">m.Z.mkin.1</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">$</span><span class="va">cov.unscaled</span></code></pre></div> <pre><code>## NULL</code></pre> <p>Therefore, a further stepwise model building is performed starting from the stage of parent and two metabolites, starting from the assumption that the model fit for the parent compound can be improved by using the SFORB model.</p> -<div class="sourceCode" id="cb45"><pre class="downlit"> -<span class="va">Z.mkin.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb47"><pre class="downlit"> -<span class="va">m.Z.mkin.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.3</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb45"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.mkin.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb47"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.mkin.3</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.3</span>, <span class="va">FOCUS_2006_Z_mkin</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations with ## value of zero were removed from the data</code></pre> -<div class="sourceCode" id="cb49"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.3</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb49"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.3</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png" width="700"></p> <p>This results in a much better representation of the behaviour of the parent compound Z0.</p> <p>Finally, Z3 is added as well. These models appear overparameterised (no covariance matrix returned) if the sink for Z1 is left in the models.</p> -<div class="sourceCode" id="cb50"><pre class="downlit"> -<span class="va">Z.mkin.4</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, - Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb52"><pre class="downlit"> -<span class="va">m.Z.mkin.4</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.4</span>, <span class="va">FOCUS_2006_Z_mkin</span>, +<div class="sourceCode" id="cb50"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.mkin.4</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, + Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb52"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.mkin.4</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.4</span>, <span class="va">FOCUS_2006_Z_mkin</span>, parms.ini <span class="op">=</span> <span class="va">m.Z.mkin.3</span><span class="op">$</span><span class="va">bparms.ode</span>, - quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> + quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin. ## 3$bparms.ode, : Observations with value of zero were removed from the data</code></pre> -<pre><code>## Warning in mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin. -## 3$bparms.ode, : Shapiro-Wilk test for standardized residuals: p = 0.0449</code></pre> -<div class="sourceCode" id="cb55"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.4</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb54"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.4</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png" width="700"></p> <p>The error level of the fit, but especially of metabolite Z3, can be improved if the SFORB model is chosen for this metabolite, as this model is capable of representing the tailing of the metabolite decline phase.</p> -<div class="sourceCode" id="cb56"><pre class="downlit"> -<span class="va">Z.mkin.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, - Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, - Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb58"><pre class="downlit"> -<span class="va">m.Z.mkin.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, +<div class="sourceCode" id="cb55"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">Z.mkin.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>Z0 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span>, <span class="st">"Z1"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z2"</span>, sink <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>, + Z2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"Z3"</span><span class="op">)</span>, + Z3 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFORB"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb57"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.mkin.5</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, parms.ini <span class="op">=</span> <span class="va">m.Z.mkin.4</span><span class="op">$</span><span class="va">bparms.ode</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">4</span><span class="op">]</span>, - quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> + quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin. ## 4$bparms.ode[1:4], : Observations with value of zero were removed from the data</code></pre> -<pre><code>## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin. -## 4$bparms.ode[1:4], : Shapiro-Wilk test for standardized residuals: p = 0.00785</code></pre> -<div class="sourceCode" id="cb61"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.5</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb59"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.5</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png" width="700"></p> <p>The summary view of the backtransformed parameters shows that we get no confidence intervals due to overparameterisation. As the optimized is excessively small, it seems reasonable to fix it to zero.</p> -<div class="sourceCode" id="cb62"><pre class="downlit"> -<span class="va">m.Z.mkin.5a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, +<div class="sourceCode" id="cb60"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m.Z.mkin.5a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">Z.mkin.5</span>, <span class="va">FOCUS_2006_Z_mkin</span>, parms.ini <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">m.Z.mkin.5</span><span class="op">$</span><span class="va">bparms.ode</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">7</span><span class="op">]</span>, k_Z3_bound_free <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>, fixed_parms <span class="op">=</span> <span class="st">"k_Z3_bound_free"</span>, - quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></pre></div> + quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = c(m.Z.mkin. ## 5$bparms.ode[1:7], : Observations with value of zero were removed from the data</code></pre> -<pre><code>## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = c(m.Z.mkin. -## 5$bparms.ode[1:7], : Shapiro-Wilk test for standardized residuals: p = 0.00785</code></pre> -<div class="sourceCode" id="cb65"><pre class="downlit"> -<span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb62"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png" width="700"></p> <p>As expected, the residual plots for Z0 and Z3 are more random than in the case of the all SFO model for which they were shown above. In conclusion, the model is proposed as the best-fit model for the dataset from Appendix 7 of the FOCUS report.</p> <p>A graphical representation of the confidence intervals can finally be obtained.</p> -<div class="sourceCode" id="cb66"><pre class="downlit"> -<span class="fu"><a href="../../reference/mkinparplot.html">mkinparplot</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb63"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/mkinparplot.html">mkinparplot</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></code></pre></div> <p><img src="FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png" width="700"></p> <p>The endpoints obtained with this model are</p> -<div class="sourceCode" id="cb67"><pre class="downlit"> -<span class="fu"><a href="../../reference/endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb64"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="../../reference/endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">m.Z.mkin.5a</span><span class="op">)</span></code></pre></div> <pre><code>## $ff ## Z0_free Z2_Z3 Z2_sink Z3_free ## 1.00000 0.53656 0.46344 1.00000 ## ## $SFORB ## Z0_b1 Z0_b2 Z3_b1 Z3_b2 -## 2.4471358 0.0075126 0.0800073 0.0000000 +## 2.4471371 0.0075126 0.0800070 0.0000000 ## ## $distimes ## DT50 DT90 DT50back DT50_Z0_b1 DT50_Z0_b2 DT50_Z3_b1 DT50_Z3_b2 ## Z0 0.3043 1.1848 0.35666 0.28325 92.265 NA NA ## Z1 1.5148 5.0320 NA NA NA NA NA -## Z2 1.6414 5.4526 NA NA NA NA NA +## Z2 1.6414 5.4525 NA NA NA NA NA ## Z3 NA NA NA NA NA 8.6636 Inf</code></pre> <p>It is clear the degradation rate of Z3 towards the end of the experiment is very low as DT50_Z3_b2 (the second Eigenvalue of the system of two differential equations representing the SFORB system for Z3, corresponding to the slower rate constant of the DFOP model) is reported to be infinity. However, this appears to be a feature of the data.</p> </div> diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png Binary files differindex 575def46..3da22dad 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png Binary files differindex abdded73..8c152f77 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png Binary files differindex 599f3226..732e6c65 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png Binary files differindex ce993d09..cf6d45ca 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png Binary files differindex 4b71d7b8..5c29341c 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png Binary files differindex 575def46..3da22dad 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png Binary files differindex 98ce34a7..02a97a1e 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png Binary files differindex d04a411e..d070e7ed 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png Binary files differindex 0a9265f5..65309e3b 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png Binary files differindex 0acfa2a4..22610e84 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png diff --git a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png Binary files differindex ca191b00..47d46a9f 100644 --- a/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png +++ b/docs/articles/web_only/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png diff --git a/docs/articles/web_only/NAFTA_examples.html b/docs/articles/web_only/NAFTA_examples.html index 411d4bb8..d3e23253 100644 --- a/docs/articles/web_only/NAFTA_examples.html +++ b/docs/articles/web_only/NAFTA_examples.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/web_only/NAFTA_examples.rmd"><code>vignettes/web_only/NAFTA_examples.rmd</code></a></small> <div class="hidden name"><code>NAFTA_examples.rmd</code></div> @@ -122,15 +122,15 @@ <div id="example-on-page-5-upper-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-5-upper-panel" class="anchor"></a>Example on page 5, upper panel</h2> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="va">p5a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p5a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p5a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p5a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb4"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p5a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p5a</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p5a-1.png" width="700"></p> -<div class="sourceCode" id="cb5"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p5a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p5a</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 465.21753 56.27506 32.06401 @@ -156,7 +156,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 9.99e+01 1.41e-26 98.8116 101.0810 ## k1 2.67e-02 5.05e-06 0.0243 0.0295 -## k2 2.17e-12 5.00e-01 0.0000 Inf +## k2 2.42e-12 5.00e-01 0.0000 Inf ## g 6.47e-01 3.67e-06 0.6248 0.6677 ## sigma 1.27e+00 8.91e-06 0.8395 1.6929 ## @@ -165,7 +165,7 @@ ## DT50 DT90 DT50_rep ## SFO 67.7 2.25e+02 6.77e+01 ## IORE 58.2 1.07e+03 3.22e+02 -## DFOP 55.5 5.83e+11 3.20e+11 +## DFOP 55.5 5.22e+11 2.86e+11 ## ## Representative half-life: ## [1] 321.51</code></pre> @@ -173,15 +173,15 @@ <div id="example-on-page-5-lower-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-5-lower-panel" class="anchor"></a>Example on page 5, lower panel</h2> -<div class="sourceCode" id="cb7"><pre class="downlit"> -<span class="va">p5b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p5b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p5b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p5b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb10"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p5b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p5b</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p5b-1.png" width="700"></p> -<div class="sourceCode" id="cb11"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p5b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p5b</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 94.81123 10.10936 7.55871 @@ -207,7 +207,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 9.84e+01 1.24e-27 97.8078 98.9187 ## k1 1.55e-02 4.10e-04 0.0143 0.0167 -## k2 1.04e-11 5.00e-01 0.0000 Inf +## k2 1.10e-11 5.00e-01 0.0000 Inf ## g 6.89e-01 2.92e-03 0.6626 0.7142 ## sigma 6.48e-01 2.38e-05 0.4147 0.8813 ## @@ -216,7 +216,7 @@ ## DT50 DT90 DT50_rep ## SFO 86.6 2.88e+02 8.66e+01 ## IORE 85.5 7.17e+02 2.16e+02 -## DFOP 83.6 1.09e+11 6.67e+10 +## DFOP 83.6 1.03e+11 6.29e+10 ## ## Representative half-life: ## [1] 215.87</code></pre> @@ -224,15 +224,15 @@ <div id="example-on-page-6" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-6" class="anchor"></a>Example on page 6</h2> -<div class="sourceCode" id="cb13"><pre class="downlit"> -<span class="va">p6</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p6"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p6</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p6"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb16"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p6</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p6</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p6-1.png" width="700"></p> -<div class="sourceCode" id="cb17"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p6</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p6</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 188.45361 51.00699 42.46931 @@ -258,7 +258,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 9.66e+01 1.57e-25 95.3476 97.8979 ## k1 2.55e-02 7.33e-06 0.0233 0.0278 -## k2 3.88e-11 5.00e-01 0.0000 Inf +## k2 3.60e-11 5.00e-01 0.0000 Inf ## g 8.61e-01 7.55e-06 0.8314 0.8867 ## sigma 1.46e+00 6.93e-06 0.9661 1.9483 ## @@ -267,7 +267,7 @@ ## DT50 DT90 DT50_rep ## SFO 38.6 1.28e+02 3.86e+01 ## IORE 34.0 1.77e+02 5.32e+01 -## DFOP 34.1 8.42e+09 1.79e+10 +## DFOP 34.1 9.07e+09 1.93e+10 ## ## Representative half-life: ## [1] 53.17</code></pre> @@ -275,15 +275,15 @@ <div id="example-on-page-7" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-7" class="anchor"></a>Example on page 7</h2> -<div class="sourceCode" id="cb19"><pre class="downlit"> -<span class="va">p7</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p7"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p7</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p7"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb22"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p7</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p7</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p7-1.png" width="700"></p> -<div class="sourceCode" id="cb23"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p7</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p7</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 3661.661 3195.030 3174.145 @@ -309,7 +309,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 9.89e+01 9.44e-49 95.4640 102.2573 ## k1 1.81e-02 1.75e-01 0.0116 0.0281 -## k2 2.30e-10 5.00e-01 0.0000 Inf +## k2 2.89e-10 5.00e-01 0.0000 Inf ## g 6.06e-01 2.19e-01 0.4826 0.7178 ## sigma 7.40e+00 2.97e-15 6.0201 8.7754 ## @@ -318,7 +318,7 @@ ## DT50 DT90 DT50_rep ## SFO 94.3 3.13e+02 9.43e+01 ## IORE 96.7 1.51e+03 4.55e+02 -## DFOP 96.4 5.95e+09 3.01e+09 +## DFOP 96.4 4.75e+09 2.40e+09 ## ## Representative half-life: ## [1] 454.55</code></pre> @@ -331,15 +331,15 @@ <h2 class="hasAnchor"> <a href="#example-on-page-8" class="anchor"></a>Example on page 8</h2> <p>For this dataset, the IORE fit does not converge when the default starting values used by mkin for the IORE model are used. Therefore, a lower value for the rate constant is used here.</p> -<div class="sourceCode" id="cb25"><pre class="downlit"> -<span class="va">p8</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p8"</span><span class="op">]</span><span class="op">]</span>, parms.ini <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span>k__iore_parent <span class="op">=</span> <span class="fl">1e-3</span><span class="op">)</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p8</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p8"</span><span class="op">]</span><span class="op">]</span>, parms.ini <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span>k__iore_parent <span class="op">=</span> <span class="fl">1e-3</span><span class="op">)</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb28"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p8</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb28"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p8</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p8-1.png" width="700"></p> -<div class="sourceCode" id="cb29"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p8</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb29"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p8</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 1996.9408 444.9237 547.5616 @@ -386,15 +386,15 @@ <div id="example-on-page-9-upper-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-9-upper-panel" class="anchor"></a>Example on page 9, upper panel</h2> -<div class="sourceCode" id="cb31"><pre class="downlit"> -<span class="va">p9a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p9a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb31"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p9a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p9a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb34"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p9a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb34"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p9a</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p9a-1.png" width="700"></p> -<div class="sourceCode" id="cb35"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p9a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb35"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p9a</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 839.35238 88.57064 9.93363 @@ -420,7 +420,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 9.85e+01 2.54e-20 97.390 99.672 ## k1 1.38e-01 3.52e-05 0.131 0.146 -## k2 6.69e-13 5.00e-01 0.000 Inf +## k2 9.03e-13 5.00e-01 0.000 Inf ## g 6.52e-01 8.13e-06 0.642 0.661 ## sigma 7.88e-01 6.13e-02 0.481 1.095 ## @@ -429,7 +429,7 @@ ## DT50 DT90 DT50_rep ## SFO 16.9 5.63e+01 1.69e+01 ## IORE 11.6 3.37e+02 1.01e+02 -## DFOP 10.5 1.86e+12 1.04e+12 +## DFOP 10.5 1.38e+12 7.67e+11 ## ## Representative half-life: ## [1] 101.43</code></pre> @@ -438,15 +438,19 @@ <div id="example-on-page-9-lower-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-9-lower-panel" class="anchor"></a>Example on page 9, lower panel</h2> -<div class="sourceCode" id="cb37"><pre class="downlit"> -<span class="va">p9b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p9b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb37"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p9b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p9b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> +<pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> +<pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> +<pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is +## doubtful</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb40"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p9b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb43"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p9b</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p9b-1.png" width="700"></p> -<div class="sourceCode" id="cb41"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p9b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb44"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p9b</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 35.64867 23.22334 35.64867 @@ -469,12 +473,12 @@ ## sigma 1.288 1.76e-04 0.7456 1.830 ## ## $DFOP -## Estimate Pr(>t) Lower Upper -## parent_0 94.7123 1.61e-16 93.1355 96.2891 -## k1 0.0389 1.43e-06 0.0312 0.0485 -## k2 0.0389 6.67e-03 0.0186 0.0812 -## g 0.7742 5.00e-01 0.0000 1.0000 -## sigma 1.5957 2.50e-04 0.9135 2.2779 +## Estimate Pr(>t) Lower Upper +## parent_0 94.7123 NA 93.1355 96.2891 +## k1 0.0389 NA 0.0266 0.0569 +## k2 0.0389 NA 0.0255 0.0592 +## g 0.5256 NA NA NA +## sigma 1.5957 NA 0.9135 2.2779 ## ## ## DTx values: @@ -490,15 +494,16 @@ <div id="example-on-page-10" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-10" class="anchor"></a>Example on page 10</h2> -<div class="sourceCode" id="cb43"><pre class="downlit"> -<span class="va">p10</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p10"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb46"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p10</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p10"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> +<pre><code>## Warning in sqrt(diag(covar_notrans)): NaNs produced</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb46"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p10</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb50"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p10</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p10-1.png" width="700"></p> -<div class="sourceCode" id="cb47"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p10</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb51"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p10</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 899.4089 336.4348 899.4089 @@ -521,12 +526,12 @@ ## sigma 4.90 1.77e-04 2.837 6.968 ## ## $DFOP -## Estimate Pr(>t) Lower Upper -## parent_0 101.7315 1.41e-09 91.6534 111.810 -## k1 0.0495 6.48e-04 0.0303 0.081 -## k2 0.0495 1.67e-02 0.0201 0.122 -## g 0.6634 5.00e-01 0.0000 1.000 -## sigma 8.0152 2.50e-04 4.5886 11.442 +## Estimate Pr(>t) Lower Upper +## parent_0 101.7315 1.41e-09 91.6534 111.8097 +## k1 0.0495 5.63e-03 0.0240 0.1020 +## k2 0.0495 1.93e-03 0.0272 0.0903 +## g 0.4487 NaN 0.0000 1.0000 +## sigma 8.0152 2.50e-04 4.5886 11.4418 ## ## ## DTx values: @@ -546,15 +551,15 @@ <div id="example-on-page-11" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-11" class="anchor"></a>Example on page 11</h2> -<div class="sourceCode" id="cb49"><pre class="downlit"> -<span class="va">p11</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p11"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb53"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p11</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p11"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb52"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p11</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb56"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p11</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p11-1.png" width="700"></p> -<div class="sourceCode" id="cb53"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p11</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb57"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p11</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 579.6805 204.7932 144.7783 @@ -580,7 +585,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 1.05e+02 9.47e-13 99.9990 109.1224 ## k1 4.41e-02 5.95e-03 0.0296 0.0658 -## k2 7.25e-13 5.00e-01 0.0000 Inf +## k2 9.94e-13 5.00e-01 0.0000 Inf ## g 3.22e-01 1.45e-03 0.2814 0.3650 ## sigma 3.22e+00 3.52e-04 1.8410 4.5906 ## @@ -589,7 +594,7 @@ ## DT50 DT90 DT50_rep ## SFO 2.16e+02 7.18e+02 2.16e+02 ## IORE 9.73e+02 1.37e+08 4.11e+07 -## DFOP 4.21e+11 2.64e+12 9.56e+11 +## DFOP 3.07e+11 1.93e+12 6.97e+11 ## ## Representative half-life: ## [1] 41148171</code></pre> @@ -603,17 +608,20 @@ <div id="example-on-page-12-upper-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-12-upper-panel" class="anchor"></a>Example on page 12, upper panel</h2> -<div class="sourceCode" id="cb55"><pre class="downlit"> -<span class="va">p12a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p12a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb59"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p12a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p12a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in summary.mkinfit(x): Could not calculate correlation; no covariance +## matrix + +## Warning in summary.mkinfit(x): Could not calculate correlation; no covariance ## matrix</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb59"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p12a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb63"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p12a</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p12a-1.png" width="700"></p> -<div class="sourceCode" id="cb60"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p12a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb64"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p12a</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 695.4440 220.0685 695.4440 @@ -636,12 +644,12 @@ ## sigma 3.965 NA NA NA ## ## $DFOP -## Estimate Pr(>t) Lower Upper -## parent_0 100.521 2.74e-10 92.2366 108.805 -## k1 0.124 5.75e-06 0.0958 0.161 -## k2 0.124 6.72e-02 0.0319 0.484 -## g 0.877 5.00e-01 0.0000 1.000 -## sigma 7.048 2.50e-04 4.0349 10.061 +## Estimate Pr(>t) Lower Upper +## parent_0 100.521 2.74e-10 NA NA +## k1 0.124 2.53e-05 NA NA +## k2 0.124 2.52e-02 NA NA +## g 0.793 5.00e-01 NA NA +## sigma 7.048 2.50e-04 NA NA ## ## ## DTx values: @@ -656,23 +664,21 @@ <div id="example-on-page-12-lower-panel" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-12-lower-panel" class="anchor"></a>Example on page 12, lower panel</h2> -<div class="sourceCode" id="cb62"><pre class="downlit"> -<span class="va">p12b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p12b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb66"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p12b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p12b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> <pre><code>## Warning in qt(alpha/2, rdf): NaNs produced</code></pre> <pre><code>## Warning in qt(1 - alpha/2, rdf): NaNs produced</code></pre> -<pre><code>## Warning in sqrt(diag(covar_notrans)): NaNs produced</code></pre> -<pre><code>## Warning in pt(abs(tval), rdf, lower.tail = FALSE): NaNs produced</code></pre> <pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> <pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is ## doubtful</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb72"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p12b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb74"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p12b</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p12b-1.png" width="700"></p> -<div class="sourceCode" id="cb73"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p12b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb75"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p12b</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 58.90242 19.06353 58.90242 @@ -696,11 +702,11 @@ ## ## $DFOP ## Estimate Pr(>t) Lower Upper -## parent_0 97.6840 NaN NaN NaN -## k1 0.0589 NaN NA NA -## k2 0.0589 NaN NA NA -## g 0.6902 NaN NA NA -## sigma 3.4323 NaN NaN NaN +## parent_0 97.6840 NA NaN NaN +## k1 0.0589 NA NA NA +## k2 0.0589 NA NA NA +## g 0.6473 NA NA NA +## sigma 3.4323 NA NaN NaN ## ## ## DTx values: @@ -715,15 +721,19 @@ <div id="example-on-page-13" class="section level2"> <h2 class="hasAnchor"> <a href="#example-on-page-13" class="anchor"></a>Example on page 13</h2> -<div class="sourceCode" id="cb75"><pre class="downlit"> -<span class="va">p13</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p13"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb77"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p13</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p13"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> +<pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> +<pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> +<pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is +## doubtful</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb78"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p13</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb83"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p13</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p13-1.png" width="700"></p> -<div class="sourceCode" id="cb79"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p13</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb84"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p13</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 174.5971 142.3951 174.5971 @@ -746,12 +756,12 @@ ## sigma 3.0811 9.64e-05 1.84296 4.319 ## ## $DFOP -## Estimate Pr(>t) Lower Upper -## parent_0 92.73500 9.25e-15 8.95e+01 9.59e+01 -## k1 0.00258 4.28e-01 1.45e-08 4.61e+02 -## k2 0.00258 3.69e-08 2.20e-03 3.03e-03 -## g 0.00442 5.00e-01 0.00e+00 1.00e+00 -## sigma 3.41172 1.35e-04 2.02e+00 4.80e+00 +## Estimate Pr(>t) Lower Upper +## parent_0 92.73500 NA 8.95e+01 95.92118 +## k1 0.00258 NA 4.25e-04 0.01569 +## k2 0.00258 NA 1.76e-03 0.00379 +## g 0.16452 NA NA NA +## sigma 3.41172 NA 2.02e+00 4.79960 ## ## ## DTx values: @@ -767,19 +777,19 @@ <div id="dt50-not-observed-in-the-study-and-dfop-problems-in-pestdf" class="section level1"> <h1 class="hasAnchor"> <a href="#dt50-not-observed-in-the-study-and-dfop-problems-in-pestdf" class="anchor"></a>DT50 not observed in the study and DFOP problems in PestDF</h1> -<div class="sourceCode" id="cb81"><pre class="downlit"> -<span class="va">p14</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p14"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb86"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p14</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p14"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> <pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> <pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is ## doubtful</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb87"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p14</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb92"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p14</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p14-1.png" width="700"></p> -<div class="sourceCode" id="cb88"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p14</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb93"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p14</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 48.43249 28.67746 27.26248 @@ -805,7 +815,7 @@ ## Estimate Pr(>t) Lower Upper ## parent_0 1.00e+02 2.96e-28 99.40280 101.2768 ## k1 9.53e-03 1.20e-01 0.00638 0.0143 -## k2 7.70e-12 5.00e-01 0.00000 Inf +## k2 5.33e-12 5.00e-01 0.00000 Inf ## g 3.98e-01 2.19e-01 0.30481 0.4998 ## sigma 1.17e+00 7.68e-06 0.77406 1.5610 ## @@ -814,7 +824,7 @@ ## DT50 DT90 DT50_rep ## SFO 2.48e+02 8.25e+02 2.48e+02 ## IORE 4.34e+02 2.22e+04 6.70e+03 -## DFOP 2.41e+10 2.33e+11 9.00e+10 +## DFOP 3.48e+10 3.37e+11 1.30e+11 ## ## Representative half-life: ## [1] 6697.44</code></pre> @@ -823,19 +833,15 @@ <div id="n-is-less-than-1-and-dfop-fraction-parameter-is-below-zero" class="section level1"> <h1 class="hasAnchor"> <a href="#n-is-less-than-1-and-dfop-fraction-parameter-is-below-zero" class="anchor"></a>N is less than 1 and DFOP fraction parameter is below zero</h1> -<div class="sourceCode" id="cb90"><pre class="downlit"> -<span class="va">p15a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p15a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> -<pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> -<pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> -<pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is -## doubtful</code></pre> +<div class="sourceCode" id="cb95"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p15a</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p15a"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb96"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p15a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb98"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p15a</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p15a-1.png" width="700"></p> -<div class="sourceCode" id="cb97"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p15a</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb99"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p15a</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 245.5248 135.0132 245.5248 @@ -859,10 +865,10 @@ ## ## $DFOP ## Estimate Pr(>t) Lower Upper -## parent_0 97.96752 NA 94.21914 101.7159 -## k1 0.00952 NA 0.00241 0.0377 -## k2 0.00952 NA 0.00747 0.0121 -## g 0.17247 NA NA NA +## parent_0 97.96751 NA 94.21913 101.7159 +## k1 0.00952 NA 0.00221 0.0411 +## k2 0.00952 NA 0.00626 0.0145 +## g 0.21241 NA 0.00000 1.0000 ## sigma 4.18778 NA 2.39747 5.9781 ## ## @@ -874,19 +880,19 @@ ## ## Representative half-life: ## [1] 41.33</code></pre> -<div class="sourceCode" id="cb99"><pre class="downlit"> -<span class="va">p15b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p15b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb101"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p15b</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p15b"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## Warning in sqrt(diag(covar)): NaNs produced</code></pre> <pre><code>## Warning in sqrt(1/diag(V)): NaNs produced</code></pre> <pre><code>## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is ## doubtful</code></pre> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The half-life obtained from the IORE model may be used</code></pre> -<div class="sourceCode" id="cb105"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p15b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb107"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p15b</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p15b-1.png" width="700"></p> -<div class="sourceCode" id="cb106"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p15b</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb108"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p15b</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 106.91629 68.55574 106.91629 @@ -910,11 +916,11 @@ ## ## $DFOP ## Estimate Pr(>t) Lower Upper -## parent_0 1.01e+02 NA 98.24464 1.04e+02 -## k1 4.86e-03 NA 0.00068 3.47e-02 -## k2 4.86e-03 NA 0.00338 6.99e-03 -## g 1.50e-01 NA NA NA -## sigma 2.76e+00 NA 1.58208 3.94e+00 +## parent_0 1.01e+02 NA 9.82e+01 1.04e+02 +## k1 4.86e-03 NA 8.63e-04 2.73e-02 +## k2 4.86e-03 NA 3.21e-03 7.35e-03 +## g 1.88e-01 NA NA NA +## sigma 2.76e+00 NA 1.58e+00 3.94e+00 ## ## ## DTx values: @@ -930,17 +936,17 @@ <div id="the-dfop-fraction-parameter-is-greater-than-1" class="section level1"> <h1 class="hasAnchor"> <a href="#the-dfop-fraction-parameter-is-greater-than-1" class="anchor"></a>The DFOP fraction parameter is greater than 1</h1> -<div class="sourceCode" id="cb108"><pre class="downlit"> -<span class="va">p16</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p16"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb110"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">p16</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/nafta.html">nafta</a></span><span class="op">(</span><span class="va">NAFTA_SOP_Attachment</span><span class="op">[[</span><span class="st">"p16"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></code></pre></div> <pre><code>## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</code></pre> <pre><code>## The representative half-life of the IORE model is longer than the one corresponding</code></pre> <pre><code>## to the terminal degradation rate found with the DFOP model.</code></pre> <pre><code>## The representative half-life obtained from the DFOP model may be used</code></pre> -<div class="sourceCode" id="cb113"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p16</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb115"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">p16</span><span class="op">)</span></code></pre></div> <p><img src="NAFTA_examples_files/figure-html/p16-1.png" width="700"></p> -<div class="sourceCode" id="cb114"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p16</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb116"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">p16</span><span class="op">)</span></code></pre></div> <pre><code>## Sums of squares: ## SFO IORE DFOP ## 3831.804 2062.008 1550.980 @@ -965,7 +971,7 @@ ## $DFOP ## Estimate Pr(>t) Lower Upper ## parent_0 88.5333 7.40e-18 79.9836 97.083 -## k1 18.5560 5.00e-01 0.0000 Inf +## k1 18.8461 5.00e-01 0.0000 Inf ## k2 0.0776 1.41e-05 0.0518 0.116 ## g 0.4733 1.41e-09 0.3674 0.582 ## sigma 7.1902 2.11e-08 5.2785 9.102 diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png Binary files differindex 3e9c743f..bfe9b278 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png Binary files differindex 77463495..bc8eb665 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png Binary files differindex ccf8f77a..54ff98b8 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png Binary files differindex 6b0dcaf2..99fb589d 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png Binary files differindex 029e6a17..f3332d5d 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png Binary files differindex f2f59ff7..7e24c2ff 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png Binary files differindex 24cb27d8..52b849d7 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png Binary files differindex 3640ea68..42f39959 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png Binary files differindex f3fa460e..e5358265 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png Binary files differindex 8d38b89c..7b23f706 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png Binary files differindex 3f2da285..d99f0d2d 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png Binary files differindex 37274769..ca68c20b 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png Binary files differindex d6ae1fa4..74cb76af 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png Binary files differindex ebcc326c..87dc1fab 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png Binary files differindex a6f4e763..0d111357 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png Binary files differindex 2a8cf947..73b85767 100644 --- a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png +++ b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png diff --git a/docs/articles/web_only/benchmarks.html b/docs/articles/web_only/benchmarks.html index 28a3b68a..e15358a0 100644 --- a/docs/articles/web_only/benchmarks.html +++ b/docs/articles/web_only/benchmarks.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Benchmark timings for mkin</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/web_only/benchmarks.rmd"><code>vignettes/web_only/benchmarks.rmd</code></a></small> <div class="hidden name"><code>benchmarks.rmd</code></div> @@ -114,48 +114,46 @@ <h2 class="hasAnchor"> <a href="#test-cases" class="anchor"></a>Test cases</h2> <p>Parent only:</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="va">FOCUS_C</span> <span class="op"><-</span> <span class="va">FOCUS_2006_C</span> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">FOCUS_C</span> <span class="op"><-</span> <span class="va">FOCUS_2006_C</span> <span class="va">FOCUS_D</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/subset.html">subset</a></span><span class="op">(</span><span class="va">FOCUS_2006_D</span>, <span class="va">value</span> <span class="op">!=</span> <span class="fl">0</span><span class="op">)</span> <span class="va">parent_datasets</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_C</span>, <span class="va">FOCUS_D</span><span class="op">)</span> <span class="va">t1</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span>, <span class="st">"HS"</span><span class="op">)</span>, <span class="va">parent_datasets</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> <span class="va">t2</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span>, <span class="st">"HS"</span><span class="op">)</span>, <span class="va">parent_datasets</span>, - error_model <span class="op">=</span> <span class="st">"tc"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></pre></div> + error_model <span class="op">=</span> <span class="st">"tc"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></code></pre></div> <p>One metabolite:</p> -<div class="sourceCode" id="cb2"><pre class="downlit"> -<span class="va">SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> - parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, - m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> +<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> + parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, + m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> <span class="va">FOMC_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> - parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, - m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> + parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, + m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> <span class="va">DFOP_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> - parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, - m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> -<span class="va">t3</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOMC_SFO</span>, <span class="va">DFOP_SFO</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_D</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></pre></div> -<pre><code>## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): -## Shapiro-Wilk test for standardized residuals: p = 0.0165</code></pre> -<pre><code>## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): -## Shapiro-Wilk test for standardized residuals: p = 0.0499 - -## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): -## Shapiro-Wilk test for standardized residuals: p = 0.0499</code></pre> -<div class="sourceCode" id="cb5"><pre class="downlit"> + parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, + m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> +<span class="va">t3</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOMC_SFO</span>, <span class="va">DFOP_SFO</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_D</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> <span class="va">t4</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOMC_SFO</span>, <span class="va">DFOP_SFO</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_D</span><span class="op">)</span>, - error_model <span class="op">=</span> <span class="st">"tc"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> -<span class="va">t5</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOMC_SFO</span>, <span class="va">DFOP_SFO</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_D</span><span class="op">)</span>, - error_model <span class="op">=</span> <span class="st">"obs"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></pre></div> + error_model <span class="op">=</span> <span class="st">"tc"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></code></pre></div> +<pre><code>## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): Optimisation did not converge: +## iteration limit reached without convergence (10) + +## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): Optimisation did not converge: +## iteration limit reached without convergence (10)</code></pre> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">t5</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOMC_SFO</span>, <span class="va">DFOP_SFO</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">FOCUS_D</span><span class="op">)</span>, + error_model <span class="op">=</span> <span class="st">"obs"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></code></pre></div> <p>Two metabolites, synthetic data:</p> -<div class="sourceCode" id="cb6"><pre class="downlit"> -<span class="va">m_synth_SFO_lin</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>, - M1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>, - M2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, +<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">m_synth_SFO_lin</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>, + M1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>, + M2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="va">m_synth_DFOP_par</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"M1"</span>, <span class="st">"M2"</span><span class="op">)</span><span class="op">)</span>, - M1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, - M2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, +<span class="va">m_synth_DFOP_par</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"M1"</span>, <span class="st">"M2"</span><span class="op">)</span><span class="op">)</span>, + M1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, + M2 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="va">SFO_lin_a</span> <span class="op"><-</span> <span class="va">synthetic_data_for_UBA_2014</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">$</span><span class="va">data</span> @@ -163,10 +161,8 @@ <span class="va">DFOP_par_c</span> <span class="op"><-</span> <span class="va">synthetic_data_for_UBA_2014</span><span class="op">[[</span><span class="fl">12</span><span class="op">]</span><span class="op">]</span><span class="op">$</span><span class="va">data</span> <span class="va">t6</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_SFO_lin</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_lin_a</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> -<span class="va">t7</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DFOP_par_c</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></pre></div> -<pre><code>## Warning in mkinfit(models[[model_index]], datasets[[dataset_index]], ...): -## Shapiro-Wilk test for standardized residuals: p = 0.000174</code></pre> -<div class="sourceCode" id="cb8"><pre class="downlit"> +<span class="va">t7</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DFOP_par_c</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> + <span class="va">t8</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_SFO_lin</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_lin_a</span><span class="op">)</span>, error_model <span class="op">=</span> <span class="st">"tc"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> <span class="va">t9</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DFOP_par_c</span><span class="op">)</span>, @@ -175,11 +171,11 @@ <span class="va">t10</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_SFO_lin</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">SFO_lin_a</span><span class="op">)</span>, error_model <span class="op">=</span> <span class="st">"obs"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span> <span class="va">t11</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="fu">mmkin_bench</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DFOP_par_c</span><span class="op">)</span>, - error_model <span class="op">=</span> <span class="st">"obs"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></pre></div> -<div class="sourceCode" id="cb9"><pre class="downlit"> -<span class="va">mkin_benchmarks</span><span class="op">[</span><span class="va">system_string</span>, <span class="fu"><a href="https://rdrr.io/r/base/paste.html">paste0</a></span><span class="op">(</span><span class="st">"t"</span>, <span class="fl">1</span><span class="op">:</span><span class="fl">11</span><span class="op">)</span><span class="op">]</span> <span class="op"><-</span> + error_model <span class="op">=</span> <span class="st">"obs"</span><span class="op">)</span><span class="op">)</span><span class="op">[[</span><span class="st">"elapsed"</span><span class="op">]</span><span class="op">]</span></code></pre></div> +<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">mkin_benchmarks</span><span class="op">[</span><span class="va">system_string</span>, <span class="fu"><a href="https://rdrr.io/r/base/paste.html">paste0</a></span><span class="op">(</span><span class="st">"t"</span>, <span class="fl">1</span><span class="op">:</span><span class="fl">11</span><span class="op">)</span><span class="op">]</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">t1</span>, <span class="va">t2</span>, <span class="va">t3</span>, <span class="va">t4</span>, <span class="va">t5</span>, <span class="va">t6</span>, <span class="va">t7</span>, <span class="va">t8</span>, <span class="va">t9</span>, <span class="va">t10</span>, <span class="va">t11</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/save.html">save</a></span><span class="op">(</span><span class="va">mkin_benchmarks</span>, file <span class="op">=</span> <span class="st">"~/git/mkin/vignettes/web_only/mkin_benchmarks.rda"</span><span class="op">)</span></pre></div> +<span class="fu"><a href="https://rdrr.io/r/base/save.html">save</a></span><span class="op">(</span><span class="va">mkin_benchmarks</span>, file <span class="op">=</span> <span class="st">"~/git/mkin/vignettes/web_only/mkin_benchmarks.rda"</span><span class="op">)</span></code></pre></div> </div> <div id="results" class="section level2"> <h2 class="hasAnchor"> @@ -232,6 +228,16 @@ <td align="right">1.752</td> <td align="right">4.156</td> </tr> +<tr class="even"> +<td align="left">0.9.50.4</td> +<td align="right">1.786</td> +<td align="right">3.729</td> +</tr> +<tr class="odd"> +<td align="left">1.0.0</td> +<td align="right">1.770</td> +<td align="right">3.703</td> +</tr> </tbody> </table> </div> @@ -289,6 +295,18 @@ <td align="right">6.615</td> <td align="right">2.878</td> </tr> +<tr class="even"> +<td align="left">0.9.50.4</td> +<td align="right">1.397</td> +<td align="right">7.251</td> +<td align="right">2.810</td> +</tr> +<tr class="odd"> +<td align="left">1.0.0</td> +<td align="right">1.373</td> +<td align="right">7.127</td> +<td align="right">2.762</td> +</tr> </tbody> </table> </div> @@ -370,6 +388,24 @@ <td align="right">2.113</td> <td align="right">3.073</td> </tr> +<tr class="even"> +<td align="left">0.9.50.4</td> +<td align="right">0.783</td> +<td align="right">1.282</td> +<td align="right">1.486</td> +<td align="right">3.815</td> +<td align="right">1.958</td> +<td align="right">3.105</td> +</tr> +<tr class="odd"> +<td align="left">1.0.0</td> +<td align="right">0.775</td> +<td align="right">1.269</td> +<td align="right">1.467</td> +<td align="right">3.767</td> +<td align="right">1.919</td> +<td align="right">2.942</td> +</tr> </tbody> </table> </div> diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html index c2964762..e45655b6 100644 --- a/docs/articles/web_only/compiled_models.html +++ b/docs/articles/web_only/compiled_models.html @@ -31,7 +31,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -80,7 +80,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -100,7 +100,7 @@ <h1 data-toc-skip>Performance benefit by using compiled model definitions in mkin</h1> <h4 class="author">Johannes Ranke</h4> - <h4 class="date">2020-10-15</h4> + <h4 class="date">2021-02-03</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/web_only/compiled_models.rmd"><code>vignettes/web_only/compiled_models.rmd</code></a></small> <div class="hidden name"><code>compiled_models.rmd</code></div> @@ -113,33 +113,33 @@ <h2 class="hasAnchor"> <a href="#how-to-benefit-from-compiled-models" class="anchor"></a>How to benefit from compiled models</h2> <p>When using an mkin version equal to or greater than 0.9-36 and a C compiler is available, you will see a message that the model is being compiled from autogenerated C code when defining a model using mkinmod. Starting from version 0.9.49.9, the <code><a href="../../reference/mkinmod.html">mkinmod()</a></code> function checks for presence of a compiler using</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="fu">pkgbuild</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/pkgbuild/man/has_compiler.html">has_compiler</a></span><span class="op">(</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu">pkgbuild</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/pkgbuild/man/has_compiler.html">has_compiler</a></span><span class="op">(</span><span class="op">)</span></code></pre></div> <p>In previous versions, it used <code><a href="https://rdrr.io/r/base/Sys.which.html">Sys.which("gcc")</a></code> for this check.</p> <p>On Linux, you need to have the essential build tools like make and gcc or clang installed. On Debian based linux distributions, these will be pulled in by installing the build-essential package.</p> <p>On MacOS, which I do not use personally, I have had reports that a compiler is available by default.</p> <p>On Windows, you need to install Rtools and have the path to its bin directory in your PATH variable. You do not need to modify the PATH variable when installing Rtools. Instead, I would recommend to put the line</p> -<div class="sourceCode" id="cb2"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html">Sys.setenv</a></span><span class="op">(</span>PATH <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/paste.html">paste</a></span><span class="op">(</span><span class="st">"C:/Rtools/bin"</span>, <span class="fu"><a href="https://rdrr.io/r/base/Sys.getenv.html">Sys.getenv</a></span><span class="op">(</span><span class="st">"PATH"</span><span class="op">)</span>, sep<span class="op">=</span><span class="st">";"</span><span class="op">)</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html">Sys.setenv</a></span><span class="op">(</span>PATH <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/paste.html">paste</a></span><span class="op">(</span><span class="st">"C:/Rtools/bin"</span>, <span class="fu"><a href="https://rdrr.io/r/base/Sys.getenv.html">Sys.getenv</a></span><span class="op">(</span><span class="st">"PATH"</span><span class="op">)</span>, sep<span class="op">=</span><span class="st">";"</span><span class="op">)</span><span class="op">)</span></code></pre></div> <p>into your .Rprofile startup file. This is just a text file with some R code that is executed when your R session starts. It has to be named .Rprofile and has to be located in your home directory, which will generally be your Documents folder. You can check the location of the home directory used by R by issuing</p> -<div class="sourceCode" id="cb3"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/base/Sys.getenv.html">Sys.getenv</a></span><span class="op">(</span><span class="st">"HOME"</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/Sys.getenv.html">Sys.getenv</a></span><span class="op">(</span><span class="st">"HOME"</span><span class="op">)</span></code></pre></div> </div> <div id="comparison-with-other-solution-methods" class="section level2"> <h2 class="hasAnchor"> <a href="#comparison-with-other-solution-methods" class="anchor"></a>Comparison with other solution methods</h2> <p>First, we build a simple degradation model for a parent compound with one metabolite, and we remove zero values from the dataset.</p> -<div class="sourceCode" id="cb4"><pre class="downlit"> -<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> +<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="va">SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> - parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, - m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> -<div class="sourceCode" id="cb6"><pre class="downlit"> -<span class="va">FOCUS_D</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/subset.html">subset</a></span><span class="op">(</span><span class="va">FOCUS_2006_D</span>, <span class="va">value</span> <span class="op">!=</span> <span class="fl">0</span><span class="op">)</span></pre></div> + parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>, + m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> +<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">FOCUS_D</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/subset.html">subset</a></span><span class="op">(</span><span class="va">FOCUS_2006_D</span>, <span class="va">value</span> <span class="op">!=</span> <span class="fl">0</span><span class="op">)</span></code></pre></div> <p>We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the benchmark package. In the output of below code, the warnings about zero being removed from the FOCUS D dataset are suppressed. Since mkin version 0.9.49.11, an analytical solution is also implemented, which is included in the tests below.</p> -<div class="sourceCode" id="cb7"><pre class="downlit"> -<span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="va"><a href="http://rbenchmark.googlecode.com">rbenchmark</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="va"><a href="http://rbenchmark.googlecode.com">rbenchmark</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span> <span class="va">b.1</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/rbenchmark/man/benchmark.html">benchmark</a></span><span class="op">(</span> <span class="st">"deSolve, not compiled"</span> <span class="op">=</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOCUS_D</span>, solution_type <span class="op">=</span> <span class="st">"deSolve"</span>, @@ -156,23 +156,23 @@ <span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">b.1</span><span class="op">)</span> <span class="op">}</span> <span class="kw">else</span> <span class="op">{</span> <span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="st">"R package rbenchmark is not available"</span><span class="op">)</span> -<span class="op">}</span></pre></div> +<span class="op">}</span></code></pre></div> <pre><code>## test replications relative elapsed -## 4 analytical 1 1.000 0.200 -## 3 deSolve, compiled 1 1.745 0.349 -## 2 Eigenvalue based 1 2.040 0.408 -## 1 deSolve, not compiled 1 42.235 8.447</code></pre> +## 4 analytical 1 1.000 0.181 +## 3 deSolve, compiled 1 1.818 0.329 +## 2 Eigenvalue based 1 2.061 0.373 +## 1 deSolve, not compiled 1 43.923 7.950</code></pre> <p>We see that using the compiled model is by more than a factor of 10 faster than using deSolve without compiled code.</p> </div> <div id="model-without-analytical-solution" class="section level2"> <h2 class="hasAnchor"> <a href="#model-without-analytical-solution" class="anchor"></a>Model without analytical solution</h2> <p>This evaluation is also taken from the example section of mkinfit. No analytical solution is available for this system, and now Eigenvalue based solution is possible, so only deSolve using with or without compiled code is available.</p> -<div class="sourceCode" id="cb9"><pre class="downlit"> -<span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="va"><a href="http://rbenchmark.googlecode.com">rbenchmark</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span> +<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="va"><a href="http://rbenchmark.googlecode.com">rbenchmark</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span> <span class="va">FOMC_SFO</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span> - parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, - m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span> <span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> + parent <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="st">"m1"</span><span class="op">)</span>, + m1 <span class="op">=</span> <span class="fu"><a href="../../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span> <span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span> <span class="va">b.2</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/rbenchmark/man/benchmark.html">benchmark</a></span><span class="op">(</span> <span class="st">"deSolve, not compiled"</span> <span class="op">=</span> <span class="fu"><a href="../../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">FOMC_SFO</span>, <span class="va">FOCUS_D</span>, @@ -185,13 +185,13 @@ <span class="op">}</span> <span class="kw">else</span> <span class="op">{</span> <span class="va">factor_FOMC_SFO</span> <span class="op"><-</span> <span class="cn">NA</span> <span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="st">"R package benchmark is not available"</span><span class="op">)</span> -<span class="op">}</span></pre></div> -<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> +<span class="op">}</span></code></pre></div> +<pre><code>## Temporary DLL for differentials generated and loaded</code></pre> <pre><code>## test replications relative elapsed -## 2 deSolve, compiled 1 1.000 0.483 -## 1 deSolve, not compiled 1 30.451 14.708</code></pre> +## 2 deSolve, compiled 1 1.000 0.474 +## 1 deSolve, not compiled 1 30.179 14.305</code></pre> <p>Here we get a performance benefit of a factor of 30 using the version of the differential equation model compiled from C code!</p> -<p>This vignette was built with mkin 0.9.50.3 on</p> +<p>This vignette was built with mkin 1.0.0 on</p> <pre><code>## R version 4.0.3 (2020-10-10) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Debian GNU/Linux 10 (buster)</code></pre> diff --git a/docs/authors.html b/docs/authors.html index 90293671..f5c6160c 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -120,7 +120,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -147,15 +147,15 @@ </li> <li> <p><strong>Katrin Lindenberger</strong>. Contributor. - </p> + <br /><small>contributed to mkinresplot()</small></p> </li> <li> <p><strong>René Lehmann</strong>. Contributor. - </p> + <br /><small>ilr() and invilr()</small></p> </li> <li> <p><strong>Eurofins Regulatory AG</strong>. Copyright holder. - </p> + <br /><small>copyright for some of the contributions of JR 2012-2014</small></p> </li> </ul> diff --git a/docs/index.html b/docs/index.html index 42084fc0..c7b2e277 100644 --- a/docs/index.html +++ b/docs/index.html @@ -37,7 +37,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -86,7 +86,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -111,8 +111,8 @@ <h2 class="hasAnchor"> <a href="#installation" class="anchor"></a>Installation</h2> <p>You can install the latest released version from <a href="https://cran.r-project.org/package=mkin">CRAN</a> from within R:</p> -<div class="sourceCode" id="cb1"><pre class="downlit"> -<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"mkin"</span><span class="op">)</span></pre></div> +<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"mkin"</span><span class="op">)</span></code></pre></div> </div> <div id="background" class="section level2"> <h2 class="hasAnchor"> diff --git a/docs/news/index.html b/docs/news/index.html index 6b6fd2c4..88c7c49c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -71,7 +71,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -120,7 +120,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -141,9 +141,38 @@ <small>Source: <a href='https://github.com/jranke/mkin/blob/master/NEWS.md'><code>NEWS.md</code></a></small> </div> - <div id="mkin-0-9-50-3" class="section level1"> + <div id="mkin-1-0-0" class="section level1"> +<h1 class="page-header" data-toc-text="1.0.0"> +<a href="#mkin-1-0-0" class="anchor"></a>mkin 1.0.0<small> Unreleased </small> +</h1> +<div id="general" class="section level2"> +<h2 class="hasAnchor"> +<a href="#general" class="anchor"></a>General</h2> +<ul> +<li><p>‘mkinmod’ models gain arguments ‘name’ and ‘dll_dir’ which, in conjunction with a current version of the ‘inline’ package, make it possible to still use the DLL used for fast ODE solutions with ‘deSolve’ after saving and restoring the ‘mkinmod’ object.</p></li> +<li><p>‘mkindsg’ R6 class for groups of ‘mkinds’ datasets with metadata</p></li> +<li><p>‘f_norm_temp_focus’ generic function to normalise time intervals using the FOCUS method, with methods for numeric vectors and ‘mkindsg’ objects</p></li> +<li><p>‘D24_2014’ and ‘dimethenamid_2018’ datasets</p></li> +<li><p>‘focus_soil_moisture’ FOCUS default soil moisture data</p></li> +<li><p>‘update’ method for ‘mmkin’ objects</p></li> +<li><p>‘transform_odeparms’, ‘backtransform_odeparms’: Use logit transformation for solitary fractions like the g parameter of the DFOP model, or formation fractions for a pathway to only one target variable</p></li> +<li><p>‘plot.mmkin’: Add a ylab argument, making it possible to customize the y axis label of the panels on the left without affecting the residual plots. Reduce legend size and vertical distance between panels</p></li> +<li><p>‘plot.mkinfit’: Change default ylab from “Observed” to “Residue”. Pass xlab to residual plot if show_residuals is TRUE.</p></li> +</ul> +</div> +<div id="mixed-effects-models" class="section level2"> +<h2 class="hasAnchor"> +<a href="#mixed-effects-models" class="anchor"></a>Mixed-effects models</h2> +<ul> +<li><p>‘mixed.mmkin’ New container for mmkin objects for plotting with the ‘plot.mixed.mmkin’ method</p></li> +<li><p>‘plot.mixed.mmkin’ method used for ‘nlme.mmkin’ inheriting from ‘mixed.mmkin’ (currently virtual)</p></li> +<li><p>‘plot’, ‘summary’ and ‘print’ methods for ‘nlme.mmkin’ objects</p></li> +</ul> +</div> +</div> + <div id="mkin-0-9-50-3-2020-10-08" class="section level1"> <h1 class="page-header" data-toc-text="0.9.50.3"> -<a href="#mkin-0-9-50-3" class="anchor"></a>mkin 0.9.50.3<small> 2020-10-08 </small> +<a href="#mkin-0-9-50-3-2020-10-08" class="anchor"></a>mkin 0.9.50.3 (2020-10-08)<small> 2020-10-08 </small> </h1> <ul> <li><p>‘parms’: Add a method for mmkin objects</p></li> @@ -465,7 +494,7 @@ <ul> <li><p>Add plots to <code>compiled_models</code> vignette</p></li> <li><p>Give an explanatory error message when mkinmod fails due to a missing definition of a target variable</p></li> -<li><p><code><a href="../reference/print.mkinmod.html">print.mkinmod()</a></code>: Improve formatting when printing mkinmod model definitions</p></li> +<li><p><code><a href="../reference/mkinmod.html">print.mkinmod()</a></code>: Improve formatting when printing mkinmod model definitions</p></li> </ul> </div> </div> @@ -617,7 +646,7 @@ <h2 class="hasAnchor"> <a href="#new-features-2" class="anchor"></a>New features</h2> <ul> -<li><p>Add the convenience function <code><a href="../reference/mkinsub.html">mkinsub()</a></code> for creating the lists used in <code><a href="../reference/mkinmod.html">mkinmod()</a></code></p></li> +<li><p>Add the convenience function <code><a href="../reference/mkinmod.html">mkinsub()</a></code> for creating the lists used in <code><a href="../reference/mkinmod.html">mkinmod()</a></code></p></li> <li><p>Add the possibility to fit indeterminate order rate equation (IORE) models using an analytical solution (parent only) or a numeric solution. Paths from IORE compounds to metabolites are supported when using formation fractions (use_of_ff = ‘max’). Note that the numerical solution (method.ode = ‘deSolve’) of the IORE differential equations sometimes fails due to numerical problems.</p></li> <li><p>Switch to using the Port algorithm (using a model/trust region approach) per default. While needing more iterations than the Levenberg-Marquardt algorithm previously used per default, it is less sensitive to starting parameters.</p></li> </ul> diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f9babf0b..6c5f8bc3 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: web_only/NAFTA_examples: NAFTA_examples.html web_only/benchmarks: benchmarks.html web_only/compiled_models: compiled_models.html -last_built: 2020-10-15T10:39Z +last_built: 2021-02-03T16:42Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index 26a880e3..f54fd70f 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -73,7 +73,7 @@ same dataset." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ same dataset." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/CAKE_export.html b/docs/reference/CAKE_export.html index 4e456651..dcccca1b 100644 --- a/docs/reference/CAKE_export.html +++ b/docs/reference/CAKE_export.html @@ -73,7 +73,7 @@ specified as well." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -110,6 +110,9 @@ specified as well." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -118,8 +121,8 @@ specified as well." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -137,7 +140,7 @@ specified as well." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Export a list of datasets format to a CAKE study file</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/CAKE_export.R'><code>R/CAKE_export.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/CAKE_export.R'><code>R/CAKE_export.R</code></a></small> <div class="hidden name"><code>CAKE_export.Rd</code></div> </div> @@ -146,21 +149,21 @@ specified as well." /> specified as well.</p> </div> - <pre class="usage"><span class='fu'>CAKE_export</span>( - <span class='no'>ds</span>, - <span class='kw'>map</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='st'>"Parent"</span>), - <span class='kw'>links</span> <span class='kw'>=</span> <span class='fl'>NA</span>, - <span class='kw'>filename</span> <span class='kw'>=</span> <span class='st'>"CAKE_export.csf"</span>, - <span class='kw'>path</span> <span class='kw'>=</span> <span class='st'>"."</span>, - <span class='kw'>overwrite</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, - <span class='kw'>study</span> <span class='kw'>=</span> <span class='st'>"Codlemone aerobic soil degradation"</span>, - <span class='kw'>description</span> <span class='kw'>=</span> <span class='st'>""</span>, - <span class='kw'>time_unit</span> <span class='kw'>=</span> <span class='st'>"days"</span>, - <span class='kw'>res_unit</span> <span class='kw'>=</span> <span class='st'>"% AR"</span>, - <span class='kw'>comment</span> <span class='kw'>=</span> <span class='st'>"Created using mkin::CAKE_export"</span>, - <span class='kw'>date</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Sys.time.html'>Sys.Date</a></span>(), - <span class='kw'>optimiser</span> <span class='kw'>=</span> <span class='st'>"IRLS"</span> -)</pre> + <pre class="usage"><span class='fu'>CAKE_export</span><span class='op'>(</span> + <span class='va'>ds</span>, + map <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='st'>"Parent"</span><span class='op'>)</span>, + links <span class='op'>=</span> <span class='cn'>NA</span>, + filename <span class='op'>=</span> <span class='st'>"CAKE_export.csf"</span>, + path <span class='op'>=</span> <span class='st'>"."</span>, + overwrite <span class='op'>=</span> <span class='cn'>FALSE</span>, + study <span class='op'>=</span> <span class='st'>"Codlemone aerobic soil degradation"</span>, + description <span class='op'>=</span> <span class='st'>""</span>, + time_unit <span class='op'>=</span> <span class='st'>"days"</span>, + res_unit <span class='op'>=</span> <span class='st'>"% AR"</span>, + comment <span class='op'>=</span> <span class='st'>"Created using mkin::CAKE_export"</span>, + date <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Sys.time.html'>Sys.Date</a></span><span class='op'>(</span><span class='op'>)</span>, + optimiser <span class='op'>=</span> <span class='st'>"IRLS"</span> +<span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -227,6 +230,9 @@ compatible with CAKE.</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <p>The function is called for its side effect.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -243,7 +249,7 @@ compatible with CAKE.</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/D24_2014.html b/docs/reference/D24_2014.html new file mode 100644 index 00000000..b78e73ef --- /dev/null +++ b/docs/reference/D24_2014.html @@ -0,0 +1,291 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Aerobic soil degradation data on 2,4-D from the EU assessment in 2014 — D24_2014 • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Aerobic soil degradation data on 2,4-D from the EU assessment in 2014 — D24_2014" /> +<meta property="og:description" content="The five datasets were extracted from the active substance evaluation dossier +published by EFSA. Kinetic evaluations shown for these datasets are intended +to illustrate and advance kinetic modelling. The fact that these data and +some results are shown here does not imply a license to use them in the +context of pesticide registrations, as the use of the data may be +constrained by data protection regulations." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Aerobic soil degradation data on 2,4-D from the EU assessment in 2014</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/D24_2014.R'><code>R/D24_2014.R</code></a></small> + <div class="hidden name"><code>D24_2014.Rd</code></div> + </div> + + <div class="ref-description"> + <p>The five datasets were extracted from the active substance evaluation dossier +published by EFSA. Kinetic evaluations shown for these datasets are intended +to illustrate and advance kinetic modelling. The fact that these data and +some results are shown here does not imply a license to use them in the +context of pesticide registrations, as the use of the data may be +constrained by data protection regulations.</p> + </div> + + <pre class="usage"><span class='va'>D24_2014</span></pre> + + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>An <a href='mkindsg.html'>mkindsg</a> object grouping five datasets</p> + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> + + <p>Hellenic Ministry of Rural Development and Agriculture (2014) +Final addendum to the Renewal Assessment Report - public version - 2,4-D +Volume 3 Annex B.8 Fate and behaviour in the environment +<a href='http://registerofquestions.efsa.europa.eu/roqFrontend/outputLoader?output=ON-3812'>http://registerofquestions.efsa.europa.eu/roqFrontend/outputLoader?output=ON-3812</a></p> + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>Data for the first dataset are from p. 685. Data for the other four +datasets were used in the preprocessed versions given in the kinetics +section (p. 761ff.), with the exception of residues smaller than 1 for DCP +in the soil from Site I2, where the values given on p. 694 were used.</p> +<p>The R code used to create this data object is installed with this package +in the 'dataset_generation' directory. In the code, page numbers are given for +specific pieces of information in the comments.</p> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>D24_2014</span><span class='op'>)</span> +</div><div class='output co'>#> <mkindsg> holding 5 mkinds objects +#> Title $title: Aerobic soil degradation data on 2,4-D from the EU assessment in 2014 +#> Occurrence of observed compounds $observed_n: +#> D24 DCP DCA +#> 5 4 4 +#> Time normalisation factors $f_time_norm: +#> [1] 1.6062378 0.7118732 0.7156063 0.7156063 0.8977124 +#> Meta information $meta: +#> study usda_soil_type study_moisture_ref_type +#> Mississippi Cohen 1991 Silt loam <NA> +#> Fayette Liu and Adelfinskaya 2011 Silt loam pF1 +#> RefSol 03-G Liu and Adelfinskaya 2011 Loam pF1 +#> Site E1 Liu and Adelfinskaya 2011 Loam pF1 +#> Site I2 Liu and Adelfinskaya 2011 Loamy sand pF1 +#> rel_moisture temperature +#> Mississippi NA 25 +#> Fayette 0.5 20 +#> RefSol 03-G 0.5 20 +#> Site E1 0.5 20 +#> Site I2 0.5 20</div><div class='input'><span class='co'># \dontrun{</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>D24_2014</span><span class='op'>$</span><span class='va'>ds</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span>, data <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <mkinds> with $title: Mississippi +#> Observed compounds $observed: D24 +#> Sampling times $sampling_times: +#> 0, 2, 4, 7, 15, 24, 35, 56, 71, 114, 183, 273, 365 +#> With a maximum of 1 replicates +#> time D24 +#> 1 0 96.8 +#> 2 2 81.0 +#> 3 4 81.7 +#> 4 7 88.2 +#> 5 15 66.3 +#> 6 24 72.9 +#> 7 35 62.6 +#> 8 56 54.6 +#> 9 71 35.2 +#> 10 114 18.0 +#> 11 183 11.3 +#> 12 273 9.9 +#> 13 365 6.3</div><div class='input'><span class='va'>m_D24</span> <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>D24 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"DCP"</span><span class='op'>)</span>, + DCP <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"DCA"</span><span class='op'>)</span>, + DCA <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>m_D24</span><span class='op'>)</span> +</div><div class='output co'>#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: max +#> Specification $spec: +#> $D24 +#> $type: SFO; $to: DCP; $sink: TRUE +#> $DCP +#> $type: SFO; $to: DCA; $sink: TRUE +#> $DCA +#> $type: SFO; $sink: TRUE +#> Coefficient matrix $coefmat available +#> Compiled model $cf available +#> Differential equations: +#> d_D24/dt = - k_D24 * D24 +#> d_DCP/dt = + f_D24_to_DCP * k_D24 * D24 - k_DCP * DCP +#> d_DCA/dt = + f_DCP_to_DCA * k_DCP * DCP - k_DCA * DCA</div><div class='input'><span class='va'>m_D24_2</span> <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>D24 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='st'>"DCP"</span><span class='op'>)</span>, + DCP <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"DCA"</span><span class='op'>)</span>, + DCA <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>m_D24_2</span><span class='op'>)</span> +</div><div class='output co'>#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: max +#> Specification $spec: +#> $D24 +#> $type: DFOP; $to: DCP; $sink: TRUE +#> $DCP +#> $type: SFO; $to: DCA; $sink: TRUE +#> $DCA +#> $type: SFO; $sink: TRUE +#> Compiled model $cf available +#> Differential equations: +#> d_D24/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * +#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) +#> * D24 +#> d_DCP/dt = + f_D24_to_DCP * ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * +#> exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 +#> * time))) * D24 - k_DCP * DCP +#> d_DCA/dt = + f_DCP_to_DCA * k_DCP * DCP - k_DCA * DCA</div><div class='input'><span class='co'># }</span> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/DFOP.solution.html b/docs/reference/DFOP.solution.html index 2bc1ee96..cff29301 100644 --- a/docs/reference/DFOP.solution.html +++ b/docs/reference/DFOP.solution.html @@ -73,7 +73,7 @@ two exponential decline functions." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ two exponential decline functions." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index a0916dba..4e3cbe64 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -40,7 +40,7 @@ <meta property="og:title" content="Subsetting method for mmkin objects — [.mmkin" /> -<meta property="og:description" content="Subsetting method for mmkin objects." /> +<meta property="og:description" content="Subsetting method for mmkin objects" /> @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -136,12 +139,12 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Subsetting method for mmkin objects</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/mmkin.R'><code>R/mmkin.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mmkin.R'><code>R/mmkin.R</code></a></small> <div class="hidden name"><code>Extract.mmkin.Rd</code></div> </div> <div class="ref-description"> - <p>Subsetting method for mmkin objects.</p> + <p>Subsetting method for mmkin objects</p> </div> <pre class="usage"># S3 method for mmkin @@ -176,30 +179,46 @@ either a list of mkinfit objects or a single mkinfit object.</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <p>An object of class <code><a href='mmkin.html'>mmkin</a></code>.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># Only use one core, to pass R CMD check --as-cran</span> - <span class='no'>fits</span> <span class='kw'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>), <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>B</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_B</span>, <span class='kw'>C</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_C</span>), - <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) - <span class='no'>fits</span>[<span class='st'>"FOMC"</span>, ]</div><div class='output co'>#> dataset -#> model B C -#> FOMC List,39 List,39 -#> attr(,"class") -#> [1] "mmkin"</div><div class='input'> <span class='no'>fits</span>[, <span class='st'>"B"</span>]</div><div class='output co'>#> dataset -#> model B -#> SFO List,39 -#> FOMC List,39 -#> attr(,"class") -#> [1] "mmkin"</div><div class='input'> <span class='no'>fits</span>[<span class='st'>"SFO"</span>, <span class='st'>"B"</span>]</div><div class='output co'>#> dataset -#> model B -#> SFO List,39 -#> attr(,"class") -#> [1] "mmkin"</div><div class='input'> - <span class='fu'><a href='https://rdrr.io/r/utils/head.html'>head</a></span>( + <span class='va'>fits</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span><span class='op'>)</span>, <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>B <span class='op'>=</span> <span class='va'>FOCUS_2006_B</span>, C <span class='op'>=</span> <span class='va'>FOCUS_2006_C</span><span class='op'>)</span>, + cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='va'>fits</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span> +</div><div class='output co'>#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model B C +#> FOMC OK OK +#> +#> OK: No warnings</div><div class='input'> <span class='va'>fits</span><span class='op'>[</span>, <span class='st'>"B"</span><span class='op'>]</span> +</div><div class='output co'>#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model B +#> SFO OK +#> FOMC OK +#> +#> OK: No warnings</div><div class='input'> <span class='va'>fits</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='st'>"B"</span><span class='op'>]</span> +</div><div class='output co'>#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model B +#> SFO OK +#> +#> OK: No warnings</div><div class='input'> + <span class='fu'><a href='https://rdrr.io/r/utils/head.html'>head</a></span><span class='op'>(</span> <span class='co'># This extracts an mkinfit object with lots of components</span> - <span class='no'>fits</span><span class='kw'>[[</span><span class='st'>"FOMC"</span>, <span class='st'>"B"</span>]] - )</div><div class='output co'>#> $par + <span class='va'>fits</span><span class='op'>[[</span><span class='st'>"FOMC"</span>, <span class='st'>"B"</span><span class='op'>]</span><span class='op'>]</span> + <span class='op'>)</span> +</div><div class='output co'>#> $par #> parent_0 log_alpha log_beta sigma #> 99.666193 2.549849 5.050586 1.890202 #> @@ -214,12 +233,11 @@ either a list of mkinfit objects or a single mkinfit object.</p></td> #> #> $evaluations #> function gradient -#> 25 72 +#> 25 78 #> #> $message #> [1] "both X-convergence and relative convergence (5)" -#> </div><div class='input'> -</div></pre> +#> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -235,7 +253,7 @@ either a list of mkinfit objects or a single mkinfit object.</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html index b2292604..d37fa5a5 100644 --- a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html +++ b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html @@ -76,7 +76,7 @@ in this fit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -113,6 +113,9 @@ in this fit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -121,8 +124,8 @@ in this fit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -152,12 +155,12 @@ the initial concentration of the parent compound was fixed to a value of 100 in this fit.</p> </div> - <pre class="usage"><span class='no'>FOCUS_2006_DFOP_ref_A_to_B</span></pre> + <pre class="usage"><span class='va'>FOCUS_2006_DFOP_ref_A_to_B</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>A data frame containing the following variables.</p><dl'> + <p>A data frame containing the following variables.</p><dl> <dt><code>package</code></dt><dd><p>a factor giving the name of the software package</p></dd> <dt><code>M0</code></dt><dd><p>The fitted initial concentration of the parent compound</p></dd> <dt><code>f</code></dt><dd><p>The fitted f parameter</p></dd> @@ -178,7 +181,8 @@ in this fit.</p> <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span>(<span class='no'>FOCUS_2006_DFOP_ref_A_to_B</span>)</div></pre> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_DFOP_ref_A_to_B</span><span class='op'>)</span> +</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -194,7 +198,7 @@ in this fit.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html index 71cfb721..d3f7894c 100644 --- a/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html @@ -76,7 +76,7 @@ in this fit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -113,6 +113,9 @@ in this fit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -121,8 +124,8 @@ in this fit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -152,12 +155,12 @@ the initial concentration of the parent compound was fixed to a value of 100 in this fit.</p> </div> - <pre class="usage"><span class='no'>FOCUS_2006_FOMC_ref_A_to_F</span></pre> + <pre class="usage"><span class='va'>FOCUS_2006_FOMC_ref_A_to_F</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>A data frame containing the following variables.</p><dl'> + <p>A data frame containing the following variables.</p><dl> <dt><code>package</code></dt><dd><p>a factor giving the name of the software package</p></dd> <dt><code>M0</code></dt><dd><p>The fitted initial concentration of the parent compound</p></dd> <dt><code>alpha</code></dt><dd><p>The fitted alpha parameter</p></dd> @@ -177,7 +180,8 @@ in this fit.</p> <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span>(<span class='no'>FOCUS_2006_FOMC_ref_A_to_F</span>)</div></pre> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_FOMC_ref_A_to_F</span><span class='op'>)</span> +</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -193,7 +197,7 @@ in this fit.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOCUS_2006_HS_ref_A_to_F.html b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html index 21d778a8..a18abad5 100644 --- a/docs/reference/FOCUS_2006_HS_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html @@ -76,7 +76,7 @@ in this fit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -113,6 +113,9 @@ in this fit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -121,8 +124,8 @@ in this fit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -152,12 +155,12 @@ the initial concentration of the parent compound was fixed to a value of 100 in this fit.</p> </div> - <pre class="usage"><span class='no'>FOCUS_2006_HS_ref_A_to_F</span></pre> + <pre class="usage"><span class='va'>FOCUS_2006_HS_ref_A_to_F</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>A data frame containing the following variables.</p><dl'> + <p>A data frame containing the following variables.</p><dl> <dt><code>package</code></dt><dd><p>a factor giving the name of the software package</p></dd> <dt><code>M0</code></dt><dd><p>The fitted initial concentration of the parent compound</p></dd> <dt><code>tb</code></dt><dd><p>The fitted tb parameter</p></dd> @@ -178,7 +181,8 @@ in this fit.</p> <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span>(<span class='no'>FOCUS_2006_HS_ref_A_to_F</span>)</div></pre> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_HS_ref_A_to_F</span><span class='op'>)</span> +</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -194,7 +198,7 @@ in this fit.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html index 8d5a0c59..e0fbc498 100644 --- a/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html +++ b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html @@ -76,7 +76,7 @@ in this fit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -113,6 +113,9 @@ in this fit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -121,8 +124,8 @@ in this fit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -152,12 +155,12 @@ the initial concentration of the parent compound was fixed to a value of 100 in this fit.</p> </div> - <pre class="usage"><span class='no'>FOCUS_2006_SFO_ref_A_to_F</span></pre> + <pre class="usage"><span class='va'>FOCUS_2006_SFO_ref_A_to_F</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>A data frame containing the following variables.</p><dl'> + <p>A data frame containing the following variables.</p><dl> <dt><code>package</code></dt><dd><p>a factor giving the name of the software package</p></dd> <dt><code>M0</code></dt><dd><p>The fitted initial concentration of the parent compound</p></dd> <dt><code>k</code></dt><dd><p>The fitted first-order degradation rate constant</p></dd> @@ -176,7 +179,8 @@ in this fit.</p> <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span>(<span class='no'>FOCUS_2006_SFO_ref_A_to_F</span>)</div></pre> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_SFO_ref_A_to_F</span><span class='op'>)</span> +</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -192,7 +196,7 @@ in this fit.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOCUS_2006_datasets.html b/docs/reference/FOCUS_2006_datasets.html index 51ea1ded..543e24ad 100644 --- a/docs/reference/FOCUS_2006_datasets.html +++ b/docs/reference/FOCUS_2006_datasets.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -144,17 +147,17 @@ <p>Data taken from FOCUS (2006), p. 258.</p> </div> - <pre class="usage"><span class='no'>FOCUS_2006_A</span> - <span class='no'>FOCUS_2006_B</span> - <span class='no'>FOCUS_2006_C</span> - <span class='no'>FOCUS_2006_D</span> - <span class='no'>FOCUS_2006_E</span> - <span class='no'>FOCUS_2006_F</span></pre> + <pre class="usage"><span class='va'>FOCUS_2006_A</span> + <span class='va'>FOCUS_2006_B</span> + <span class='va'>FOCUS_2006_C</span> + <span class='va'>FOCUS_2006_D</span> + <span class='va'>FOCUS_2006_E</span> + <span class='va'>FOCUS_2006_F</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>6 datasets with observations on the following variables.</p><dl'> + <p>6 datasets with observations on the following variables.</p><dl> <dt><code>name</code></dt><dd><p>a factor containing the name of the observed variable</p></dd> <dt><code>time</code></dt><dd><p>a numeric vector containing time points</p></dd> <dt><code>value</code></dt><dd><p>a numeric vector containing concentrations in percent of applied radioactivity</p></dd> @@ -170,7 +173,8 @@ <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='no'>FOCUS_2006_C</span></div><div class='output co'>#> name time value + <pre class="examples"><div class='input'><span class='va'>FOCUS_2006_C</span> +</div><div class='output co'>#> name time value #> 1 parent 0 85.1 #> 2 parent 1 57.9 #> 3 parent 3 29.9 @@ -195,7 +199,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/FOMC.solution.html b/docs/reference/FOMC.solution.html index d279f32f..c376227c 100644 --- a/docs/reference/FOMC.solution.html +++ b/docs/reference/FOMC.solution.html @@ -73,7 +73,7 @@ a decreasing rate constant." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ a decreasing rate constant." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/HS.solution.html b/docs/reference/HS.solution.html index 0f5915c3..8a90fec3 100644 --- a/docs/reference/HS.solution.html +++ b/docs/reference/HS.solution.html @@ -73,7 +73,7 @@ between them." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ between them." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/IORE.solution.html b/docs/reference/IORE.solution.html index be326cff..8e6a2792 100644 --- a/docs/reference/IORE.solution.html +++ b/docs/reference/IORE.solution.html @@ -73,7 +73,7 @@ a concentration dependent rate constant." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ a concentration dependent rate constant." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/NAFTA_SOP_2015-1.png b/docs/reference/NAFTA_SOP_2015-1.png Binary files differindex 9025f2bb..76d724f0 100644 --- a/docs/reference/NAFTA_SOP_2015-1.png +++ b/docs/reference/NAFTA_SOP_2015-1.png diff --git a/docs/reference/NAFTA_SOP_2015.html b/docs/reference/NAFTA_SOP_2015.html index 97674400..301bf684 100644 --- a/docs/reference/NAFTA_SOP_2015.html +++ b/docs/reference/NAFTA_SOP_2015.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -144,13 +147,13 @@ <p>Data taken from US EPA (2015), p. 19 and 23.</p> </div> - <pre class="usage"><span class='no'>NAFTA_SOP_Appendix_B</span> - <span class='no'>NAFTA_SOP_Appendix_D</span></pre> + <pre class="usage"><span class='va'>NAFTA_SOP_Appendix_B</span> + <span class='va'>NAFTA_SOP_Appendix_D</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>2 datasets with observations on the following variables.</p><dl'> + <p>2 datasets with observations on the following variables.</p><dl> <dt><code>name</code></dt><dd><p>a factor containing the name of the observed variable</p></dd> <dt><code>time</code></dt><dd><p>a numeric vector containing time points</p></dd> <dt><code>value</code></dt><dd><p>a numeric vector containing concentrations</p></dd> @@ -169,7 +172,9 @@ <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'> <span class='no'>nafta_evaluation</span> <span class='kw'><-</span> <span class='fu'><a href='nafta.html'>nafta</a></span>(<span class='no'>NAFTA_SOP_Appendix_D</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>)</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding</span></div><div class='output co'>#> <span class='message'>to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The representative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='output co'>#> Sums of squares: + <pre class="examples"><div class='input'> <span class='va'>nafta_evaluation</span> <span class='op'><-</span> <span class='fu'><a href='nafta.html'>nafta</a></span><span class='op'>(</span><span class='va'>NAFTA_SOP_Appendix_D</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding</span></div><div class='output co'>#> <span class='message'>to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The representative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>nafta_evaluation</span><span class='op'>)</span> +</div><div class='output co'>#> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 #> @@ -178,17 +183,17 @@ #> #> Parameters: #> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 83.7558 1.80e-14 77.18268 90.3288 -#> k_parent_sink 0.0017 7.43e-05 0.00112 0.0026 -#> sigma 8.7518 1.22e-05 5.64278 11.8608 +#> Estimate Pr(>t) Lower Upper +#> parent_0 83.7558 1.80e-14 77.18268 90.3288 +#> k_parent 0.0017 7.43e-05 0.00112 0.0026 +#> sigma 8.7518 1.22e-05 5.64278 11.8608 #> #> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 -#> k__iore_parent_sink 8.40e-14 NA 1.79e-18 3.94e-09 -#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 -#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.69e+01 NA 8.88e+01 1.05e+02 +#> k__iore_parent 8.40e-14 NA 1.79e-18 3.94e-09 +#> N_parent 6.68e+00 NA 4.19e+00 9.17e+00 +#> sigma 5.85e+00 NA 3.76e+00 7.94e+00 #> #> $DFOP #> Estimate Pr(>t) Lower Upper @@ -206,7 +211,8 @@ #> DFOP 429 2380 841 #> #> Representative half-life: -#> [1] 841.41</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='img'><img src='NAFTA_SOP_2015-1.png' alt='' width='700' height='433' /></div></pre> +#> [1] 841.41</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>nafta_evaluation</span><span class='op'>)</span> +</div><div class='img'><img src='NAFTA_SOP_2015-1.png' alt='' width='700' height='433' /></div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -222,7 +228,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/NAFTA_SOP_Attachment-1.png b/docs/reference/NAFTA_SOP_Attachment-1.png Binary files differindex 19da6da7..eec3dd9b 100644 --- a/docs/reference/NAFTA_SOP_Attachment-1.png +++ b/docs/reference/NAFTA_SOP_Attachment-1.png diff --git a/docs/reference/NAFTA_SOP_Attachment.html b/docs/reference/NAFTA_SOP_Attachment.html index eadab723..03a45bc3 100644 --- a/docs/reference/NAFTA_SOP_Attachment.html +++ b/docs/reference/NAFTA_SOP_Attachment.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -144,7 +147,7 @@ <p>Data taken from from Attachment 1 of the SOP.</p> </div> - <pre class="usage"><span class='no'>NAFTA_SOP_Attachment</span></pre> + <pre class="usage"><span class='va'>NAFTA_SOP_Attachment</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> @@ -163,7 +166,9 @@ <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'> <span class='no'>nafta_att_p5a</span> <span class='kw'><-</span> <span class='fu'><a href='nafta.html'>nafta</a></span>(<span class='no'>NAFTA_SOP_Attachment</span><span class='kw'>[[</span><span class='st'>"p5a"</span>]], <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>)</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The half-life obtained from the IORE model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>nafta_att_p5a</span>)</div><div class='output co'>#> Sums of squares: + <pre class="examples"><div class='input'> <span class='va'>nafta_att_p5a</span> <span class='op'><-</span> <span class='fu'><a href='nafta.html'>nafta</a></span><span class='op'>(</span><span class='va'>NAFTA_SOP_Attachment</span><span class='op'>[[</span><span class='st'>"p5a"</span><span class='op'>]</span><span class='op'>]</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The half-life obtained from the IORE model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>nafta_att_p5a</span><span class='op'>)</span> +</div><div class='output co'>#> Sums of squares: #> SFO IORE DFOP #> 465.21753 56.27506 32.06401 #> @@ -172,23 +177,23 @@ #> #> Parameters: #> $SFO -#> Estimate Pr(>t) Lower Upper -#> parent_0 95.8401 4.67e-21 92.245 99.4357 -#> k_parent_sink 0.0102 3.92e-12 0.009 0.0117 -#> sigma 4.8230 3.81e-06 3.214 6.4318 +#> Estimate Pr(>t) Lower Upper +#> parent_0 95.8401 4.67e-21 92.245 99.4357 +#> k_parent 0.0102 3.92e-12 0.009 0.0117 +#> sigma 4.8230 3.81e-06 3.214 6.4318 #> #> $IORE -#> Estimate Pr(>t) Lower Upper -#> parent_0 1.01e+02 NA 9.91e+01 1.02e+02 -#> k__iore_parent_sink 1.54e-05 NA 4.08e-06 5.84e-05 -#> N_parent 2.57e+00 NA 2.25e+00 2.89e+00 -#> sigma 1.68e+00 NA 1.12e+00 2.24e+00 +#> Estimate Pr(>t) Lower Upper +#> parent_0 1.01e+02 NA 9.91e+01 1.02e+02 +#> k__iore_parent 1.54e-05 NA 4.08e-06 5.84e-05 +#> N_parent 2.57e+00 NA 2.25e+00 2.89e+00 +#> sigma 1.68e+00 NA 1.12e+00 2.24e+00 #> #> $DFOP #> Estimate Pr(>t) Lower Upper #> parent_0 9.99e+01 1.41e-26 98.8116 101.0810 #> k1 2.67e-02 5.05e-06 0.0243 0.0295 -#> k2 2.86e-12 5.00e-01 0.0000 Inf +#> k2 2.42e-12 5.00e-01 0.0000 Inf #> g 6.47e-01 3.67e-06 0.6248 0.6677 #> sigma 1.27e+00 8.91e-06 0.8395 1.6929 #> @@ -197,10 +202,11 @@ #> DT50 DT90 DT50_rep #> SFO 67.7 2.25e+02 6.77e+01 #> IORE 58.2 1.07e+03 3.22e+02 -#> DFOP 55.5 4.42e+11 2.42e+11 +#> DFOP 55.5 5.22e+11 2.86e+11 #> #> Representative half-life: -#> [1] 321.51</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>nafta_att_p5a</span>)</div><div class='img'><img src='NAFTA_SOP_Attachment-1.png' alt='' width='700' height='433' /></div></pre> +#> [1] 321.51</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>nafta_att_p5a</span><span class='op'>)</span> +</div><div class='img'><img src='NAFTA_SOP_Attachment-1.png' alt='' width='700' height='433' /></div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -216,7 +222,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png Binary files differindex 17a35806..7f498242 100644 --- a/docs/reference/Rplot001.png +++ b/docs/reference/Rplot001.png diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png Binary files differindex aec326c7..54c31a3f 100644 --- a/docs/reference/Rplot002.png +++ b/docs/reference/Rplot002.png diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png Binary files differindex fe53157f..19198739 100644 --- a/docs/reference/Rplot003.png +++ b/docs/reference/Rplot003.png diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png Binary files differindex e3ebe97b..ead98fba 100644 --- a/docs/reference/Rplot004.png +++ b/docs/reference/Rplot004.png diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png Binary files differindex 962cfd2d..949a9283 100644 --- a/docs/reference/Rplot005.png +++ b/docs/reference/Rplot005.png diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png Binary files differindex dbd9a00b..da52f580 100644 --- a/docs/reference/Rplot006.png +++ b/docs/reference/Rplot006.png diff --git a/docs/reference/Rplot007.png b/docs/reference/Rplot007.png Binary files differindex fcca232c..fce3b6ee 100644 --- a/docs/reference/Rplot007.png +++ b/docs/reference/Rplot007.png diff --git a/docs/reference/SFO.solution.html b/docs/reference/SFO.solution.html index 9f6fd80b..7e4fb237 100644 --- a/docs/reference/SFO.solution.html +++ b/docs/reference/SFO.solution.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -121,7 +121,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/SFORB.solution.html b/docs/reference/SFORB.solution.html index d6a3ea91..7254c451 100644 --- a/docs/reference/SFORB.solution.html +++ b/docs/reference/SFORB.solution.html @@ -76,7 +76,7 @@ and no substance in the bound fraction." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ and no substance in the bound fraction." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/add_err-1.png b/docs/reference/add_err-1.png Binary files differindex f5686754..9d333cbb 100644 --- a/docs/reference/add_err-1.png +++ b/docs/reference/add_err-1.png diff --git a/docs/reference/add_err-2.png b/docs/reference/add_err-2.png Binary files differindex ac220c9e..3088c40e 100644 --- a/docs/reference/add_err-2.png +++ b/docs/reference/add_err-2.png diff --git a/docs/reference/add_err-3.png b/docs/reference/add_err-3.png Binary files differindex 40465b71..07cf0032 100644 --- a/docs/reference/add_err-3.png +++ b/docs/reference/add_err-3.png diff --git a/docs/reference/add_err.html b/docs/reference/add_err.html index 8adc1fa6..2009aaf4 100644 --- a/docs/reference/add_err.html +++ b/docs/reference/add_err.html @@ -74,7 +74,7 @@ may depend on the predicted value and is specified as a standard deviation." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ may depend on the predicted value and is specified as a standard deviation." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -155,7 +155,7 @@ may depend on the predicted value and is specified as a standard deviation.</p> <span class='va'>prediction</span>, <span class='va'>sdfunc</span>, secondary <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, - n <span class='op'>=</span> <span class='fl'>1000</span>, + n <span class='op'>=</span> <span class='fl'>10</span>, LOD <span class='op'>=</span> <span class='fl'>0.1</span>, reps <span class='op'>=</span> <span class='fl'>2</span>, digits <span class='op'>=</span> <span class='fl'>1</span>, @@ -222,9 +222,9 @@ https://jrwb.de/posters/piacenza_2015.pdf</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># The kinetic model</span> -<span class='va'>m_SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> +<span class='va'>m_SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># Generate a prediction for a specific set of parameters</span> <span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> diff --git a/docs/reference/aw.html b/docs/reference/aw.html index 78f17958..77ee9cef 100644 --- a/docs/reference/aw.html +++ b/docs/reference/aw.html @@ -74,7 +74,7 @@ by Burnham and Anderson (2004)." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -111,6 +111,9 @@ by Burnham and Anderson (2004)." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -119,8 +122,8 @@ by Burnham and Anderson (2004)." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -138,7 +141,7 @@ by Burnham and Anderson (2004)." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Calculate Akaike weights for model averaging</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/aw.R'><code>R/aw.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/aw.R'><code>R/aw.R</code></a></small> <div class="hidden name"><code>aw.Rd</code></div> </div> @@ -148,13 +151,13 @@ expected Kullback-Leibler information as specified by Burnham and Anderson (2004).</p> </div> - <pre class="usage"><span class='fu'>aw</span>(<span class='no'>object</span>, <span class='no'>...</span>) + <pre class="usage"><span class='fu'>aw</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mkinfit</span> -<span class='fu'>aw</span>(<span class='no'>object</span>, <span class='no'>...</span>) +<span class='fu'>aw</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mmkin</span> -<span class='fu'>aw</span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre> +<span class='fu'>aw</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -182,11 +185,16 @@ Inference: Understanding AIC and BIC in Model Selection. <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> -<span class='no'>f_sfo</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"SFO"</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>f_dfop</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"DFOP"</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>aw_sfo_dfop</span> <span class='kw'><-</span> <span class='fu'>aw</span>(<span class='no'>f_sfo</span>, <span class='no'>f_dfop</span>) -<span class='fu'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span>(<span class='no'>aw_sfo_dfop</span>)</div><div class='output co'>#> [1] 1</div><div class='input'><span class='no'>aw_sfo_dfop</span> <span class='co'># SFO gets more weight as it has less parameters and a similar fit</span></div><div class='output co'>#> [1] 0.5970258 0.4029742</div><div class='input'><span class='no'>f</span> <span class='kw'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span>), <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='st'>"FOCUS D"</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_D</span>), <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'>aw</span>(<span class='no'>f</span>)</div><div class='output co'>#> [1] 0.4808722 0.1945539 0.3245740</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span>(<span class='fu'>aw</span>(<span class='no'>f</span>))</div><div class='output co'>#> [1] 1</div><div class='input'><span class='fu'>aw</span>(<span class='no'>f</span>[<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span>)])</div><div class='output co'>#> [1] 0.5970258 0.4029742</div><div class='input'># } +<span class='va'>f_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>f_dfop</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>aw_sfo_dfop</span> <span class='op'><-</span> <span class='fu'>aw</span><span class='op'>(</span><span class='va'>f_sfo</span>, <span class='va'>f_dfop</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='op'>(</span><span class='va'>aw_sfo_dfop</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 1</div><div class='input'><span class='va'>aw_sfo_dfop</span> <span class='co'># SFO gets more weight as it has less parameters and a similar fit</span> +</div><div class='output co'>#> [1] 0.5970258 0.4029742</div><div class='input'><span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"FOCUS D"</span> <span class='op'>=</span> <span class='va'>FOCUS_2006_D</span><span class='op'>)</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'>aw</span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 0.4808722 0.1945539 0.3245740</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/sum.html'>sum</a></span><span class='op'>(</span><span class='fu'>aw</span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 1</div><div class='input'><span class='fu'>aw</span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 0.5970258 0.4029742</div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -203,7 +211,7 @@ Inference: Understanding AIC and BIC in Model Selection. </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index b9e58e8f..4f7e8872 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -79,7 +79,7 @@ method of Venzon and Moolgavkar (1988)." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -128,7 +128,7 @@ method of Venzon and Moolgavkar (1988)." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -278,38 +278,38 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span><span class='op'>(</span><span class='st'>"TRAVIS"</span><span class='op'>)</span> <span class='op'>!=</span> <span class='st'>""</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='st'>"sysname"</span><span class='op'>]</span> <span class='op'>==</span> <span class='st'>"Windows"</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> -<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -<span class='va'>SFO_SFO.ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, +<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>SFO_SFO.ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_d_1</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> </div><div class='output co'>#> user system elapsed -#> 3.770 1.035 3.460 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> +#> 3.796 1.056 3.506 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> <span class='co'># If we additionally exclude parent_0 (the confidence of which is often of</span> <span class='co'># minor interest), we get a nice performance improvement from about 50</span> <span class='co'># seconds to about 12 seconds if we use at least four cores</span> <span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile_no_parent_0</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"k_parent_sink"</span>, <span class='st'>"k_parent_m1"</span>, <span class='st'>"k_m1_sink"</span>, <span class='st'>"sigma"</span><span class='op'>)</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> <span class='warning'>Warning: scheduled cores 3, 2, 1 encountered errors in user code, all values of the jobs will be affected</span></div><div class='output co'>#> <span class='error'>Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0.014 0.027 0.196</span></div><div class='input'><span class='va'>ci_profile</span> +</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> <span class='warning'>Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected</span></div><div class='output co'>#> <span class='error'>Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0 0.043 0.246</span></div><div class='input'><span class='va'>ci_profile</span> </div><div class='output co'>#> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892605 6.702778e-03 +#> k_m1 0.003892606 6.702775e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 #> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> <span class='va'>ci_quadratic_transformed</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 -#> k_parent 0.090823790 1.072543e-01 -#> k_m1 0.004012216 6.897547e-03 -#> f_parent_to_m1 0.469118713 5.595960e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='va'>ci_quadratic_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> +#> parent_0 96.403833585 102.79311650 +#> k_parent 0.090823771 0.10725430 +#> k_m1 0.004012219 0.00689755 +#> f_parent_to_m1 0.469118824 0.55959615 +#> sigma 2.396089689 3.85491806</div><div class='input'><span class='va'>ci_quadratic_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> <span class='va'>ci_quadratic_untransformed</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 -#> k_parent 0.090491931 1.069035e-01 -#> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 +#> parent_0 96.403833589 1.027931e+02 +#> k_parent 0.090491913 1.069035e-01 +#> k_m1 0.003835485 6.685823e-03 +#> f_parent_to_m1 0.469113477 5.598387e-01 #> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='co'># Against the expectation based on Bates and Watts (1988), the confidence</span> <span class='co'># intervals based on the internal parameter transformation are less</span> <span class='co'># congruent with the likelihood based intervals. Note the superiority of the</span> @@ -318,11 +318,11 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, <span class='va'>rel_diffs_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_untransformed</span> <span class='op'>-</span> <span class='va'>ci_profile</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile</span><span class='op'>)</span> <span class='va'>rel_diffs_transformed</span> <span class='op'><</span> <span class='va'>rel_diffs_untransformed</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 TRUE TRUE +#> parent_0 FALSE FALSE #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_transformed</span>, <span class='fl'>3</span><span class='op'>)</span> +#> sigma TRUE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_transformed</span>, <span class='fl'>3</span><span class='op'>)</span> </div><div class='output co'>#> 2.5% 97.5% #> parent_0 0.000541 0.000222 #> k_parent 0.000960 0.000900 @@ -338,27 +338,27 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, <span class='co'># Investigate a case with formation fractions</span> <span class='va'>f_d_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.ff</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='va'>ci_profile_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span> +<span class='va'>ci_profile_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span> </div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='input'><span class='va'>ci_profile_ff</span> </div><div class='output co'>#> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892605 6.702778e-03 +#> k_m1 0.003892606 6.702775e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 #> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> <span class='va'>ci_quadratic_transformed_ff</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 -#> k_parent 0.090823790 1.072543e-01 -#> k_m1 0.004012216 6.897547e-03 -#> f_parent_to_m1 0.469118713 5.595960e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='va'>ci_quadratic_untransformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> +#> parent_0 96.403833585 102.79311650 +#> k_parent 0.090823771 0.10725430 +#> k_m1 0.004012219 0.00689755 +#> f_parent_to_m1 0.469118824 0.55959615 +#> sigma 2.396089689 3.85491806</div><div class='input'><span class='va'>ci_quadratic_untransformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> <span class='va'>ci_quadratic_untransformed_ff</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 -#> k_parent 0.090491931 1.069035e-01 -#> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 +#> parent_0 96.403833589 1.027931e+02 +#> k_parent 0.090491913 1.069035e-01 +#> k_m1 0.003835485 6.685823e-03 +#> f_parent_to_m1 0.469113477 5.598387e-01 #> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='va'>rel_diffs_transformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_transformed_ff</span> <span class='op'>-</span> <span class='va'>ci_profile_ff</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile_ff</span><span class='op'>)</span> <span class='va'>rel_diffs_untransformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_untransformed_ff</span> <span class='op'>-</span> <span class='va'>ci_profile_ff</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile_ff</span><span class='op'>)</span> <span class='co'># While the confidence interval for the parent rate constant is closer to</span> @@ -367,46 +367,46 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, <span class='co'># without internal parameter transformation.</span> <span class='va'>rel_diffs_transformed_ff</span> <span class='op'><</span> <span class='va'>rel_diffs_untransformed_ff</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 TRUE TRUE +#> parent_0 FALSE FALSE #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE</div><div class='input'><span class='va'>rel_diffs_transformed_ff</span> +#> sigma TRUE FALSE</div><div class='input'><span class='va'>rel_diffs_transformed_ff</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.0005408080 0.0002217794 -#> k_parent 0.0009596417 0.0009003876 -#> k_m1 0.0307277370 0.0290579182 -#> f_parent_to_m1 0.0046884130 0.0027782556 +#> parent_0 0.0005408689 0.0002217234 +#> k_parent 0.0009598532 0.0009001864 +#> k_m1 0.0307283044 0.0290588365 +#> f_parent_to_m1 0.0046881768 0.0027780063 #> sigma 0.0550252516 0.0327066836</div><div class='input'><span class='va'>rel_diffs_untransformed_ff</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.0005408085 0.0002217799 -#> k_parent 0.0046100096 0.0023730229 -#> k_m1 0.0146746469 0.0025301011 -#> f_parent_to_m1 0.0046997599 0.0023460223 +#> parent_0 0.0005408689 0.0002217233 +#> k_parent 0.0046102155 0.0023732281 +#> k_m1 0.0146740688 0.0025291817 +#> f_parent_to_m1 0.0046995211 0.0023457712 #> sigma 0.0550252516 0.0327066836</div><div class='input'> <span class='co'># The profiling for the following fit does not finish in a reasonable time,</span> <span class='co'># therefore we use the quadratic approximation</span> -<span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, +<span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>DFOP_par_c</span> <span class='op'><-</span> <span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span> <span class='va'>f_tc_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_par</span>, <span class='va'>DFOP_par_c</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, error_model_algorithm <span class='op'>=</span> <span class='st'>"direct"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_tc_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 94.59613833 106.19939215 -#> k_M1 0.03760542 0.04490759 -#> k_M2 0.00856874 0.01087675 -#> f_parent_to_M1 0.02146166 0.62023888 -#> f_parent_to_M2 0.01516502 0.37975343 -#> k1 0.27389751 0.33388078 -#> k2 0.01861456 0.02250379 -#> g 0.67194349 0.73583256 -#> sigma_low 0.25128383 0.83992146 -#> rsd_high 0.04041100 0.07662001</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_tc_2</span>, <span class='st'>"parent_0"</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 94.596126334 106.19944007 +#> k_M1 0.037605408 0.04490759 +#> k_M2 0.008568739 0.01087675 +#> f_parent_to_M1 0.021463787 0.62023881 +#> f_parent_to_M2 0.015166531 0.37975349 +#> k1 0.273897467 0.33388084 +#> k2 0.018614555 0.02250379 +#> g 0.671943606 0.73583278 +#> sigma_low 0.251283766 0.83992113 +#> rsd_high 0.040411014 0.07662005</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_tc_2</span>, <span class='st'>"parent_0"</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> </div><div class='output co'>#> 2.5% 97.5% -#> parent_0 94.59614 106.1994</div><div class='input'><span class='co'># }</span> +#> parent_0 94.59613 106.1994</div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> diff --git a/docs/reference/create_deg_func.html b/docs/reference/create_deg_func.html index 6b8f3e83..ed49e37e 100644 --- a/docs/reference/create_deg_func.html +++ b/docs/reference/create_deg_func.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -121,7 +121,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -169,32 +169,32 @@ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>FOCUS_D</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span> <span class='co'># to avoid warnings</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>FOCUS_D</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span> <span class='co'># to avoid warnings</span> <span class='va'>fit_1</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"analytical"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='va'>fit_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='co'># \dontrun{</span> +<span class='va'>fit_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='co'># \dontrun{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='va'><a href='http://rbenchmark.googlecode.com'>rbenchmark</a></span><span class='op'>)</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/pkg/rbenchmark/man/benchmark.html'>benchmark</a></span><span class='op'>(</span> analytical <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"analytical"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, deSolve <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, replications <span class='op'>=</span> <span class='fl'>2</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Loading required package: rbenchmark</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='output co'>#> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.416 1.000 0.416 0 0 -#> 2 deSolve 2 0.715 1.719 0.715 0 0 +</div><div class='output co'>#> <span class='message'>Loading required package: rbenchmark</span></div><div class='output co'>#> test replications elapsed relative user.self sys.self user.child +#> 1 analytical 2 0.389 1.000 0.389 0 0 +#> 2 deSolve 2 0.689 1.771 0.688 0 0 #> sys.child #> 1 0 #> 2 0</div><div class='input'> <span class='va'>DFOP_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/pkg/rbenchmark/man/benchmark.html'>benchmark</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/pkg/rbenchmark/man/benchmark.html'>benchmark</a></span><span class='op'>(</span> analytical <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>DFOP_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"analytical"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, deSolve <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>DFOP_SFO</span>, <span class='va'>FOCUS_D</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, replications <span class='op'>=</span> <span class='fl'>2</span><span class='op'>)</span> </div><div class='output co'>#> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.912 1.00 0.912 0.001 0 -#> 2 deSolve 2 1.724 1.89 1.723 0.000 0 +#> 1 analytical 2 0.825 1.000 0.825 0 0 +#> 2 deSolve 2 1.574 1.908 1.573 0 0 #> sys.child #> 1 0 #> 2 0</div><div class='input'><span class='co'># }</span> diff --git a/docs/reference/dimethenamid_2018.html b/docs/reference/dimethenamid_2018.html new file mode 100644 index 00000000..435848c2 --- /dev/null +++ b/docs/reference/dimethenamid_2018.html @@ -0,0 +1,234 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Aerobic soil degradation data on dimethenamid and dimethenamid-P from the EU assessment in 2018 — dimethenamid_2018 • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Aerobic soil degradation data on dimethenamid and dimethenamid-P from the EU assessment in 2018 — dimethenamid_2018" /> +<meta property="og:description" content="The datasets were extracted from the active substance evaluation dossier +published by EFSA. Kinetic evaluations shown for these datasets are intended +to illustrate and advance kinetic modelling. The fact that these data and +some results are shown here does not imply a license to use them in the +context of pesticide registrations, as the use of the data may be +constrained by data protection regulations." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Aerobic soil degradation data on dimethenamid and dimethenamid-P from the EU assessment in 2018</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/dimethenamid_2018.R'><code>R/dimethenamid_2018.R</code></a></small> + <div class="hidden name"><code>dimethenamid_2018.Rd</code></div> + </div> + + <div class="ref-description"> + <p>The datasets were extracted from the active substance evaluation dossier +published by EFSA. Kinetic evaluations shown for these datasets are intended +to illustrate and advance kinetic modelling. The fact that these data and +some results are shown here does not imply a license to use them in the +context of pesticide registrations, as the use of the data may be +constrained by data protection regulations.</p> + </div> + + <pre class="usage"><span class='va'>dimethenamid_2018</span></pre> + + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>An <a href='mkindsg.html'>mkindsg</a> object grouping eight datasets with some meta information</p> + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> + + <p>Rapporteur Member State Germany, Co-Rapporteur Member State Bulgaria (2018) +Renewal Assessment Report Dimethenamid-P Volume 3 - B.8 Environmental fate and behaviour +Rev. 2 - November 2017 +<a href='http://registerofquestions.efsa.europa.eu/roqFrontend/outputLoader?output=ON-5211'>http://registerofquestions.efsa.europa.eu/roqFrontend/outputLoader?output=ON-5211</a></p> + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>The R code used to create this data object is installed with this package +in the 'dataset_generation' directory. In the code, page numbers are given for +specific pieces of information in the comments.</p> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>dimethenamid_2018</span><span class='op'>)</span> +</div><div class='output co'>#> <mkindsg> holding 8 mkinds objects +#> Title $title: Aerobic soil degradation data on dimethenamid-P from the EU assessment in 2018 +#> Occurrence of observed compounds $observed_n: +#> DMTAP M23 M27 M31 DMTA +#> 4 7 7 7 4 +#> Time normalisation factors $f_time_norm: +#> [1] 1.0000000 0.9706477 0.9706477 1.2284784 1.2284784 0.6233856 0.7678922 +#> [8] 0.6733938 +#> Meta information $meta: +#> study usda_soil_type study_moisture_ref_type +#> Calke Unsworth 2014 Sandy loam pF2 +#> Borstel 1 Staudenmaier 2013 Sand pF1 +#> Borstel 2 Staudenmaier 2009 Sand pF1 +#> Elliot 1 Wendt 1997 Clay loam pF2.5 +#> Elliot 2 Wendt 1997 Clay loam pF2.5 +#> Flaach König 1996 Sandy clay loam pF1 +#> BBA 2.2 König 1995 Loamy sand pF1 +#> BBA 2.3 König 1995 Sandy loam pF1 +#> rel_moisture study_ref_moisture temperature +#> Calke 1.00 NA 20 +#> Borstel 1 0.50 23.00 20 +#> Borstel 2 0.50 23.00 20 +#> Elliot 1 0.75 33.37 23 +#> Elliot 2 0.75 33.37 23 +#> Flaach 0.40 NA 20 +#> BBA 2.2 0.40 NA 20 +#> BBA 2.3 0.40 NA 20</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/endpoints.html b/docs/reference/endpoints.html index 376a263e..9bfbfdc8 100644 --- a/docs/reference/endpoints.html +++ b/docs/reference/endpoints.html @@ -78,7 +78,7 @@ advantage that the SFORB model can also be used for metabolites." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -127,7 +127,7 @@ advantage that the SFORB model can also be used for metabolites." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -165,8 +165,11 @@ advantage that the SFORB model can also be used for metabolites.</p> <colgroup><col class="name" /><col class="desc" /></colgroup> <tr> <th>fit</th> - <td><p>An object of class <code><a href='mkinfit.html'>mkinfit</a></code> or -<code><a href='nlme.mmkin.html'>nlme.mmkin</a></code></p></td> + <td><p>An object of class <a href='mkinfit.html'>mkinfit</a> or <a href='nlme.mmkin.html'>nlme.mmkin</a> +or another object that has list components +mkinmod containing an <a href='mkinmod.html'>mkinmod</a> degradation model, and two numeric vectors, +bparms.optim and bparms.fixed, that contain parameter values +for that model.</p></td> </tr> </table> @@ -176,9 +179,14 @@ advantage that the SFORB model can also be used for metabolites.</p> and, if applicable, a vector of formation fractions named ff and, if the SFORB model was in use, a vector of eigenvalues of these SFORB models, equivalent to DFOP rate constants</p> + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>Additional DT50 values are calculated from the FOMC DT90 and k1 and k2 from +HS and DFOP, as well as from Eigenvalues b1 and b2 of any SFORB models</p> <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2> - <p>The function is used internally by <code><a href='summary.mkinfit.html'>summary.mkinfit</a></code>.</p> + <p>The function is used internally by <a href='summary.mkinfit.html'>summary.mkinfit</a> +and <a href='summary.nlme.mmkin.html'>summary.nlme.mmkin</a></p> <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> <p>Johannes Ranke</p> diff --git a/docs/reference/experimental_data_for_UBA-1.png b/docs/reference/experimental_data_for_UBA-1.png Binary files differindex b316a5db..22f38cc2 100644 --- a/docs/reference/experimental_data_for_UBA-1.png +++ b/docs/reference/experimental_data_for_UBA-1.png diff --git a/docs/reference/experimental_data_for_UBA.html b/docs/reference/experimental_data_for_UBA.html index b9670390..9333a34f 100644 --- a/docs/reference/experimental_data_for_UBA.html +++ b/docs/reference/experimental_data_for_UBA.html @@ -60,11 +60,11 @@ Datasets 3 and 4 are from the Renewal Assessment Report (RAR) for isofetamid Dataset 5 is from the Renewal Assessment Report (RAR) for ethofumesate (Austria, 2015, p. 16). Datasets 6 to 10 are from the Renewal Assessment Report (RAR) for glyphosate - (Germany, 2013a, pages 8, 28, 50, 51). For the initial sampling, + (Germany, 2013, pages 8, 28, 50, 51). For the initial sampling, the residues given for the metabolite were added to the parent value, following the recommendation of the FOCUS kinetics workgroup. Dataset 11 is from the Renewal Assessment Report (RAR) for 2,4-D - (Germany, 2013b, p. 644). Values reported as zero were set to NA, with + (Hellas, 2013, p. 644). Values reported as zero were set to NA, with the exception of the day three sampling of metabolite A2, which was set to one half of the LOD reported to be 1% AR. Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl @@ -100,7 +100,7 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -137,6 +137,9 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -145,8 +148,8 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -189,24 +192,24 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl <p>Dataset 5 is from the Renewal Assessment Report (RAR) for ethofumesate (Austria, 2015, p. 16).</p> <p>Datasets 6 to 10 are from the Renewal Assessment Report (RAR) for glyphosate - (Germany, 2013a, pages 8, 28, 50, 51). For the initial sampling, + (Germany, 2013, pages 8, 28, 50, 51). For the initial sampling, the residues given for the metabolite were added to the parent value, following the recommendation of the FOCUS kinetics workgroup.</p> <p>Dataset 11 is from the Renewal Assessment Report (RAR) for 2,4-D - (Germany, 2013b, p. 644). Values reported as zero were set to NA, with + (Hellas, 2013, p. 644). Values reported as zero were set to NA, with the exception of the day three sampling of metabolite A2, which was set to one half of the LOD reported to be 1% AR.</p> <p>Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl (United Kingdom, 2014, p. 81).</p> </div> - <pre class="usage"><span class='no'>experimental_data_for_UBA_2019</span></pre> + <pre class="usage"><span class='va'>experimental_data_for_UBA_2019</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <p>A list containing twelve datasets as an R6 class defined by <code><a href='mkinds.html'>mkinds</a></code>, - each containing, among others, the following components</p><dl'> + each containing, among others, the following components</p><dl> <dt><code>title</code></dt><dd><p>The name of the dataset, e.g. <code>Soil 1</code></p></dd> <dt><code>data</code></dt><dd><p>A data frame with the data in the form expected by <code><a href='mkinfit.html'>mkinfit</a></code></p></dd> @@ -224,9 +227,9 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl Registration” Report of the FOCUS Work Group on Degradation Kinetics, Version 1.1, 18 December 2014 <a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> -<p>Germany (2013a). Renewal Assessment Report Glyphosate Volume 3 Annex B.8: Environmental Fate +<p>Germany (2013). Renewal Assessment Report Glyphosate Volume 3 Annex B.8: Environmental Fate and Behaviour</p> -<p>Germany (2013b). Renewal Assessment Report 2,4-D Volume 3 Annex B.8: Fate and behaviour in the +<p>Hellas (2013). Renewal Assessment Report 2,4-D Volume 3 Annex B.8: Fate and behaviour in the environment</p> <p>Ranke (2019) Documentation of results obtained for the error model expertise written for the German Umweltbundesamt.</p> @@ -238,35 +241,40 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> <span class='co'># Model definitions</span> -<span class='no'>sfo_sfo</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A1"</span>), - <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span> -)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>dfop_sfo</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"DFOP"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A1"</span>), - <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span> -)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>sfo_sfo_sfo</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A1"</span>), - <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A2"</span>), - <span class='kw'>A2</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span> -)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>dfop_sfo_sfo</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"DFOP"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A1"</span>), - <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A2"</span>), - <span class='kw'>A2</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span> -)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>d_1_2</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span>(<span class='no'>experimental_data_for_UBA_2019</span>[<span class='fl'>1</span>:<span class='fl'>2</span>], <span class='kw'>function</span>(<span class='no'>x</span>) <span class='no'>x</span>$<span class='no'>data</span>) -<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span>(<span class='no'>d_1_2</span>) <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Soil"</span>, <span class='fl'>1</span>:<span class='fl'>2</span>) - - -<span class='no'>f_1_2_tc</span> <span class='kw'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='st'>"DFOP-SFO-SFO"</span> <span class='kw'>=</span> <span class='no'>dfop_sfo_sfo</span>), <span class='no'>d_1_2</span>, <span class='kw'>error_model</span> <span class='kw'>=</span> <span class='st'>"tc"</span>) - -<span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_1_2_tc</span>, <span class='kw'>resplot</span> <span class='kw'>=</span> <span class='st'>"errmod"</span>)</div><div class='img'><img src='experimental_data_for_UBA-1.png' alt='' width='700' height='433' /></div><div class='input'> -# }</div></pre> +<span class='va'>sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span> +<span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span> +<span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>sfo_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"A2"</span><span class='op'>)</span>, + A2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span> +<span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>dfop_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"A2"</span><span class='op'>)</span>, + A2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span> +<span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>d_1_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>2</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>d_1_2</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Soil"</span>, <span class='fl'>1</span><span class='op'>:</span><span class='fl'>2</span><span class='op'>)</span> + + +<span class='va'>f_1_2_tc</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"DFOP-SFO-SFO"</span> <span class='op'>=</span> <span class='va'>dfop_sfo_sfo</span><span class='op'>)</span>, <span class='va'>d_1_2</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_1_2_tc</span>, resplot <span class='op'>=</span> <span class='st'>"errmod"</span><span class='op'>)</span> +</div><div class='img'><img src='experimental_data_for_UBA-1.png' alt='' width='700' height='433' /></div><div class='input'> +<span class='co'># }</span></div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -282,7 +290,7 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/f_time_norm_focus.html b/docs/reference/f_time_norm_focus.html new file mode 100644 index 00000000..6917b4b3 --- /dev/null +++ b/docs/reference/f_time_norm_focus.html @@ -0,0 +1,285 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Normalisation factors for aerobic soil degradation according to FOCUS guidance — f_time_norm_focus • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Normalisation factors for aerobic soil degradation according to FOCUS guidance — f_time_norm_focus" /> +<meta property="og:description" content="Time step normalisation factors for aerobic soil degradation as described +in Appendix 8 to the FOCUS kinetics guidance (FOCUS 2014, p. 369)." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Normalisation factors for aerobic soil degradation according to FOCUS guidance</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/f_time_norm_focus.R'><code>R/f_time_norm_focus.R</code></a></small> + <div class="hidden name"><code>f_time_norm_focus.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Time step normalisation factors for aerobic soil degradation as described +in Appendix 8 to the FOCUS kinetics guidance (FOCUS 2014, p. 369).</p> + </div> + + <pre class="usage"><span class='fu'>f_time_norm_focus</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='co'># S3 method for numeric</span> +<span class='fu'>f_time_norm_focus</span><span class='op'>(</span> + <span class='va'>object</span>, + moisture <span class='op'>=</span> <span class='cn'>NA</span>, + field_moisture <span class='op'>=</span> <span class='cn'>NA</span>, + temperature <span class='op'>=</span> <span class='va'>object</span>, + Q10 <span class='op'>=</span> <span class='fl'>2.58</span>, + walker <span class='op'>=</span> <span class='fl'>0.7</span>, + f_na <span class='op'>=</span> <span class='cn'>NA</span>, + <span class='va'>...</span> +<span class='op'>)</span> + +<span class='co'># S3 method for mkindsg</span> +<span class='fu'>f_time_norm_focus</span><span class='op'>(</span> + <span class='va'>object</span>, + study_moisture_ref_source <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"auto"</span>, <span class='st'>"meta"</span>, <span class='st'>"focus"</span><span class='op'>)</span>, + Q10 <span class='op'>=</span> <span class='fl'>2.58</span>, + walker <span class='op'>=</span> <span class='fl'>0.7</span>, + f_na <span class='op'>=</span> <span class='cn'>NA</span>, + <span class='va'>...</span> +<span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>object</th> + <td><p>An object containing information used for the calculations</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Currently not used</p></td> + </tr> + <tr> + <th>moisture</th> + <td><p>Numeric vector of moisture contents in \% w/w</p></td> + </tr> + <tr> + <th>field_moisture</th> + <td><p>Numeric vector of moisture contents at field capacity +(pF2) in \% w/w</p></td> + </tr> + <tr> + <th>temperature</th> + <td><p>Numeric vector of temperatures in °C</p></td> + </tr> + <tr> + <th>Q10</th> + <td><p>The Q10 value used for temperature normalisation</p></td> + </tr> + <tr> + <th>walker</th> + <td><p>The Walker exponent used for moisture normalisation</p></td> + </tr> + <tr> + <th>f_na</th> + <td><p>The factor to use for NA values. If set to NA, only factors +for complete cases will be returned.</p></td> + </tr> + <tr> + <th>study_moisture_ref_source</th> + <td><p>Source for the reference value +used to calculate the study moisture. If 'auto', preference is given +to a reference moisture given in the meta information, otherwise +the focus soil moisture for the soil class is used</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2> + + <p>FOCUS (2006) “Guidance Document on Estimating Persistence +and Degradation Kinetics from Environmental Fate Studies on Pesticides in +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, +EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, +<a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a> +FOCUS (2014) “Generic guidance for Estimating Persistence +and Degradation Kinetics from Environmental Fate Studies on Pesticides in +EU Registration” Report of the FOCUS Work Group on Degradation Kinetics, +Version 1.1, 18 December 2014 +<a href='http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics'>http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a></p> + <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> + + <div class='dont-index'><p><a href='focus_soil_moisture.html'>focus_soil_moisture</a></p></div> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>f_time_norm_focus</span><span class='op'>(</span><span class='fl'>25</span>, <span class='fl'>20</span>, <span class='fl'>25</span><span class='op'>)</span> <span class='co'># 1.37, compare FOCUS 2014 p. 184</span> +</div><div class='output co'>#> [1] 1.373956</div><div class='input'> +<span class='va'>D24_2014</span><span class='op'>$</span><span class='va'>meta</span> +</div><div class='output co'>#> study usda_soil_type study_moisture_ref_type +#> Mississippi Cohen 1991 Silt loam <NA> +#> Fayette Liu and Adelfinskaya 2011 Silt loam pF1 +#> RefSol 03-G Liu and Adelfinskaya 2011 Loam pF1 +#> Site E1 Liu and Adelfinskaya 2011 Loam pF1 +#> Site I2 Liu and Adelfinskaya 2011 Loamy sand pF1 +#> rel_moisture temperature +#> Mississippi NA 25 +#> Fayette 0.5 20 +#> RefSol 03-G 0.5 20 +#> Site E1 0.5 20 +#> Site I2 0.5 20</div><div class='input'><span class='co'># No moisture normalisation in the first dataset, so we use f_na = 1 to get</span> +<span class='co'># temperature only normalisation as in the EU evaluation</span> +<span class='fu'>f_time_norm_focus</span><span class='op'>(</span><span class='va'>D24_2014</span>, study_moisture_ref_source <span class='op'>=</span> <span class='st'>"focus"</span>, f_na <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> +</div><div class='output co'>#> $time_norm was set to +#> [1] 1.6062378 0.7118732 0.7156063 0.7156063 0.8977124</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/focus_soil_moisture.html b/docs/reference/focus_soil_moisture.html new file mode 100644 index 00000000..f0c766da --- /dev/null +++ b/docs/reference/focus_soil_moisture.html @@ -0,0 +1,206 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar — focus_soil_moisture • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar — focus_soil_moisture" /> +<meta property="og:description" content="The value were transcribed from p. 36. The table assumes field capacity +corresponds to pF2, MWHC to pF 1 and 1/3 bar to pF 2.5." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/focus_soil_moisture.R'><code>R/focus_soil_moisture.R</code></a></small> + <div class="hidden name"><code>focus_soil_moisture.Rd</code></div> + </div> + + <div class="ref-description"> + <p>The value were transcribed from p. 36. The table assumes field capacity +corresponds to pF2, MWHC to pF 1 and 1/3 bar to pF 2.5.</p> + </div> + + <pre class="usage"><span class='va'>focus_soil_moisture</span></pre> + + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>A matrix with upper case USDA soil classes as row names, and water tension +('pF1', 'pF2', 'pF 2.5') as column names</p> + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> + + <p>Anonymous (2014) Generic Guidance for Tier 1 FOCUS Ground Water Assessment +Version 2.2, May 2014 <a href='https://esdac.jrc.ec.europa.eu/projects/ground-water'>https://esdac.jrc.ec.europa.eu/projects/ground-water</a></p> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='va'>focus_soil_moisture</span> +</div><div class='output co'>#> pF1 pF2 pF2.5 +#> Sand 24 12 7 +#> Loamy sand 24 14 9 +#> Sandy loam 27 19 15 +#> Sandy clay loam 28 22 18 +#> Clay loam 32 28 25 +#> Loam 31 25 21 +#> Silt loam 32 26 21 +#> Silty clay loam 34 30 27 +#> Silt 31 27 21 +#> Sandy clay 41 35 31 +#> Silty clay 44 40 36 +#> Clay 53 48 43</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/get_deg_func.html b/docs/reference/get_deg_func.html index a8e289a6..a0e341c9 100644 --- a/docs/reference/get_deg_func.html +++ b/docs/reference/get_deg_func.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -121,7 +121,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/ilr.html b/docs/reference/ilr.html index 485fcaf0..b91ef055 100644 --- a/docs/reference/ilr.html +++ b/docs/reference/ilr.html @@ -73,7 +73,7 @@ transformations." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ transformations." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/index.html b/docs/reference/index.html index e0d34e8f..c9f66992 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -71,7 +71,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -120,7 +120,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -163,7 +163,7 @@ <tr> <td> - <p><code><a href="mkinmod.html">mkinmod()</a></code> </p> + <p><code><a href="mkinmod.html">mkinmod()</a></code> <code><a href="mkinmod.html">print(<i><mkinmod></i>)</a></code> <code><a href="mkinmod.html">mkinsub()</a></code> </p> </td> <td><p>Function to set up a kinetic model with one or more state variables</p></td> </tr><tr> @@ -297,12 +297,18 @@ of an mmkin object</p></td> <p><code><a href="AIC.mmkin.html">AIC(<i><mmkin></i>)</a></code> <code><a href="AIC.mmkin.html">BIC(<i><mmkin></i>)</a></code> </p> </td> <td><p>Calculate the AIC for a column of an mmkin object</p></td> + </tr><tr> + + <td> + <p><code><a href="print.mmkin.html">print(<i><mmkin></i>)</a></code> </p> + </td> + <td><p>Print method for mmkin objects</p></td> </tr> </tbody><tbody> <tr> <th colspan="2"> <h2 id="section-mixed-models" class="hasAnchor"><a href="#section-mixed-models" class="anchor"></a>Mixed models</h2> - <p class="section-desc"><p>Create and work with nonlinear mixed models</p></p> + <p class="section-desc"><p>Create and work with nonlinear mixed effects models</p></p> </th> </tr> @@ -319,9 +325,15 @@ of an mmkin object</p></td> </tr><tr> <td> - <p><code><a href="plot.nlme.mmkin.html">plot(<i><nlme.mmkin></i>)</a></code> </p> + <p><code><a href="plot.mixed.mmkin.html">plot(<i><mixed.mmkin></i>)</a></code> </p> + </td> + <td><p>Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object</p></td> + </tr><tr> + + <td> + <p><code><a href="summary.nlme.mmkin.html">summary(<i><nlme.mmkin></i>)</a></code> <code><a href="summary.nlme.mmkin.html">print(<i><summary.nlme.mmkin></i>)</a></code> </p> </td> - <td><p>Plot a fitted nonlinear mixed model obtained via an mmkin row object</p></td> + <td><p>Summary method for class "nlme.mmkin"</p></td> </tr><tr> <td> @@ -334,6 +346,12 @@ of an mmkin object</p></td> <p><code><a href="get_deg_func.html">get_deg_func()</a></code> </p> </td> <td><p>Retrieve a degradation function from the mmkin namespace</p></td> + </tr><tr> + + <td> + <p><code><a href="mixed.html">mixed()</a></code> <code><a href="mixed.html">print(<i><mixed.mmkin></i>)</a></code> </p> + </td> + <td><p>Create a mixed effects model from an mmkin row object</p></td> </tr> </tbody><tbody> <tr> @@ -350,6 +368,24 @@ of an mmkin object</p></td> <tr> <td> + <p><code><a href="focus_soil_moisture.html">focus_soil_moisture</a></code> </p> + </td> + <td><p>FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar</p></td> + </tr><tr> + + <td> + <p><code><a href="D24_2014.html">D24_2014</a></code> </p> + </td> + <td><p>Aerobic soil degradation data on 2,4-D from the EU assessment in 2014</p></td> + </tr><tr> + + <td> + <p><code><a href="dimethenamid_2018.html">dimethenamid_2018</a></code> </p> + </td> + <td><p>Aerobic soil degradation data on dimethenamid and dimethenamid-P from the EU assessment in 2018</p></td> + </tr><tr> + + <td> <p><code><a href="FOCUS_2006_datasets.html">FOCUS_2006_A</a></code> <code><a href="FOCUS_2006_datasets.html">FOCUS_2006_B</a></code> <code><a href="FOCUS_2006_datasets.html">FOCUS_2006_C</a></code> <code><a href="FOCUS_2006_datasets.html">FOCUS_2006_D</a></code> <code><a href="FOCUS_2006_datasets.html">FOCUS_2006_E</a></code> <code><a href="FOCUS_2006_datasets.html">FOCUS_2006_F</a></code> </p> </td> <td><p>Datasets A to F from the FOCUS Kinetics report from 2006</p></td> @@ -422,15 +458,15 @@ of an mmkin object</p></td> </tr><tr> <td> - <p><code><a href="mkinds.html">mkinds</a></code> </p> + <p><code><a href="mkinds.html">print(<i><mkinds></i>)</a></code> </p> </td> <td><p>A dataset class for mkin</p></td> </tr><tr> <td> - <p><code><a href="print.mkinds.html">print(<i><mkinds></i>)</a></code> </p> + <p><code><a href="mkindsg.html">print(<i><mkindsg></i>)</a></code> </p> </td> - <td><p>Print mkinds objects</p></td> + <td><p>A class for dataset groups for mkin</p></td> </tr> </tbody><tbody> <tr> @@ -460,7 +496,7 @@ of an mmkin object</p></td> </tbody><tbody> <tr> <th colspan="2"> - <h2 id="section-helper-functions-mainly-used-internally" class="hasAnchor"><a href="#section-helper-functions-mainly-used-internally" class="anchor"></a>Helper functions mainly used internally</h2> + <h2 id="section-utility-functions" class="hasAnchor"><a href="#section-utility-functions" class="anchor"></a>Utility functions</h2> <p class="section-desc"></p> </th> </tr> @@ -472,9 +508,9 @@ of an mmkin object</p></td> <tr> <td> - <p><code><a href="mkinsub.html">mkinsub()</a></code> </p> + <p><code><a href="f_time_norm_focus.html">f_time_norm_focus()</a></code> </p> </td> - <td><p>Function to set up a kinetic submodel for one state variable</p></td> + <td><p>Normalisation factors for aerobic soil degradation according to FOCUS guidance</p></td> </tr><tr> <td> @@ -485,12 +521,6 @@ kinetic models fitted with mkinfit</p></td> </tr><tr> <td> - <p><code><a href="mkinpredict.html">mkinpredict()</a></code> </p> - </td> - <td><p>Produce predictions from a kinetic model using specific parameters</p></td> - </tr><tr> - - <td> <p><code><a href="mkin_wide_to_long.html">mkin_wide_to_long()</a></code> </p> </td> <td><p>Convert a dataframe with observations over time into long format</p></td> @@ -500,12 +530,25 @@ kinetic models fitted with mkinfit</p></td> <p><code><a href="mkin_long_to_wide.html">mkin_long_to_wide()</a></code> </p> </td> <td><p>Convert a dataframe from long to wide format</p></td> - </tr><tr> + </tr> + </tbody><tbody> + <tr> + <th colspan="2"> + <h2 id="section-helper-functions-mainly-used-internally" class="hasAnchor"><a href="#section-helper-functions-mainly-used-internally" class="anchor"></a>Helper functions mainly used internally</h2> + <p class="section-desc"></p> + </th> + </tr> + + + </tbody><tbody> + + + <tr> <td> - <p><code><a href="print.mkinmod.html">print(<i><mkinmod></i>)</a></code> </p> + <p><code><a href="mkinpredict.html">mkinpredict()</a></code> </p> </td> - <td><p>Print mkinmod objects</p></td> + <td><p>Produce predictions from a kinetic model using specific parameters</p></td> </tr><tr> <td> @@ -521,12 +564,6 @@ kinetic models fitted with mkinfit</p></td> </tr><tr> <td> - <p><code><a href="sigma_twocomp.html">sigma_twocomp()</a></code> </p> - </td> - <td><p>Two-component error model</p></td> - </tr><tr> - - <td> <p><code><a href="logLik.mkinfit.html">logLik(<i><mkinfit></i>)</a></code> </p> </td> <td><p>Calculated the log-likelihood of a fitted mkinfit object</p></td> @@ -640,6 +677,12 @@ kinetic models fitted with mkinfit</p></td> <p><code><a href="add_err.html">add_err()</a></code> </p> </td> <td><p>Add normally distributed errors to simulated kinetic degradation data</p></td> + </tr><tr> + + <td> + <p><code><a href="sigma_twocomp.html">sigma_twocomp()</a></code> </p> + </td> + <td><p>Two-component error model</p></td> </tr> </tbody><tbody> <tr> diff --git a/docs/reference/loftest-1.png b/docs/reference/loftest-1.png Binary files differindex 3d20f41e..d6006ecc 100644 --- a/docs/reference/loftest-1.png +++ b/docs/reference/loftest-1.png diff --git a/docs/reference/loftest-2.png b/docs/reference/loftest-2.png Binary files differindex be8bf815..4d0dc551 100644 --- a/docs/reference/loftest-2.png +++ b/docs/reference/loftest-2.png diff --git a/docs/reference/loftest-3.png b/docs/reference/loftest-3.png Binary files differindex cb55838c..43e6a00f 100644 --- a/docs/reference/loftest-3.png +++ b/docs/reference/loftest-3.png diff --git a/docs/reference/loftest-4.png b/docs/reference/loftest-4.png Binary files differindex e2b8ac5c..f94eede1 100644 --- a/docs/reference/loftest-4.png +++ b/docs/reference/loftest-4.png diff --git a/docs/reference/loftest-5.png b/docs/reference/loftest-5.png Binary files differindex a4d9fd48..cf7e5862 100644 --- a/docs/reference/loftest-5.png +++ b/docs/reference/loftest-5.png diff --git a/docs/reference/loftest.html b/docs/reference/loftest.html index bc9ec146..614b8eea 100644 --- a/docs/reference/loftest.html +++ b/docs/reference/loftest.html @@ -75,7 +75,7 @@ lrtest.default from the lmtest package." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -112,6 +112,9 @@ lrtest.default from the lmtest package." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -120,8 +123,8 @@ lrtest.default from the lmtest package." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -139,7 +142,7 @@ lrtest.default from the lmtest package." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Lack-of-fit test for models fitted to data with replicates</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/loftest.R'><code>R/loftest.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/loftest.R'><code>R/loftest.R</code></a></small> <div class="hidden name"><code>loftest.Rd</code></div> </div> @@ -150,10 +153,10 @@ compares the likelihoods using the likelihood ratio test <code><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest.default</a></code> from the lmtest package.</p> </div> - <pre class="usage"><span class='fu'>loftest</span>(<span class='no'>object</span>, <span class='no'>...</span>) + <pre class="usage"><span class='fu'>loftest</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mkinfit</span> -<span class='fu'>loftest</span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre> +<span class='fu'>loftest</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -180,9 +183,11 @@ of replicate samples.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> -<span class='no'>test_data</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>synthetic_data_for_UBA_2014</span><span class='kw'>[[</span><span class='fl'>12</span>]]$<span class='no'>data</span>, <span class='no'>name</span> <span class='kw'>==</span> <span class='st'>"parent"</span>) -<span class='no'>sfo_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"SFO"</span>, <span class='no'>test_data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span>(<span class='no'>sfo_fit</span>) <span class='co'># We see a clear pattern in the residuals</span></div><div class='img'><img src='loftest-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span>(<span class='no'>sfo_fit</span>) <span class='co'># We have a clear lack of fit</span></div><div class='output co'>#> Likelihood ratio test +<span class='va'>test_data</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, <span class='va'>name</span> <span class='op'>==</span> <span class='st'>"parent"</span><span class='op'>)</span> +<span class='va'>sfo_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>test_data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>sfo_fit</span><span class='op'>)</span> <span class='co'># We see a clear pattern in the residuals</span> +</div><div class='img'><img src='loftest-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span><span class='op'>(</span><span class='va'>sfo_fit</span><span class='op'>)</span> <span class='co'># We have a clear lack of fit</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: ANOVA with error model const #> Model 2: SFO with error model const @@ -192,9 +197,11 @@ of replicate samples.</p> #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='co'>#</span> <span class='co'># We try a different model (the one that was used to generate the data)</span> -<span class='no'>dfop_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"DFOP"</span>, <span class='no'>test_data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span>(<span class='no'>dfop_fit</span>) <span class='co'># We don't see systematic deviations, but heteroscedastic residuals</span></div><div class='img'><img src='loftest-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># therefore we should consider adapting the error model, although we have</span> -<span class='fu'>loftest</span>(<span class='no'>dfop_fit</span>) <span class='co'># no lack of fit</span></div><div class='output co'>#> Likelihood ratio test +<span class='va'>dfop_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='va'>test_data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>dfop_fit</span><span class='op'>)</span> <span class='co'># We don't see systematic deviations, but heteroscedastic residuals</span> +</div><div class='img'><img src='loftest-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># therefore we should consider adapting the error model, although we have</span> +<span class='fu'>loftest</span><span class='op'>(</span><span class='va'>dfop_fit</span><span class='op'>)</span> <span class='co'># no lack of fit</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: ANOVA with error model const #> Model 2: DFOP with error model const @@ -202,10 +209,11 @@ of replicate samples.</p> #> 1 10 -40.710 #> 2 5 -42.453 -5 3.485 0.6257</div><div class='input'><span class='co'>#</span> <span class='co'># This is the anova model used internally for the comparison</span> -<span class='no'>test_data_anova</span> <span class='kw'><-</span> <span class='no'>test_data</span> -<span class='no'>test_data_anova</span>$<span class='no'>time</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span>(<span class='no'>test_data_anova</span>$<span class='no'>time</span>) -<span class='no'>anova_fit</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/lm.html'>lm</a></span>(<span class='no'>value</span> ~ <span class='no'>time</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>test_data_anova</span>) -<span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>anova_fit</span>)</div><div class='output co'>#> +<span class='va'>test_data_anova</span> <span class='op'><-</span> <span class='va'>test_data</span> +<span class='va'>test_data_anova</span><span class='op'>$</span><span class='va'>time</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span><span class='op'>(</span><span class='va'>test_data_anova</span><span class='op'>$</span><span class='va'>time</span><span class='op'>)</span> +<span class='va'>anova_fit</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/lm.html'>lm</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='va'>time</span>, data <span class='op'>=</span> <span class='va'>test_data_anova</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>anova_fit</span><span class='op'>)</span> +</div><div class='output co'>#> #> Call: #> lm(formula = value ~ time, data = test_data_anova) #> @@ -230,12 +238,16 @@ of replicate samples.</p> #> Residual standard error: 3.285 on 9 degrees of freedom #> Multiple R-squared: 0.9953, Adjusted R-squared: 0.9912 #> F-statistic: 240.5 on 8 and 9 DF, p-value: 1.417e-09 -#> </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/logLik.html'>logLik</a></span>(<span class='no'>anova_fit</span>) <span class='co'># We get the same likelihood and degrees of freedom</span></div><div class='output co'>#> 'log Lik.' -40.71015 (df=10)</div><div class='input'><span class='co'>#</span> -<span class='no'>test_data_2</span> <span class='kw'><-</span> <span class='no'>synthetic_data_for_UBA_2014</span><span class='kw'>[[</span><span class='fl'>12</span>]]$<span class='no'>data</span> -<span class='no'>m_synth_SFO_lin</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M1"</span>), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M2"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>sfo_lin_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_synth_SFO_lin</span>, <span class='no'>test_data_2</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span>(<span class='no'>sfo_lin_fit</span>) <span class='co'># not a good model, we try parallel formation</span></div><div class='img'><img src='loftest-3.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span>(<span class='no'>sfo_lin_fit</span>)</div><div class='output co'>#> Likelihood ratio test +#> </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/logLik.html'>logLik</a></span><span class='op'>(</span><span class='va'>anova_fit</span><span class='op'>)</span> <span class='co'># We get the same likelihood and degrees of freedom</span> +</div><div class='output co'>#> 'log Lik.' -40.71015 (df=10)</div><div class='input'><span class='co'>#</span> +<span class='va'>test_data_2</span> <span class='op'><-</span> <span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span> +<span class='va'>m_synth_SFO_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"M2"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>sfo_lin_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_SFO_lin</span>, <span class='va'>test_data_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>sfo_lin_fit</span><span class='op'>)</span> <span class='co'># not a good model, we try parallel formation</span> +</div><div class='img'><img src='loftest-3.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span><span class='op'>(</span><span class='va'>sfo_lin_fit</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: ANOVA with error model const #> Model 2: m_synth_SFO_lin with error model const and fixed parameter(s) M1_0, M2_0 @@ -244,10 +256,13 @@ of replicate samples.</p> #> 2 7 -171.927 -21 156.64 < 2.2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='co'>#</span> -<span class='no'>m_synth_SFO_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>)), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>sfo_par_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_synth_SFO_par</span>, <span class='no'>test_data_2</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span>(<span class='no'>sfo_par_fit</span>) <span class='co'># much better for metabolites</span></div><div class='img'><img src='loftest-4.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span>(<span class='no'>sfo_par_fit</span>)</div><div class='output co'>#> Likelihood ratio test +<span class='va'>m_synth_SFO_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>sfo_par_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_SFO_par</span>, <span class='va'>test_data_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>sfo_par_fit</span><span class='op'>)</span> <span class='co'># much better for metabolites</span> +</div><div class='img'><img src='loftest-4.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span><span class='op'>(</span><span class='va'>sfo_par_fit</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: ANOVA with error model const #> Model 2: m_synth_SFO_par with error model const and fixed parameter(s) M1_0, M2_0 @@ -256,10 +271,13 @@ of replicate samples.</p> #> 2 7 -156.331 -21 125.45 < 2.2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='co'>#</span> -<span class='no'>m_synth_DFOP_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"DFOP"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>)), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>dfop_par_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_synth_DFOP_par</span>, <span class='no'>test_data_2</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span>(<span class='no'>dfop_par_fit</span>) <span class='co'># No visual lack of fit</span></div><div class='img'><img src='loftest-5.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span>(<span class='no'>dfop_par_fit</span>) <span class='co'># no lack of fit found by the test</span></div><div class='output co'>#> Likelihood ratio test +<span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>dfop_par_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_par</span>, <span class='va'>test_data_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>dfop_par_fit</span><span class='op'>)</span> <span class='co'># No visual lack of fit</span> +</div><div class='img'><img src='loftest-5.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>loftest</span><span class='op'>(</span><span class='va'>dfop_par_fit</span><span class='op'>)</span> <span class='co'># no lack of fit found by the test</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: ANOVA with error model const #> Model 2: m_synth_DFOP_par with error model const and fixed parameter(s) M1_0, M2_0 @@ -267,11 +285,12 @@ of replicate samples.</p> #> 1 28 -93.606 #> 2 9 -102.763 -19 18.313 0.5016</div><div class='input'><span class='co'>#</span> <span class='co'># The anova model used for comparison in the case of transformation products</span> -<span class='no'>test_data_anova_2</span> <span class='kw'><-</span> <span class='no'>dfop_par_fit</span>$<span class='no'>data</span> -<span class='no'>test_data_anova_2</span>$<span class='no'>variable</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span>(<span class='no'>test_data_anova_2</span>$<span class='no'>variable</span>) -<span class='no'>test_data_anova_2</span>$<span class='no'>time</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span>(<span class='no'>test_data_anova_2</span>$<span class='no'>time</span>) -<span class='no'>anova_fit_2</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/lm.html'>lm</a></span>(<span class='no'>observed</span> ~ <span class='no'>time</span>:<span class='no'>variable</span> - <span class='fl'>1</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>test_data_anova_2</span>) -<span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>anova_fit_2</span>)</div><div class='output co'>#> +<span class='va'>test_data_anova_2</span> <span class='op'><-</span> <span class='va'>dfop_par_fit</span><span class='op'>$</span><span class='va'>data</span> +<span class='va'>test_data_anova_2</span><span class='op'>$</span><span class='va'>variable</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span><span class='op'>(</span><span class='va'>test_data_anova_2</span><span class='op'>$</span><span class='va'>variable</span><span class='op'>)</span> +<span class='va'>test_data_anova_2</span><span class='op'>$</span><span class='va'>time</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/factor.html'>as.factor</a></span><span class='op'>(</span><span class='va'>test_data_anova_2</span><span class='op'>$</span><span class='va'>time</span><span class='op'>)</span> +<span class='va'>anova_fit_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/lm.html'>lm</a></span><span class='op'>(</span><span class='va'>observed</span> <span class='op'>~</span> <span class='va'>time</span><span class='op'>:</span><span class='va'>variable</span> <span class='op'>-</span> <span class='fl'>1</span>, data <span class='op'>=</span> <span class='va'>test_data_anova_2</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>anova_fit_2</span><span class='op'>)</span> +</div><div class='output co'>#> #> Call: #> lm(formula = observed ~ time:variable - 1, data = test_data_anova_2) #> @@ -314,7 +333,7 @@ of replicate samples.</p> #> Residual standard error: 2.225 on 25 degrees of freedom #> Multiple R-squared: 0.9979, Adjusted R-squared: 0.9957 #> F-statistic: 469.2 on 25 and 25 DF, p-value: < 2.2e-16 -#> </div><div class='input'># } +#> </div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -331,7 +350,7 @@ of replicate samples.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/logLik.mkinfit.html b/docs/reference/logLik.mkinfit.html index 2b87c95f..ac3f570c 100644 --- a/docs/reference/logLik.mkinfit.html +++ b/docs/reference/logLik.mkinfit.html @@ -76,7 +76,7 @@ the error model." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ the error model." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -193,12 +193,12 @@ and the fitted error model parameters.</p> <pre class="examples"><div class='input'> <span class='co'># \dontrun{</span> <span class='va'>sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span> <span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> <span class='va'>d_t</span> <span class='op'><-</span> <span class='va'>FOCUS_2006_D</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='va'>d_t</span> <span class='op'><-</span> <span class='va'>FOCUS_2006_D</span> <span class='va'>f_nw</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>sfo_sfo</span>, <span class='va'>d_t</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='co'># no weighting (weights are unity)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'> <span class='va'>f_obs</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>sfo_sfo</span>, <span class='va'>d_t</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='va'>f_obs</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>sfo_sfo</span>, <span class='va'>d_t</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='va'>f_tc</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>sfo_sfo</span>, <span class='va'>d_t</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nw</span>, <span class='va'>f_obs</span>, <span class='va'>f_tc</span><span class='op'>)</span> </div><div class='output co'>#> df AIC diff --git a/docs/reference/logistic.solution-2.png b/docs/reference/logistic.solution-2.png Binary files differindex 764996df..79bf3453 100644 --- a/docs/reference/logistic.solution-2.png +++ b/docs/reference/logistic.solution-2.png diff --git a/docs/reference/logistic.solution.html b/docs/reference/logistic.solution.html index 97c98a4a..404344a3 100644 --- a/docs/reference/logistic.solution.html +++ b/docs/reference/logistic.solution.html @@ -73,7 +73,7 @@ an increasing rate constant, supposedly caused by microbial growth" /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ an increasing rate constant, supposedly caused by microbial growth" /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -225,7 +225,7 @@ Version 1.1, 18 December 2014 lty <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span>, col <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>)</span> </div><div class='img'><img src='logistic.solution-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='co'># Fit with synthetic data</span> - <span class='va'>logistic</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"logistic"</span><span class='op'>)</span><span class='op'>)</span> + <span class='va'>logistic</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"logistic"</span><span class='op'>)</span><span class='op'>)</span> <span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> <span class='va'>parms_logistic</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>kmax <span class='op'>=</span> <span class='fl'>0.08</span>, k0 <span class='op'>=</span> <span class='fl'>0.0001</span>, r <span class='op'>=</span> <span class='fl'>0.2</span><span class='op'>)</span> diff --git a/docs/reference/lrtest.mkinfit.html b/docs/reference/lrtest.mkinfit.html index 433b0a8b..e39314d9 100644 --- a/docs/reference/lrtest.mkinfit.html +++ b/docs/reference/lrtest.mkinfit.html @@ -76,7 +76,7 @@ and can be expressed by fixing the parameters of the other." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -113,6 +113,9 @@ and can be expressed by fixing the parameters of the other." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -121,8 +124,8 @@ and can be expressed by fixing the parameters of the other." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -140,7 +143,7 @@ and can be expressed by fixing the parameters of the other." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Likelihood ratio test for mkinfit models</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/lrtest.mkinfit.R'><code>R/lrtest.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/lrtest.mkinfit.R'><code>R/lrtest.mkinfit.R</code></a></small> <div class="hidden name"><code>lrtest.mkinfit.Rd</code></div> </div> @@ -153,10 +156,10 @@ and can be expressed by fixing the parameters of the other.</p> </div> <pre class="usage"><span class='co'># S3 method for mkinfit</span> -<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>object</span>, <span class='kw'>object_2</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>) +<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>object</span>, object_2 <span class='op'>=</span> <span class='cn'>NULL</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mmkin</span> -<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre> +<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -188,10 +191,11 @@ lower number of fitted parameters (null hypothesis).</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> -<span class='no'>test_data</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>synthetic_data_for_UBA_2014</span><span class='kw'>[[</span><span class='fl'>12</span>]]$<span class='no'>data</span>, <span class='no'>name</span> <span class='kw'>==</span> <span class='st'>"parent"</span>) -<span class='no'>sfo_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"SFO"</span>, <span class='no'>test_data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>dfop_fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"DFOP"</span>, <span class='no'>test_data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>dfop_fit</span>, <span class='no'>sfo_fit</span>)</div><div class='output co'>#> Likelihood ratio test +<span class='va'>test_data</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, <span class='va'>name</span> <span class='op'>==</span> <span class='st'>"parent"</span><span class='op'>)</span> +<span class='va'>sfo_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>test_data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>dfop_fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='va'>test_data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>dfop_fit</span>, <span class='va'>sfo_fit</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: DFOP with error model const #> Model 2: SFO with error model const @@ -199,7 +203,8 @@ lower number of fitted parameters (null hypothesis).</p> #> 1 5 -42.453 #> 2 3 -63.954 -2 43.002 4.594e-10 *** #> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>sfo_fit</span>, <span class='no'>dfop_fit</span>)</div><div class='output co'>#> Likelihood ratio test +#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>sfo_fit</span>, <span class='va'>dfop_fit</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: DFOP with error model const #> Model 2: SFO with error model const @@ -214,7 +219,8 @@ lower number of fitted parameters (null hypothesis).</p> <span class='co'>#lrtest(dfop_fit, fixed_parms = c(k2 = 0))</span> <span class='co'># However, this equivalent syntax also works for static help pages</span> -<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>dfop_fit</span>, <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>dfop_fit</span>, <span class='kw'>error_model</span> <span class='kw'>=</span> <span class='st'>"tc"</span>))</div><div class='output co'>#> Likelihood ratio test +<span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>dfop_fit</span>, <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>dfop_fit</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: DFOP with error model tc #> Model 2: DFOP with error model const @@ -222,7 +228,8 @@ lower number of fitted parameters (null hypothesis).</p> #> 1 6 -34.587 #> 2 5 -42.453 -1 15.731 7.302e-05 *** #> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span>(<span class='no'>dfop_fit</span>, <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>dfop_fit</span>, <span class='kw'>fixed_parms</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k2</span> <span class='kw'>=</span> <span class='fl'>0</span>)))</div><div class='output co'>#> Likelihood ratio test +#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>dfop_fit</span>, <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>dfop_fit</span>, fixed_parms <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k2 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> Likelihood ratio test #> #> Model 1: DFOP with error model const #> Model 2: DFOP with error model const and fixed parameter(s) k2 @@ -230,7 +237,7 @@ lower number of fitted parameters (null hypothesis).</p> #> 1 5 -42.453 #> 2 4 -57.340 -1 29.776 4.851e-08 *** #> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'># } +#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -247,7 +254,7 @@ lower number of fitted parameters (null hypothesis).</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/max_twa_parent.html b/docs/reference/max_twa_parent.html index 8e584375..2aa5d5f1 100644 --- a/docs/reference/max_twa_parent.html +++ b/docs/reference/max_twa_parent.html @@ -78,7 +78,7 @@ soil section of the FOCUS guidance." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -127,7 +127,7 @@ soil section of the FOCUS guidance." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> diff --git a/docs/reference/mccall81_245T-1.png b/docs/reference/mccall81_245T-1.png Binary files differnew file mode 100644 index 00000000..58ae716a --- /dev/null +++ b/docs/reference/mccall81_245T-1.png diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html index b8adde34..b99138a0 100644 --- a/docs/reference/mccall81_245T.html +++ b/docs/reference/mccall81_245T.html @@ -74,7 +74,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -171,49 +171,66 @@ <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <p>McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labelled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 - <a href='http://dx.doi.org/10.1021/jf00103a026'>http://dx.doi.org/10.1021/jf00103a026</a></p> + doi: <a href='https://doi.org/10.1021/jf00103a026'>10.1021/jf00103a026</a></p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='va'>SFO_SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>T245 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"phenol"</span><span class='op'>)</span>, - phenol <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"anisole"</span><span class='op'>)</span>, - anisole <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> <span class='co'># \dontrun{</span> + phenol <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"anisole"</span><span class='op'>)</span>, + anisole <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># \dontrun{</span> <span class='va'>fit.1</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>mccall81_245T</span>, <span class='va'>soil</span> <span class='op'>==</span> <span class='st'>"Commerce"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.1</span><span class='op'>)</span><span class='op'>$</span><span class='va'>bpar</span> -</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) -#> T245_0 1.038550e+02 2.184707514 47.537272 4.472189e-18 -#> k_T245 4.337042e-02 0.001898397 22.845818 2.276912e-13 -#> k_phenol 4.050581e-01 0.298699428 1.356073 9.756994e-02 -#> k_anisole 6.678742e-03 0.000802144 8.326114 2.623179e-07 -#> f_T245_to_phenol 6.227599e-01 0.398534167 1.562626 6.949418e-02 -#> f_phenol_to_anisole 1.000000e+00 0.671844168 1.488440 7.867794e-02 -#> sigma 2.514628e+00 0.490755943 5.123989 6.233164e-05 +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) +#> T245_0 1.038550e+02 2.1847074888 47.537272 4.472189e-18 +#> k_T245 4.337042e-02 0.0018983965 22.845818 2.276911e-13 +#> k_phenol 4.050581e-01 0.2986993400 1.356073 9.756988e-02 +#> k_anisole 6.678742e-03 0.0008021439 8.326114 2.623176e-07 +#> f_T245_to_phenol 6.227599e-01 0.3985340295 1.562627 6.949412e-02 +#> f_phenol_to_anisole 1.000000e+00 0.6718439378 1.488441 7.867787e-02 +#> sigma 2.514628e+00 0.4907558750 5.123989 6.233156e-05 #> Lower Upper -#> T245_0 99.246061371 1.084640e+02 +#> T245_0 99.246061370 1.084640e+02 #> k_T245 0.039631621 4.746194e-02 #> k_phenol 0.218013878 7.525762e-01 #> k_anisole 0.005370739 8.305299e-03 -#> f_T245_to_phenol 0.547559082 6.924813e-01 +#> f_T245_to_phenol 0.547559083 6.924813e-01 #> f_phenol_to_anisole 0.000000000 1.000000e+00 #> sigma 1.706607296 3.322649e+00</div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit.1</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> T245_phenol T245_sink phenol_anisole phenol_sink -#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 +#> 6.227599e-01 3.772401e-01 1.000000e+00 6.894640e-11 #> #> $distimes #> DT50 DT90 #> T245 15.982025 53.09114 #> phenol 1.711229 5.68458 #> anisole 103.784092 344.76329 -#> </div><div class='input'> <span class='co'># k_phenol_sink is really small, therefore fix it to zero</span> - <span class='va'>fit.2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>mccall81_245T</span>, <span class='va'>soil</span> <span class='op'>==</span> <span class='st'>"Commerce"</span><span class='op'>)</span>, - parms.ini <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_phenol_sink <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, - fixed_parms <span class='op'>=</span> <span class='st'>"k_phenol_sink"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='warning'>Warning: Initial parameter(s) k_phenol_sink not used in the model</span></div><div class='output co'>#> <span class='error'>Error in data.frame(value = c(state.ini.fixed, parms.fixed)): row names contain missing values</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.2</span><span class='op'>)</span><span class='op'>$</span><span class='va'>bpar</span> -</div><div class='output co'>#> <span class='error'>Error in summary(fit.2): object 'fit.2' not found</span></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit.1</span><span class='op'>)</span> +#> </div><div class='input'> <span class='co'># formation fraction from phenol to anisol is practically 1. As we cannot</span> + <span class='co'># fix formation fractions when using the ilr transformation, we can turn of</span> + <span class='co'># the sink in the model generation</span> + <span class='va'>SFO_SFO_SFO_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>T245 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"phenol"</span><span class='op'>)</span>, + phenol <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"anisole"</span>, sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + anisole <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='va'>fit.2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO_SFO_2</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>mccall81_245T</span>, <span class='va'>soil</span> <span class='op'>==</span> <span class='st'>"Commerce"</span><span class='op'>)</span>, + quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.2</span><span class='op'>)</span><span class='op'>$</span><span class='va'>bpar</span> +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower +#> T245_0 1.038550e+02 2.1623653027 48.028439 4.993108e-19 99.271020526 +#> k_T245 4.337042e-02 0.0018343666 23.643268 3.573555e-14 0.039650977 +#> k_phenol 4.050582e-01 0.1177237248 3.440752 1.679252e-03 0.218746585 +#> k_anisole 6.678741e-03 0.0006829745 9.778903 1.872894e-08 0.005377083 +#> f_T245_to_phenol 6.227599e-01 0.0342197865 18.198825 2.039410e-12 0.547975628 +#> sigma 2.514628e+00 0.3790944250 6.633250 2.875782e-06 1.710983655 +#> Upper +#> T245_0 108.43904097 +#> k_T245 0.04743877 +#> k_phenol 0.75005577 +#> k_anisole 0.00829550 +#> f_T245_to_phenol 0.69212306 +#> sigma 3.31827222</div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit.1</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> T245_phenol T245_sink phenol_anisole phenol_sink -#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 +#> 6.227599e-01 3.772401e-01 1.000000e+00 6.894640e-11 #> #> $distimes #> DT50 DT90 @@ -221,7 +238,7 @@ #> phenol 1.711229 5.68458 #> anisole 103.784092 344.76329 #> </div><div class='input'> <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span><span class='op'>(</span><span class='va'>fit.2</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='error'>Error in identical(fit$err_mod, "const"): object 'fit.2' not found</span></div><div class='input'> <span class='co'># }</span> +</div><div class='img'><img src='mccall81_245T-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> diff --git a/docs/reference/mixed-1.png b/docs/reference/mixed-1.png Binary files differnew file mode 100644 index 00000000..05beffc9 --- /dev/null +++ b/docs/reference/mixed-1.png diff --git a/docs/reference/mixed.html b/docs/reference/mixed.html new file mode 100644 index 00000000..f5429f8b --- /dev/null +++ b/docs/reference/mixed.html @@ -0,0 +1,279 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Create a mixed effects model from an mmkin row object — mixed • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Create a mixed effects model from an mmkin row object — mixed" /> +<meta property="og:description" content="Create a mixed effects model from an mmkin row object" /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Create a mixed effects model from an mmkin row object</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mixed.mmkin.R'><code>R/mixed.mmkin.R</code></a></small> + <div class="hidden name"><code>mixed.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Create a mixed effects model from an mmkin row object</p> + </div> + + <pre class="usage"><span class='fu'>mixed</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='co'># S3 method for mmkin</span> +<span class='fu'>mixed</span><span class='op'>(</span><span class='va'>object</span>, method <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"none"</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='co'># S3 method for mixed.mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>object</th> + <td><p>An <a href='mmkin.html'>mmkin</a> row object</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Currently not used</p></td> + </tr> + <tr> + <th>method</th> + <td><p>The method to be used</p></td> + </tr> + <tr> + <th>x</th> + <td><p>A mixed.mmkin object to print</p></td> + </tr> + <tr> + <th>digits</th> + <td><p>Number of digits to use for printing.</p></td> + </tr> + </table> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> +<span class='va'>n_biphasic</span> <span class='op'><-</span> <span class='fl'>8</span> +<span class='va'>err_1</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>const <span class='op'>=</span> <span class='fl'>1</span>, prop <span class='op'>=</span> <span class='fl'>0.07</span><span class='op'>)</span> + +<span class='va'>DFOP_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456</span><span class='op'>)</span> +<span class='va'>log_sd</span> <span class='op'><-</span> <span class='fl'>0.3</span> +<span class='va'>syn_biphasic_parms</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>as.matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span><span class='op'>(</span> + k1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.05</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span>, + k2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.01</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span>, + g <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Logistic.html'>plogis</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fl'>0</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span>, + f_parent_to_m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Logistic.html'>plogis</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fl'>0</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span>, + k_m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.002</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span> + +<span class='va'>ds_biphasic_mean</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='va'>n_biphasic</span>, + <span class='kw'>function</span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>DFOP_SFO</span>, <span class='va'>syn_biphasic_parms</span><span class='op'>[</span><span class='va'>i</span>, <span class='op'>]</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, m1 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, <span class='va'>sampling_times</span><span class='op'>)</span> + <span class='op'>}</span> +<span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456L</span><span class='op'>)</span> +<span class='va'>ds_biphasic</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>ds_biphasic_mean</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>ds</span>, + sdfunc <span class='op'>=</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span><span class='op'>(</span><span class='va'>err_1</span><span class='op'>$</span><span class='va'>const</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>+</span> <span class='va'>value</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>*</span> <span class='va'>err_1</span><span class='op'>$</span><span class='va'>prop</span><span class='op'>^</span><span class='fl'>2</span><span class='op'>)</span>, + n <span class='op'>=</span> <span class='fl'>1</span>, secondary <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span> +<span class='op'>}</span><span class='op'>)</span> + +<span class='co'># \dontrun{</span> +<span class='va'>f_mmkin</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>DFOP_SFO</span><span class='op'>)</span>, <span class='va'>ds_biphasic</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + +<span class='va'>f_mixed</span> <span class='op'><-</span> <span class='fu'>mixed</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_mixed</span><span class='op'>)</span> +</div><div class='output co'>#> Kinetic model fitted by nonlinear regression to each dataset +#> 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 +#> d_m1/dt = + f_parent_to_m1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g) +#> * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) * +#> exp(-k2 * time))) * parent - k_m1 * m1 +#> +#> Data: +#> 271 observations of 2 variable(s) grouped in 8 datasets +#> +#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model 1 2 3 4 5 6 7 8 +#> DFOP-SFO OK OK OK OK OK C OK OK +#> +#> OK: No warnings +#> C: Optimisation did not converge: +#> iteration limit reached without convergence (10) +#> +#> Mean fitted parameters: +#> parent_0 log_k_m1 f_parent_qlogis log_k1 log_k2 +#> 100.606304 -8.759216 -0.002001 -3.350539 -3.989549 +#> g_qlogis +#> -0.090353 </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_mixed</span><span class='op'>)</span> +</div><div class='img'><img src='mixed-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/mkin_long_to_wide.html b/docs/reference/mkin_long_to_wide.html index 7f3e7949..7eca35de 100644 --- a/docs/reference/mkin_long_to_wide.html +++ b/docs/reference/mkin_long_to_wide.html @@ -74,7 +74,7 @@ variable and several dependent variables as columns." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -111,6 +111,9 @@ variable and several dependent variables as columns." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -119,8 +122,8 @@ variable and several dependent variables as columns." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -138,7 +141,7 @@ variable and several dependent variables as columns." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Convert a dataframe from long to wide format</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/mkin_long_to_wide.R'><code>R/mkin_long_to_wide.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkin_long_to_wide.R'><code>R/mkin_long_to_wide.R</code></a></small> <div class="hidden name"><code>mkin_long_to_wide.Rd</code></div> </div> @@ -148,7 +151,7 @@ observed value, and converts it into a dataframe with one independent variable and several dependent variables as columns.</p> </div> - <pre class="usage"><span class='fu'>mkin_long_to_wide</span>(<span class='no'>long_data</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"time"</span>, <span class='kw'>outtime</span> <span class='kw'>=</span> <span class='st'>"time"</span>)</pre> + <pre class="usage"><span class='fu'>mkin_long_to_wide</span><span class='op'>(</span><span class='va'>long_data</span>, time <span class='op'>=</span> <span class='st'>"time"</span>, outtime <span class='op'>=</span> <span class='st'>"time"</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -173,10 +176,14 @@ observed values called "value".</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <p>Dataframe in wide format.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='fu'>mkin_long_to_wide</span>(<span class='no'>FOCUS_2006_D</span>)</div><div class='output co'>#> time parent m1 +<span class='fu'>mkin_long_to_wide</span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span><span class='op'>)</span> +</div><div class='output co'>#> time parent m1 #> 1 0 99.46 0.00 #> 2 0 102.04 0.00 #> 3 1 93.50 4.84 @@ -215,7 +222,7 @@ observed values called "value".</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/mkin_wide_to_long.html b/docs/reference/mkin_wide_to_long.html index a232688c..5df8972f 100644 --- a/docs/reference/mkin_wide_to_long.html +++ b/docs/reference/mkin_wide_to_long.html @@ -74,7 +74,7 @@ mkinfit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -111,6 +111,9 @@ mkinfit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -119,8 +122,8 @@ mkinfit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -138,7 +141,7 @@ mkinfit." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Convert a dataframe with observations over time into long format</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/mkin_wide_to_long.R'><code>R/mkin_wide_to_long.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkin_wide_to_long.R'><code>R/mkin_wide_to_long.R</code></a></small> <div class="hidden name"><code>mkin_wide_to_long.Rd</code></div> </div> @@ -148,7 +151,7 @@ several dependent variable and converts it into the long form as required by <code><a href='mkinfit.html'>mkinfit</a></code>.</p> </div> - <pre class="usage"><span class='fu'>mkin_wide_to_long</span>(<span class='no'>wide_data</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"t"</span>)</pre> + <pre class="usage"><span class='fu'>mkin_wide_to_long</span><span class='op'>(</span><span class='va'>wide_data</span>, time <span class='op'>=</span> <span class='st'>"t"</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -168,11 +171,15 @@ column of observed values.</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <p>Dataframe in long format as needed for <code><a href='mkinfit.html'>mkinfit</a></code>.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='no'>wide</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span>(<span class='kw'>t</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>1</span>,<span class='fl'>2</span>,<span class='fl'>3</span>), <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>1</span>,<span class='fl'>4</span>,<span class='fl'>7</span>), <span class='kw'>y</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>3</span>,<span class='fl'>4</span>,<span class='fl'>5</span>)) -<span class='fu'>mkin_wide_to_long</span>(<span class='no'>wide</span>)</div><div class='output co'>#> name time value +<span class='va'>wide</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span><span class='op'>(</span>t <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span>,<span class='fl'>2</span>,<span class='fl'>3</span><span class='op'>)</span>, x <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span>,<span class='fl'>4</span>,<span class='fl'>7</span><span class='op'>)</span>, y <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>3</span>,<span class='fl'>4</span>,<span class='fl'>5</span><span class='op'>)</span><span class='op'>)</span> +<span class='fu'>mkin_wide_to_long</span><span class='op'>(</span><span class='va'>wide</span><span class='op'>)</span> +</div><div class='output co'>#> name time value #> 1 x 1 1 #> 2 x 2 4 #> 3 x 3 7 @@ -195,7 +202,7 @@ column of observed values.</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/mkinds.html b/docs/reference/mkinds.html index 1fa1bca5..543ea68d 100644 --- a/docs/reference/mkinds.html +++ b/docs/reference/mkinds.html @@ -75,7 +75,7 @@ provided by this package come as mkinds objects nevertheless." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,7 +124,7 @@ provided by this package come as mkinds objects nevertheless." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -153,11 +153,26 @@ such as the on contained in the data field of mkinds objects. Some datasets provided by this package come as mkinds objects nevertheless.</p> </div> + <pre class="usage"><span class='co'># S3 method for mkinds</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, data <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An mkinds object.</p></td> + </tr> + <tr> + <th>data</th> + <td><p>Should the data be printed?</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Not used.</p></td> + </tr> + </table> - - <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> - - <div class='dont-index'><p>The S3 printing method <code><a href='print.mkinds.html'>print.mkinds</a></code></p></div> <h2 class="hasAnchor" id="public-fields"><a class="anchor" href="#public-fields"></a>Public fields</h2> <p><div class="r6-fields"></p><dl> @@ -221,7 +236,8 @@ and value in order to be compatible with mkinfit</p></dd> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>mds</span><span class='op'>)</span> </div><div class='output co'>#> <mkinds> with $title: FOCUS A #> Observed compounds $observed: parent -#> Sampling times $sampling_times: 0, 3, 7, 14, 30, 62, 90, 118 +#> Sampling times $sampling_times: +#> 0, 3, 7, 14, 30, 62, 90, 118 #> With a maximum of 1 replicates</div><div class='input'> </div></pre> </div> diff --git a/docs/reference/mkindsg.html b/docs/reference/mkindsg.html new file mode 100644 index 00000000..74d3a26c --- /dev/null +++ b/docs/reference/mkindsg.html @@ -0,0 +1,460 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>A class for dataset groups for mkin — mkindsg • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="A class for dataset groups for mkin — mkindsg" /> +<meta property="og:description" content="A container for working with datasets that share at least one compound, +so that combined evaluations are desirable. +Time normalisation factors are initialised with a value of 1 for each +dataset if no data are supplied." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>A class for dataset groups for mkin</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkinds.R'><code>R/mkinds.R</code></a></small> + <div class="hidden name"><code>mkindsg.Rd</code></div> + </div> + + <div class="ref-description"> + <p>A container for working with datasets that share at least one compound, +so that combined evaluations are desirable.</p> +<p>Time normalisation factors are initialised with a value of 1 for each +dataset if no data are supplied.</p> + </div> + + <pre class="usage"><span class='co'># S3 method for mkindsg</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, data <span class='op'>=</span> <span class='cn'>FALSE</span>, verbose <span class='op'>=</span> <span class='va'>data</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An mkindsg object.</p></td> + </tr> + <tr> + <th>data</th> + <td><p>Should the mkinds objects be printed with their data?</p></td> + </tr> + <tr> + <th>verbose</th> + <td><p>Should the mkinds objects be printed?</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Not used.</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="public-fields"><a class="anchor" href="#public-fields"></a>Public fields</h2> + + <p><div class="r6-fields"></p><dl> +<dt><code>title</code></dt><dd><p>A title for the dataset group</p></dd> + +<dt><code>ds</code></dt><dd><p>A list of mkinds objects</p></dd> + +<dt><code>observed_n</code></dt><dd><p>Occurrence counts of compounds in datasets</p></dd> + +<dt><code>f_time_norm</code></dt><dd><p>Time normalisation factors</p></dd> + +<dt><code>meta</code></dt><dd><p>A data frame with a row for each dataset, +containing additional information in the form +of categorical data (factors) or numerical data +(e.g. temperature, moisture, +or covariates like soil pH).</p></dd> + +</dl><p></div></p> + <h2 class="hasAnchor" id="methods"><a class="anchor" href="#methods"></a>Methods</h2> + + +<h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Public methods</h3> + +<ul> +<li><p><a href='#method-new'><code>mkindsg$new()</code></a></p></li> +<li><p><a href='#method-clone'><code>mkindsg$clone()</code></a></p></li> +</ul> +<p><hr> +<a id="method-new"></a></p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Method <code>new()</code></h3> +<p>Create a new mkindsg object</p><h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Usage</h4> +<p><div class="r"></p><pre><span class='va'>mkindsg</span><span class='op'>$</span><span class='fu'>new</span><span class='op'>(</span>title <span class='op'>=</span> <span class='st'>""</span>, <span class='va'>ds</span>, f_time_norm <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span><span class='op'>(</span><span class='fl'>1</span>, <span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span><span class='op'>)</span>, <span class='va'>meta</span><span class='op'>)</span></pre><p></div></p> + +<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Arguments</h4> +<p><div class="arguments"></p><dl> +<dt><code>title</code></dt><dd><p>The title</p></dd> + +<dt><code>ds</code></dt><dd><p>A list of mkinds objects</p></dd> + +<dt><code>f_time_norm</code></dt><dd><p>Time normalisation factors</p></dd> + +<dt><code>meta</code></dt><dd><p>The meta data</p></dd> + +</dl><p></div></p> +<p><hr> +<a id="method-clone"></a></p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Method <code>clone()</code></h3> +<p>The objects of this class are cloneable with this method.</p><h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Usage</h4> +<p><div class="r"></p><pre><span class='va'>mkindsg</span><span class='op'>$</span><span class='fu'>clone</span><span class='op'>(</span>deep <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span></pre><p></div></p> + +<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Arguments</h4> +<p><div class="arguments"></p><dl> +<dt><code>deep</code></dt><dd><p>Whether to make a deep clone.</p></dd> + +</dl><p></div></p> + + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'> +<span class='va'>mdsg</span> <span class='op'><-</span> <span class='va'>mkindsg</span><span class='op'>$</span><span class='fu'>new</span><span class='op'>(</span><span class='st'>"Experimental X"</span>, <span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>mdsg</span><span class='op'>)</span> +</div><div class='output co'>#> <mkindsg> holding 5 mkinds objects +#> Title $title: Experimental X +#> Occurrence of observed compounds $observed_n: +#> parent A1 +#> 5 5 </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>mdsg</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <mkindsg> holding 5 mkinds objects +#> Title $title: Experimental X +#> Occurrence of observed compounds $observed_n: +#> parent A1 +#> 5 5 +#> +#> Datasets $ds: +#> <mkinds> with $title: Soil 6 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 3, 6, 10, 20, 34, 55, 90, 112, 132 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> +#> <mkinds> with $title: Soil 7 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 3, 7, 14, 30, 60, 90, 120, 180 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> +#> <mkinds> with $title: Soil 8 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 1, 3, 8, 14, 27, 48, 70 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> +#> <mkinds> with $title: Soil 9 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 1, 3, 8, 14, 27, 48, 70, 91, 120 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> +#> <mkinds> with $title: Soil 10 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 8, 14, 21, 41, 63, 91, 120 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>mdsg</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span>, data <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <mkindsg> holding 5 mkinds objects +#> Title $title: Experimental X +#> Occurrence of observed compounds $observed_n: +#> parent A1 +#> 5 5 +#> +#> Datasets $ds: +#> <mkinds> with $title: Soil 6 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 3, 6, 10, 20, 34, 55, 90, 112, 132 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> time parent A1 +#> 1 0 97.2 NA +#> 2 0 96.4 NA +#> 3 3 71.1 4.3 +#> 4 3 69.2 4.6 +#> 5 6 58.1 7.0 +#> 6 6 56.6 7.2 +#> 7 10 44.4 8.2 +#> 8 10 43.4 8.0 +#> 9 20 33.3 11.0 +#> 10 20 29.2 13.7 +#> 11 34 17.6 11.5 +#> 12 34 18.0 12.7 +#> 13 55 10.5 14.9 +#> 14 55 9.3 14.5 +#> 15 90 4.5 12.1 +#> 16 90 4.7 12.3 +#> 17 112 3.0 9.9 +#> 18 112 3.4 10.2 +#> 19 132 2.3 8.8 +#> 20 132 2.7 7.8 +#> +#> <mkinds> with $title: Soil 7 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 3, 7, 14, 30, 60, 90, 120, 180 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> time parent A1 +#> 1 0 93.6 NA +#> 2 0 92.3 NA +#> 3 3 87.0 3.9 +#> 4 3 82.2 3.1 +#> 5 7 74.0 6.9 +#> 6 7 73.9 6.6 +#> 7 14 64.2 10.4 +#> 8 14 69.5 8.3 +#> 9 30 54.0 14.4 +#> 10 30 54.6 13.7 +#> 11 60 41.1 22.1 +#> 12 60 38.4 22.3 +#> 13 90 32.5 27.5 +#> 14 90 35.5 25.4 +#> 15 120 28.1 28.0 +#> 16 120 29.0 26.6 +#> 17 180 26.5 25.8 +#> 18 180 27.6 25.3 +#> +#> <mkinds> with $title: Soil 8 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 1, 3, 8, 14, 27, 48, 70 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> time parent A1 +#> 1 0 91.9 NA +#> 2 0 90.8 NA +#> 3 1 64.9 9.6 +#> 4 1 66.2 7.7 +#> 5 3 43.5 15.0 +#> 6 3 44.1 15.1 +#> 7 8 18.3 21.2 +#> 8 8 18.1 21.1 +#> 9 14 10.2 19.7 +#> 10 14 10.8 18.9 +#> 11 27 4.9 17.5 +#> 12 27 3.3 15.9 +#> 13 48 1.6 9.5 +#> 14 48 1.5 9.8 +#> 15 70 1.1 6.2 +#> 16 70 0.9 6.1 +#> +#> <mkinds> with $title: Soil 9 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 1, 3, 8, 14, 27, 48, 70, 91, 120 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> time parent A1 +#> 1 0 99.8 NA +#> 2 0 98.3 NA +#> 3 1 77.1 4.2 +#> 4 1 77.2 3.9 +#> 5 3 59.0 7.4 +#> 6 3 58.1 7.9 +#> 7 8 27.4 14.5 +#> 8 8 29.2 13.7 +#> 9 14 19.1 14.2 +#> 10 14 29.6 12.2 +#> 11 27 10.1 13.7 +#> 12 27 18.2 13.2 +#> 13 48 4.5 13.6 +#> 14 48 9.1 15.4 +#> 15 70 2.3 10.4 +#> 16 70 2.9 11.6 +#> 17 91 2.0 10.0 +#> 18 91 1.8 9.5 +#> 19 120 2.0 9.1 +#> 20 120 2.2 9.0 +#> +#> <mkinds> with $title: Soil 10 +#> Observed compounds $observed: parent, A1 +#> Sampling times $sampling_times: +#> 0, 8, 14, 21, 41, 63, 91, 120 +#> With a maximum of 2 replicates +#> Time unit: days +#> Observation unit: \%AR +#> time parent A1 +#> 1 0 96.1 NA +#> 2 0 94.3 NA +#> 3 8 73.9 3.3 +#> 4 8 73.9 3.4 +#> 5 14 69.4 3.9 +#> 6 14 73.1 2.9 +#> 7 21 65.6 6.4 +#> 8 21 65.3 7.2 +#> 9 41 55.9 9.1 +#> 10 41 54.4 8.5 +#> 11 63 47.0 11.7 +#> 12 63 49.3 12.0 +#> 13 91 44.7 13.3 +#> 14 91 46.7 13.2 +#> 15 120 42.1 14.3 +#> 16 120 41.3 12.1</div><div class='input'> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/mkinerrmin.html b/docs/reference/mkinerrmin.html index 10daee93..161eadca 100644 --- a/docs/reference/mkinerrmin.html +++ b/docs/reference/mkinerrmin.html @@ -73,7 +73,7 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -110,6 +110,9 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -118,8 +121,8 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -137,7 +140,7 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Calculate the minimum error to assume in order to pass the variance test</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/mkinerrmin.R'><code>R/mkinerrmin.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkinerrmin.R'><code>R/mkinerrmin.R</code></a></small> <div class="hidden name"><code>mkinerrmin.Rd</code></div> </div> @@ -146,7 +149,7 @@ the chi-squared test as defined in the FOCUS kinetics report from 2006." /> the chi-squared test as defined in the FOCUS kinetics report from 2006.</p> </div> - <pre class="usage"><span class='fu'>mkinerrmin</span>(<span class='no'>fit</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.05</span>)</pre> + <pre class="usage"><span class='fu'>mkinerrmin</span><span class='op'>(</span><span class='va'>fit</span>, alpha <span class='op'>=</span> <span class='fl'>0.05</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -186,18 +189,22 @@ Document Reference Sanco/10058/2005 version 2.0, 434 pp, <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='no'>SFO_SFO</span> <span class='kw'>=</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>), - <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>fit_FOCUS_D</span> <span class='kw'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>round</a></span>(<span class='fu'>mkinerrmin</span>(<span class='no'>fit_FOCUS_D</span>), <span class='fl'>4</span>)</div><div class='output co'>#> err.min n.optim df +<span class='va'>SFO_SFO</span> <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>fit_FOCUS_D</span> <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>round</a></span><span class='op'>(</span><span class='fu'>mkinerrmin</span><span class='op'>(</span><span class='va'>fit_FOCUS_D</span><span class='op'>)</span>, <span class='fl'>4</span><span class='op'>)</span> +</div><div class='output co'>#> err.min n.optim df #> All data 0.0640 4 15 #> parent 0.0646 2 7 #> m1 0.0469 2 8</div><div class='input'><span class='co'># \dontrun{</span> - <span class='no'>fit_FOCUS_E</span> <span class='kw'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_E</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) - <span class='fu'><a href='https://rdrr.io/r/base/Round.html'>round</a></span>(<span class='fu'>mkinerrmin</span>(<span class='no'>fit_FOCUS_E</span>), <span class='fl'>4</span>)</div><div class='output co'>#> err.min n.optim df + <span class='va'>fit_FOCUS_E</span> <span class='op'>=</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_E</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/Round.html'>round</a></span><span class='op'>(</span><span class='fu'>mkinerrmin</span><span class='op'>(</span><span class='va'>fit_FOCUS_E</span><span class='op'>)</span>, <span class='fl'>4</span><span class='op'>)</span> +</div><div class='output co'>#> err.min n.optim df #> All data 0.1544 4 13 #> parent 0.1659 2 7 -#> m1 0.1095 2 6</div><div class='input'># } +#> m1 0.1095 2 6</div><div class='input'><span class='co'># }</span> </div></pre> </div> @@ -215,7 +222,7 @@ Document Reference Sanco/10058/2005 version 2.0, 434 pp, </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/mkinerrplot-1.png b/docs/reference/mkinerrplot-1.png Binary files differindex 8b3240de..bae6071d 100644 --- a/docs/reference/mkinerrplot-1.png +++ b/docs/reference/mkinerrplot-1.png diff --git a/docs/reference/mkinerrplot.html b/docs/reference/mkinerrplot.html index dfbd88be..2509e4c1 100644 --- a/docs/reference/mkinerrplot.html +++ b/docs/reference/mkinerrplot.html @@ -76,7 +76,7 @@ using the argument show_errplot = TRUE." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ using the argument show_errplot = TRUE." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -242,8 +242,8 @@ lines of the mkinfit object.</p></div> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># \dontrun{</span> -<span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='va'>FOCUS_2006_D</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='va'>FOCUS_2006_D</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'>mkinerrplot</span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> </div><div class='img'><img src='mkinerrplot-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> diff --git a/docs/reference/mkinfit-1.png b/docs/reference/mkinfit-1.png Binary files differnew file mode 100644 index 00000000..bbc0ccb6 --- /dev/null +++ b/docs/reference/mkinfit-1.png diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 872b9ab5..4d8aeb40 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -80,7 +80,7 @@ likelihood function." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -129,7 +129,7 @@ likelihood function." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -187,6 +187,7 @@ likelihood function.</p> reweight.tol <span class='op'>=</span> <span class='fl'>1e-08</span>, reweight.max.iter <span class='op'>=</span> <span class='fl'>10</span>, trace_parms <span class='op'>=</span> <span class='cn'>FALSE</span>, + test_residuals <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span> <span class='op'>)</span></pre> @@ -306,12 +307,11 @@ a lower bound for the rates in the optimisation.</p></td> <tr> <th>transform_fractions</th> <td><p>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 <code><a href='ilr.html'>ilr()</a></code> transformation.</p></td> +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 <a href='transform_odeparms.html'>transform_odeparms</a>.</p></td> </tr> <tr> <th>quiet</th> @@ -383,6 +383,10 @@ the error model parameters in IRLS fits.</p></td> <td><p>Should a trace of the parameter values be listed?</p></td> </tr> <tr> + <th>test_residuals</th> + <td><p>Should the residuals be tested for normal distribution?</p></td> + </tr> + <tr> <th>...</th> <td><p>Further arguments that will be passed on to <code><a href='https://rdrr.io/pkg/deSolve/man/ode.html'>deSolve::ode()</a></code>.</p></td> @@ -409,7 +413,8 @@ internal rate transformation.</p> for measurement error in analytical chemistry. <em>Technometrics</em> 37(2), 176-184.</p> <p>Ranke J and Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical Degradation Data. <em>Environments</em> 6(12) 124 -<a href='https://doi.org/10.3390/environments6120124'>doi:10.3390/environments6120124</a>.</p> +doi: <a href='https://doi.org/10.3390/environments6120124'>10.3390/environments6120124</a> +.</p> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <div class='dont-index'><p><a href='summary.mkinfit.html'>summary.mkinfit</a>, <a href='plot.mkinfit.html'>plot.mkinfit</a>, <a href='parms.html'>parms</a> and <a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a>.</p> @@ -426,17 +431,17 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class='co'># Use shorthand notation for parent only degradation</span> <span class='va'>fit</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='va'>FOCUS_2006_C</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> -</div><div class='output co'>#> mkin version used for fitting: 0.9.50.3 +</div><div class='output co'>#> mkin version used for fitting: 1.0.0 #> R version used for fitting: 4.0.3 -#> Date of fit: Thu Oct 15 12:40:10 2020 -#> Date of summary: Thu Oct 15 12:40:10 2020 +#> Date of fit: Wed Feb 3 17:28:58 2021 +#> Date of summary: Wed Feb 3 17:28:58 2021 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 222 model solutions performed in 0.045 s +#> Fitted using 222 model solutions performed in 0.046 s #> #> Error model: Constant variance #> @@ -511,13 +516,13 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class='va'>FOCUS_D</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span> <span class='co'># Use mkinsub for convenience in model formulation. Pathway to sink included per default.</span> <span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># Fit the model quietly to the FOCUS example dataset D using defaults</span> <span class='va'>fit</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='co'># Since mkin 0.9.50.3, we get a warning about non-normality of residuals,</span> -<span class='co'># so we try an alternative error model</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='img'><img src='mkinfit-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># As lower parent values appear to have lower variance, we try an alternative error model</span> <span class='va'>fit.tc</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> <span class='co'># This avoids the warning, and the likelihood ratio test confirms it is preferable</span> <span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>fit.tc</span>, <span class='va'>fit</span><span class='op'>)</span> @@ -531,8 +536,7 @@ Degradation Data. <em>Environments</em> 6(12) 124 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='co'># We can also allow for different variances of parent and metabolite as error model</span> <span class='va'>fit.obs</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span><span class='op'>)</span> -<span class='co'># This also avoids the warning about non-normality, but the two-component error model</span> -<span class='co'># has significantly higher likelihood</span> +<span class='co'># The two-component error model has significantly higher likelihood</span> <span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>fit.obs</span>, <span class='va'>fit.tc</span><span class='op'>)</span> </div><div class='output co'>#> Likelihood ratio test #> @@ -544,9 +548,9 @@ Degradation Data. <em>Environments</em> 6(12) 124 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1</div><div class='input'><span class='fu'><a href='parms.html'>parms</a></span><span class='op'>(</span><span class='va'>fit.tc</span><span class='op'>)</span> </div><div class='output co'>#> parent_0 k_parent k_m1 f_parent_to_m1 sigma_low -#> 1.007343e+02 1.005562e-01 5.166712e-03 5.083933e-01 3.049891e-03 +#> 1.007343e+02 1.005562e-01 5.166712e-03 5.083933e-01 3.049884e-03 #> rsd_high -#> 7.928117e-02 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit.tc</span><span class='op'>)</span> +#> 7.928118e-02 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit.tc</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> parent_m1 parent_sink #> 0.5083933 0.4916067 @@ -554,7 +558,7 @@ Degradation Data. <em>Environments</em> 6(12) 124 #> $distimes #> DT50 DT90 #> parent 6.89313 22.89848 -#> m1 134.15635 445.65776 +#> m1 134.15634 445.65772 #> </div><div class='input'> <span class='co'># We can show a quick (only one replication) benchmark for this case, as we</span> <span class='co'># have several alternative solution methods for the model. We skip</span> @@ -571,33 +575,34 @@ Degradation Data. <em>Environments</em> 6(12) 124 solution_type <span class='op'>=</span> <span class='st'>"analytical"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>}</span> </div><div class='output co'>#> test relative elapsed -#> 3 analytical 1.000 0.752 -#> 1 deSolve_compiled 2.294 1.725 -#> 2 eigen 2.727 2.051</div><div class='input'><span class='co'># }</span> +#> 3 analytical 1.000 0.542 +#> 1 deSolve_compiled 1.812 0.982 +#> 2 eigen 2.234 1.211</div><div class='input'><span class='co'># }</span> <span class='co'># Use stepwise fitting, using optimised parameters from parent only fit, FOMC-SFO</span> <span class='co'># \dontrun{</span> <span class='va'>FOMC_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>fit.FOMC_SFO</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>FOMC_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0499</span></div><div class='input'><span class='co'># Again, we get a warning and try a more sophisticated error model</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fit.FOMC_SFO</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>FOMC_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='co'># Again, we get a warning and try a more sophisticated error model</span> <span class='va'>fit.FOMC_SFO.tc</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>FOMC_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> -<span class='co'># This model has a higher likelihood, but not significantly so</span> +</div><div class='output co'>#> <span class='warning'>Warning: Optimisation did not converge:</span> +#> <span class='warning'>iteration limit reached without convergence (10)</span></div><div class='input'><span class='co'># This model has a higher likelihood, but not significantly so</span> <span class='fu'><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></span><span class='op'>(</span><span class='va'>fit.tc</span>, <span class='va'>fit.FOMC_SFO.tc</span><span class='op'>)</span> </div><div class='output co'>#> Likelihood ratio test #> #> Model 1: FOMC_SFO with error model tc and fixed parameter(s) m1_0 #> Model 2: SFO_SFO with error model tc and fixed parameter(s) m1_0 #> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 7 -64.829 -#> 2 6 -64.983 -1 0.3075 0.5792</div><div class='input'><span class='co'># Also, the missing standard error for log_beta and the t-tests for alpha</span> +#> 1 7 -64.870 +#> 2 6 -64.983 -1 0.2259 0.6346</div><div class='input'><span class='co'># Also, the missing standard error for log_beta and the t-tests for alpha</span> <span class='co'># and beta indicate overparameterisation</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.FOMC_SFO.tc</span>, data <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: NaNs produced</span></div><div class='output co'>#> <span class='warning'>Warning: NaNs produced</span></div><div class='output co'>#> <span class='warning'>Warning: diag(.) had 0 or NA entries; non-finite result is doubtful</span></div><div class='output co'>#> mkin version used for fitting: 0.9.50.3 +</div><div class='output co'>#> <span class='warning'>Warning: NaNs produced</span></div><div class='output co'>#> <span class='warning'>Warning: NaNs produced</span></div><div class='output co'>#> <span class='warning'>Warning: NaNs produced</span></div><div class='output co'>#> <span class='warning'>Warning: diag(.) had 0 or NA entries; non-finite result is doubtful</span></div><div class='output co'>#> mkin version used for fitting: 1.0.0 #> R version used for fitting: 4.0.3 -#> Date of fit: Thu Oct 15 12:40:24 2020 -#> Date of summary: Thu Oct 15 12:40:24 2020 +#> Date of fit: Wed Feb 3 17:29:09 2021 +#> Date of summary: Wed Feb 3 17:29:09 2021 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent @@ -606,7 +611,7 @@ Degradation Data. <em>Environments</em> 6(12) 124 #> #> Model predictions using solution type deSolve #> -#> Fitted using 3611 model solutions performed in 2.669 s +#> Fitted using 4273 model solutions performed in 3.195 s #> #> Error model: Two-component variance function #> @@ -624,80 +629,85 @@ Degradation Data. <em>Environments</em> 6(12) 124 #> rsd_high 0.10 error #> #> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 100.750000 -Inf Inf -#> log_k_m1 -2.302585 -Inf Inf -#> f_parent_ilr_1 0.000000 -Inf Inf -#> log_alpha 0.000000 -Inf Inf -#> log_beta 2.302585 -Inf Inf -#> sigma_low 0.100000 0 Inf -#> rsd_high 0.100000 0 Inf +#> value lower upper +#> parent_0 100.750000 -Inf Inf +#> log_k_m1 -2.302585 -Inf Inf +#> f_parent_qlogis 0.000000 -Inf Inf +#> log_alpha 0.000000 -Inf Inf +#> log_beta 2.302585 -Inf Inf +#> sigma_low 0.100000 0 Inf +#> rsd_high 0.100000 0 Inf #> #> Fixed parameter values: #> value type #> m1_0 0 state #> +#> +#> Warning(s): +#> Optimisation did not converge: +#> iteration limit reached without convergence (10) +#> #> Results: #> -#> AIC BIC logLik -#> 143.658 155.1211 -64.82902 +#> AIC BIC logLik +#> 143.7396 155.2027 -64.86982 #> #> Optimised, transformed parameters with symmetric confidence intervals: -#> Estimate Std. Error Lower Upper -#> parent_0 101.600000 2.6390000 96.240000 107.000000 -#> log_k_m1 -5.284000 0.0928900 -5.473000 -5.095000 -#> f_parent_ilr_1 0.001008 0.0541900 -0.109500 0.111500 -#> log_alpha 5.522000 0.0077300 5.506000 5.538000 -#> log_beta 7.806000 NaN NaN NaN -#> sigma_low 0.002488 0.0002431 0.001992 0.002984 -#> rsd_high 0.079210 0.0093280 0.060180 0.098230 +#> Estimate Std. Error Lower Upper +#> parent_0 1.016e+02 1.90600 97.7400 105.5000 +#> log_k_m1 -5.285e+00 0.09286 -5.4740 -5.0950 +#> f_parent_qlogis 6.482e-04 0.06164 -0.1251 0.1264 +#> log_alpha 5.467e+00 NaN NaN NaN +#> log_beta 7.750e+00 NaN NaN NaN +#> sigma_low 0.000e+00 NaN NaN NaN +#> rsd_high 7.989e-02 NaN NaN NaN #> #> Parameter correlation: -#> parent_0 log_k_m1 f_parent_ilr_1 log_alpha log_beta sigma_low -#> parent_0 1.000000 -0.094697 -0.76654 0.70525 NaN 0.016099 -#> log_k_m1 -0.094697 1.000000 0.51404 -0.14347 NaN 0.001576 -#> f_parent_ilr_1 -0.766543 0.514038 1.00000 -0.61368 NaN 0.015465 -#> log_alpha 0.705247 -0.143468 -0.61368 1.00000 NaN 5.871780 -#> log_beta NaN NaN NaN NaN 1 NaN -#> sigma_low 0.016099 0.001576 0.01546 5.87178 NaN 1.000000 -#> rsd_high 0.006566 -0.011662 -0.05353 0.04845 NaN -0.652554 -#> rsd_high -#> parent_0 0.006566 -#> log_k_m1 -0.011662 -#> f_parent_ilr_1 -0.053525 -#> log_alpha 0.048451 -#> log_beta NaN -#> sigma_low -0.652554 -#> rsd_high 1.000000 +#> parent_0 log_k_m1 f_parent_qlogis log_alpha log_beta +#> parent_0 1.0000000 -0.0002167 -0.6060 NaN NaN +#> log_k_m1 -0.0002167 1.0000000 0.5474 NaN NaN +#> f_parent_qlogis -0.6060320 0.5474423 1.0000 NaN NaN +#> log_alpha NaN NaN NaN 1 NaN +#> log_beta NaN NaN NaN NaN 1 +#> sigma_low NaN NaN NaN NaN NaN +#> rsd_high NaN NaN NaN NaN NaN +#> sigma_low rsd_high +#> parent_0 NaN NaN +#> log_k_m1 NaN NaN +#> f_parent_qlogis NaN NaN +#> log_alpha NaN NaN +#> log_beta NaN NaN +#> sigma_low 1 NaN +#> rsd_high NaN 1 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. #> t-test (unrealistically) based on the assumption of normal distribution #> for estimators of untransformed parameters. #> Estimate t value Pr(>t) Lower Upper -#> parent_0 1.016e+02 32.7800 6.312e-26 9.624e+01 1.070e+02 -#> k_m1 5.072e-03 10.1200 1.216e-11 4.197e-03 6.130e-03 -#> f_parent_to_m1 5.004e-01 20.8300 4.318e-20 4.614e-01 5.394e-01 -#> alpha 2.502e+02 0.5624 2.889e-01 2.463e+02 2.542e+02 -#> beta 2.455e+03 0.5549 2.915e-01 NA NA -#> sigma_low 2.488e-03 0.4843 3.158e-01 1.992e-03 2.984e-03 -#> rsd_high 7.921e-02 8.4300 8.001e-10 6.018e-02 9.823e-02 +#> parent_0 1.016e+02 32.5400 7.812e-26 97.740000 1.055e+02 +#> k_m1 5.069e-03 10.0400 1.448e-11 0.004194 6.126e-03 +#> f_parent_to_m1 5.002e-01 20.7300 5.001e-20 0.468800 5.315e-01 +#> alpha 2.367e+02 0.6205 2.697e-01 NA NA +#> beta 2.322e+03 0.6114 2.727e-01 NA NA +#> sigma_low 0.000e+00 NaN NaN NaN NaN +#> rsd_high 7.989e-02 8.6630 4.393e-10 NaN NaN #> #> FOCUS Chi2 error levels in percent: #> err.min n.optim df -#> All data 6.781 5 14 -#> parent 7.141 3 6 -#> m1 4.640 2 8 +#> All data 6.782 5 14 +#> parent 7.142 3 6 +#> m1 4.639 2 8 #> #> Resulting formation fractions: #> ff -#> parent_m1 0.5004 -#> parent_sink 0.4996 +#> parent_m1 0.5002 +#> parent_sink 0.4998 #> #> Estimated disappearance times: -#> DT50 DT90 DT50back -#> parent 6.812 22.7 6.834 -#> m1 136.661 454.0 NA</div><div class='input'> +#> DT50 DT90 DT50back +#> parent 6.81 22.7 6.833 +#> m1 136.74 454.2 NA</div><div class='input'> <span class='co'># We can easily use starting parameters from the parent only fit (only for illustration)</span> <span class='va'>fit.FOMC</span> <span class='op'>=</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> <span class='va'>fit.FOMC_SFO</span> <span class='op'><-</span> <span class='fu'>mkinfit</span><span class='op'>(</span><span class='va'>FOMC_SFO</span>, <span class='va'>FOCUS_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 7d6bc77b..43e5cc23 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -42,7 +42,11 @@ <meta property="og:title" content="Function to set up a kinetic model with one or more state variables — mkinmod" /> <meta property="og:description" content="This function is usually called using a call to mkinsub() for each observed variable, specifying the corresponding submodel as well as outgoing pathways -(see examples)." /> +(see examples). +Print mkinmod objects in a way that the user finds his way to get to its +components. +This is a convenience function to set up the lists used as arguments for +mkinmod." /> @@ -74,7 +78,7 @@ variable, specifying the corresponding submodel as well as outgoing pathways </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +127,7 @@ variable, specifying the corresponding submodel as well as outgoing pathways <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -141,50 +145,68 @@ variable, specifying the corresponding submodel as well as outgoing pathways <div class="col-md-9 contents"> <div class="page-header"> <h1>Function to set up a kinetic model with one or more state variables</h1> - <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkinmod.R'><code>R/mkinmod.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mkinmod.R'><code>R/mkinmod.R</code></a>, <a href='https://github.com/jranke/mkin/blob/master/R/mkinsub.R'><code>R/mkinsub.R</code></a></small> <div class="hidden name"><code>mkinmod.Rd</code></div> </div> <div class="ref-description"> - <p>This function is usually called using a call to <code><a href='mkinsub.html'>mkinsub()</a></code> for each observed + <p>This function is usually called using a call to <code>mkinsub()</code> for each observed variable, specifying the corresponding submodel as well as outgoing pathways (see examples).</p> +<p>Print mkinmod objects in a way that the user finds his way to get to its +components.</p> +<p>This is a convenience function to set up the lists used as arguments for +<code>mkinmod</code>.</p> </div> <pre class="usage"><span class='fu'>mkinmod</span><span class='op'>(</span> <span class='va'>...</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, + name <span class='op'>=</span> <span class='cn'>NULL</span>, speclist <span class='op'>=</span> <span class='cn'>NULL</span>, quiet <span class='op'>=</span> <span class='cn'>FALSE</span>, - verbose <span class='op'>=</span> <span class='cn'>FALSE</span> -<span class='op'>)</span></pre> + verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, + dll_dir <span class='op'>=</span> <span class='cn'>NULL</span>, + unload <span class='op'>=</span> <span class='cn'>FALSE</span>, + overwrite <span class='op'>=</span> <span class='cn'>FALSE</span> +<span class='op'>)</span> + +<span class='co'># S3 method for mkinmod</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='fu'>mkinsub</span><span class='op'>(</span><span class='va'>submodel</span>, to <span class='op'>=</span> <span class='cn'>NULL</span>, sink <span class='op'>=</span> <span class='cn'>TRUE</span>, full_name <span class='op'>=</span> <span class='cn'>NA</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> <colgroup><col class="name" /><col class="desc" /></colgroup> <tr> <th>...</th> - <td><p>For each observed variable, a list as obtained by <code><a href='mkinsub.html'>mkinsub()</a></code> + <td><p>For each observed variable, a list as obtained by <code>mkinsub()</code> has to be specified as an argument (see examples). Currently, single first order kinetics "SFO", indeterminate order rate equation kinetics "IORE", or single first order with reversible binding "SFORB" are implemented for all variables, while "FOMC", "DFOP", "HS" and "logistic" can additionally be chosen for the first variable which is assumed to be the source compartment. -Additionally, <code><a href='mkinsub.html'>mkinsub()</a></code> has an argument <code>to</code>, specifying names of +Additionally, <code>mkinsub()</code> has an argument <code>to</code>, specifying names of variables to which a transfer is to be assumed in the model. If the argument <code>use_of_ff</code> is set to "min" (default) and the model for the compartment is "SFO" or "SFORB", an -additional <code><a href='mkinsub.html'>mkinsub()</a></code> argument can be <code>sink = FALSE</code>, effectively -fixing the flux to sink to zero.</p></td> +additional <code>mkinsub()</code> argument can be <code>sink = FALSE</code>, effectively +fixing the flux to sink to zero. +In print.mkinmod, this argument is currently not used.</p></td> </tr> <tr> <th>use_of_ff</th> <td><p>Specification of the use of formation fractions in the -model equations and, if applicable, the coefficient matrix. If "min", a -minimum use of formation fractions is made in order to avoid fitting the -product of formation fractions and rate constants. If "max", formation -fractions are always used.</p></td> +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 first-order pathway to a metabolite +has its own rate constant.</p></td> + </tr> + <tr> + <th>name</th> + <td><p>A name for the model. Should be a valid R object name.</p></td> </tr> <tr> <th>speclist</th> @@ -201,6 +223,49 @@ argument. Default is NULL.</p></td> <td><p>If <code>TRUE</code>, passed to <code><a href='https://rdrr.io/pkg/inline/man/cfunction.html'>inline::cfunction()</a></code> if applicable to give detailed information about the C function being built.</p></td> </tr> + <tr> + <th>dll_dir</th> + <td><p>Directory where an DLL object, if generated internally by +<code><a href='https://rdrr.io/pkg/inline/man/cfunction.html'>inline::cfunction()</a></code>, should be saved. The DLL will only be stored in a +permanent location for use in future sessions, if 'dll_dir' and 'name' +are specified.</p></td> + </tr> + <tr> + <th>unload</th> + <td><p>If a DLL from the target location in 'dll_dir' is already +loaded, should that be unloaded first?</p></td> + </tr> + <tr> + <th>overwrite</th> + <td><p>If a file exists at the target DLL location in 'dll_dir', +should this be overwritten?</p></td> + </tr> + <tr> + <th>x</th> + <td><p>An <code>mkinmod</code> object.</p></td> + </tr> + <tr> + <th>submodel</th> + <td><p>Character vector of length one to specify the submodel type. +See <code>mkinmod</code> for the list of allowed submodel names.</p></td> + </tr> + <tr> + <th>to</th> + <td><p>Vector of the names of the state variable to which a +transformation shall be included in the model.</p></td> + </tr> + <tr> + <th>sink</th> + <td><p>Should a pathway to sink be included in the model in addition to +the pathways to other state variables?</p></td> + </tr> + <tr> + <th>full_name</th> + <td><p>An optional name to be used e.g. for plotting fits +performed with the model. You can use non-ASCII characters here, but then +your R code will not be portable, <em>i.e.</em> may produce unintended plot +results on other operating systems or system configurations.</p></td> + </tr> </table> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> @@ -219,6 +284,8 @@ represented by one.</p></dd> <dt>cf</dt><dd><p>If generated, a compiled function calculating the derivatives as returned by cfunction.</p></dd> +A list for use with mkinmod. + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <p>For the definition of model types and their parameters, the equations given @@ -251,23 +318,47 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># Specify the SFO model (this is not needed any more, as we can now mkinfit("SFO", ...)</span> -<span class='va'>SFO</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +<span class='va'>SFO</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># One parent compound, one metabolite, both single first order</span> <span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> + parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span><span class='op'>)</span> +</div><div class='output co'>#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: max +#> Specification $spec: +#> $parent +#> $type: SFO; $to: m1; $sink: TRUE +#> $m1 +#> $type: SFO; $sink: TRUE +#> Coefficient matrix $coefmat available +#> Compiled model $cf available +#> Differential equations: +#> d_parent/dt = - k_parent * parent +#> d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1</div><div class='input'> <span class='co'># \dontrun{</span> -<span class='co'># The above model used to be specified like this, before the advent of mkinsub()</span> -<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> + <span class='va'>fit_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> + <span class='co'># Now supplying compound names used for plotting, and write to user defined location</span> + <span class='co'># We need to choose a path outside the session tempdir because this gets removed</span> + <span class='va'>DLL_dir</span> <span class='op'><-</span> <span class='st'>"~/.local/share/mkin"</span> + <span class='kw'>if</span> <span class='op'>(</span><span class='op'>!</span><span class='fu'><a href='https://rdrr.io/r/base/files2.html'>dir.exists</a></span><span class='op'>(</span><span class='va'>DLL_dir</span><span class='op'>)</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/files2.html'>dir.create</a></span><span class='op'>(</span><span class='va'>DLL_dir</span><span class='op'>)</span> + <span class='va'>SFO_SFO.2</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, full_name <span class='op'>=</span> <span class='st'>"Test compound"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, full_name <span class='op'>=</span> <span class='st'>"Metabolite M1"</span><span class='op'>)</span>, + name <span class='op'>=</span> <span class='st'>"SFO_SFO"</span>, dll_dir <span class='op'>=</span> <span class='va'>DLL_dir</span>, unload <span class='op'>=</span> <span class='cn'>TRUE</span>, overwrite <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Copied DLL from /tmp/Rtmp1BYo7R/file5c60502538f0.so to /home/jranke/.local/share/mkin/SFO_SFO.so</span></div><div class='input'><span class='co'># Now we can save the model and restore it in a new session</span> +<span class='fu'><a href='https://rdrr.io/r/base/readRDS.html'>saveRDS</a></span><span class='op'>(</span><span class='va'>SFO_SFO.2</span>, file <span class='op'>=</span> <span class='st'>"~/SFO_SFO.rds"</span><span class='op'>)</span> +<span class='co'># Terminate the R session here if you would like to check, and then do</span> +<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://pkgdown.jrwb.de/mkin/'>mkin</a></span><span class='op'>)</span> +<span class='va'>SFO_SFO.3</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/readRDS.html'>readRDS</a></span><span class='op'>(</span><span class='st'>"~/SFO_SFO.rds"</span><span class='op'>)</span> +<span class='va'>fit_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.3</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='co'># Show details of creating the C function</span> <span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> Program source: #> 1: #include <R.h> #> 2: @@ -283,11 +374,11 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p> #> 12: } #> 13: #> 14: -#> 15: void func ( int * n, double * t, double * y, double * f, double * rpar, int * ipar ) { +#> 15: void diffs ( int * n, double * t, double * y, double * f, double * rpar, int * ipar ) { #> 16: #> 17: f[0] = - k_parent * y[0]; #> 18: f[1] = + f_parent_to_m1 * k_parent * y[0] - k_m1 * y[1]; -#> 19: }</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> +#> 19: }</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># The symbolic solution which is available in this case is not</span> <span class='co'># made for human reading but for speed of computation</span> <span class='va'>SFO_SFO</span><span class='op'>$</span><span class='va'>deg_func</span> @@ -306,19 +397,19 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p> #> }) #> return(predicted) #> } -#> <environment: 0x55555b726d88></div><div class='input'> +#> <environment: 0x55555caa9ee0></div><div class='input'> <span class='co'># If we have several parallel metabolites</span> <span class='co'># (compare tests/testthat/test_synthetic_data_for_UBA_2014.R)</span> <span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> - parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, - use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>fit_DFOP_par_c</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_par</span>, <span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.000174</span></div><div class='input'><span class='co'># }</span> +<span class='co'># }</span> </div></pre> </div> diff --git a/docs/reference/mkinparplot-1.png b/docs/reference/mkinparplot-1.png Binary files differindex a78bf313..dcf3e4b5 100644 --- a/docs/reference/mkinparplot-1.png +++ b/docs/reference/mkinparplot-1.png diff --git a/docs/reference/mkinparplot.html b/docs/reference/mkinparplot.html index 3aa98dbf..b4d11dcb 100644 --- a/docs/reference/mkinparplot.html +++ b/docs/reference/mkinparplot.html @@ -73,7 +73,7 @@ mkinfit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ mkinfit." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -172,10 +172,10 @@ effect, namely to produce a plot.</p> <pre class="examples"><div class='input'> <span class='co'># \dontrun{</span> <span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> - T245 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"phenol"</span><span class='op'>)</span>, sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, - phenol <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"anisole"</span><span class='op'>)</span><span class='op'>)</span>, - anisole <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>mccall81_245T</span>, <span class='va'>soil</span> <span class='op'>==</span> <span class='st'>"Commerce"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + T245 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"phenol"</span><span class='op'>)</span>, sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + phenol <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"anisole"</span><span class='op'>)</span><span class='op'>)</span>, + anisole <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>mccall81_245T</span>, <span class='va'>soil</span> <span class='op'>==</span> <span class='st'>"Commerce"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'>mkinparplot</span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> </div><div class='img'><img src='mkinparplot-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> </div></pre> diff --git a/docs/reference/mkinplot.html b/docs/reference/mkinplot.html index 166e6b1a..1f0be544 100644 --- a/docs/reference/mkinplot.html +++ b/docs/reference/mkinplot.html @@ -73,7 +73,7 @@ plot.mkinfit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -110,6 +110,9 @@ plot.mkinfit." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -118,8 +121,8 @@ plot.mkinfit." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -137,7 +140,7 @@ plot.mkinfit." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Plot the observed data and the fitted model of an mkinfit object</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/plot.mkinfit.R'><code>R/plot.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/plot.mkinfit.R'><code>R/plot.mkinfit.R</code></a></small> <div class="hidden name"><code>mkinplot.Rd</code></div> </div> @@ -146,7 +149,7 @@ plot.mkinfit." /> <code><a href='plot.mkinfit.html'>plot.mkinfit</a></code>.</p> </div> - <pre class="usage"><span class='fu'>mkinplot</span>(<span class='no'>fit</span>, <span class='no'>...</span>)</pre> + <pre class="usage"><span class='fu'>mkinplot</span><span class='op'>(</span><span class='va'>fit</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -164,6 +167,9 @@ plot.mkinfit." /> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <p>The function is called for its side effect.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -180,7 +186,7 @@ plot.mkinfit." /> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 17f38938..035a21f9 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -74,7 +74,7 @@ kinetic parameters and initial values for the state variables." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ kinetic parameters and initial values for the state variables." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -151,19 +151,7 @@ kinetic model as specified by <code><a href='mkinmod.html'>mkinmod</a></code>, u kinetic parameters and initial values for the state variables.</p> </div> - <pre class="usage"><span class='fu'>mkinpredict</span><span class='op'>(</span> - <span class='va'>x</span>, - <span class='va'>odeparms</span>, - <span class='va'>odeini</span>, - outtimes <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>120</span>, by <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</span>, - solution_type <span class='op'>=</span> <span class='st'>"deSolve"</span>, - use_compiled <span class='op'>=</span> <span class='st'>"auto"</span>, - method.ode <span class='op'>=</span> <span class='st'>"lsoda"</span>, - atol <span class='op'>=</span> <span class='fl'>1e-08</span>, - rtol <span class='op'>=</span> <span class='fl'>1e-10</span>, - map_output <span class='op'>=</span> <span class='cn'>TRUE</span>, - <span class='va'>...</span> -<span class='op'>)</span> + <pre class="usage"><span class='fu'>mkinpredict</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>odeparms</span>, <span class='va'>odeini</span>, <span class='va'>outtimes</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mkinmod</span> <span class='fu'>mkinpredict</span><span class='op'>(</span> @@ -177,6 +165,7 @@ kinetic parameters and initial values for the state variables.</p> atol <span class='op'>=</span> <span class='fl'>1e-08</span>, rtol <span class='op'>=</span> <span class='fl'>1e-10</span>, map_output <span class='op'>=</span> <span class='cn'>TRUE</span>, + na_stop <span class='op'>=</span> <span class='cn'>TRUE</span>, <span class='va'>...</span> <span class='op'>)</span> @@ -222,6 +211,11 @@ observed variables, for example in the case of the SFORB model.</p></td> predictions should be generated.</p></td> </tr> <tr> + <th>...</th> + <td><p>Further arguments passed to the ode solver in case such a +solver is used.</p></td> + </tr> + <tr> <th>solution_type</th> <td><p>The method that should be used for producing the predictions. This should generally be "analytical" if there is only one @@ -258,9 +252,8 @@ FALSE). Setting this to FALSE has no effect for analytical solutions, as these always return mapped output.</p></td> </tr> <tr> - <th>...</th> - <td><p>Further arguments passed to the ode solver in case such a -solver is used.</p></td> + <th>na_stop</th> + <td><p>Should it be an error if deSolve::ode returns NaN values</p></td> </tr> </table> @@ -273,7 +266,7 @@ solver is used.</p></td> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='va'>SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>degradinol <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +<span class='va'>SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>degradinol <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># Compare solution types</span> <span class='fu'>mkinpredict</span><span class='op'>(</span><span class='va'>SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_degradinol <span class='op'>=</span> <span class='fl'>0.3</span><span class='op'>)</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>degradinol <span class='op'>=</span> <span class='fl'>100</span><span class='op'>)</span>, <span class='fl'>0</span><span class='op'>:</span><span class='fl'>20</span>, solution_type <span class='op'>=</span> <span class='st'>"analytical"</span><span class='op'>)</span> @@ -395,7 +388,7 @@ solver is used.</p></td> <span class='co'># Comparison of the performance of solution types</span> <span class='va'>SFO_SFO</span> <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='kw'>if</span><span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='va'><a href='http://rbenchmark.googlecode.com'>rbenchmark</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='kw'>if</span><span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='va'><a href='http://rbenchmark.googlecode.com'>rbenchmark</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='fu'><a href='https://rdrr.io/pkg/rbenchmark/man/benchmark.html'>benchmark</a></span><span class='op'>(</span>replications <span class='op'>=</span> <span class='fl'>10</span>, order <span class='op'>=</span> <span class='st'>"relative"</span>, columns <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"test"</span>, <span class='st'>"relative"</span>, <span class='st'>"elapsed"</span><span class='op'>)</span>, eigen <span class='op'>=</span> <span class='fu'>mkinpredict</span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='fl'>0.15</span>, f_parent_to_m1 <span class='op'>=</span> <span class='fl'>0.5</span>, k_m1 <span class='op'>=</span> <span class='fl'>0.01</span><span class='op'>)</span>, @@ -415,10 +408,10 @@ solver is used.</p></td> solution_type <span class='op'>=</span> <span class='st'>"analytical"</span>, use_compiled <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span><span class='op'>[</span><span class='fl'>201</span>,<span class='op'>]</span><span class='op'>)</span> <span class='op'>}</span> </div><div class='output co'>#> test relative elapsed +#> 2 deSolve_compiled 1.0 0.005 #> 4 analytical 1.0 0.005 -#> 2 deSolve_compiled 1.2 0.006 #> 1 eigen 4.0 0.020 -#> 3 deSolve 45.6 0.228</div><div class='input'> +#> 3 deSolve 44.6 0.223</div><div class='input'> <span class='co'># \dontrun{</span> <span class='co'># Predict from a fitted model</span> <span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_C</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> @@ -426,11 +419,11 @@ solver is used.</p></td> <span class='fu'><a href='https://rdrr.io/r/utils/head.html'>head</a></span><span class='op'>(</span><span class='fu'>mkinpredict</span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span><span class='op'>)</span> </div><div class='output co'>#> time parent m1 #> 0 0.0 82.49216 0.000000 -#> 0.1 0.1 80.00562 1.236198 -#> 0.2 0.2 77.59404 2.422818 -#> 0.3 0.3 75.25514 3.561476 -#> 0.4 0.4 72.98675 4.653740 -#> 0.5 0.5 70.78673 5.701130</div><div class='input'><span class='co'># }</span> +#> 0.1 0.1 80.00562 1.236394 +#> 0.2 0.2 77.59404 2.423201 +#> 0.3 0.3 75.25514 3.562040 +#> 0.4 0.4 72.98675 4.654478 +#> 0.5 0.5 70.78673 5.702033</div><div class='input'><span class='co'># }</span> </div></pre> </div> diff --git a/docs/reference/mkinresplot-1.png b/docs/reference/mkinresplot-1.png Binary files differindex 8114b6cd..ffd34f6f 100644 --- a/docs/reference/mkinresplot-1.png +++ b/docs/reference/mkinresplot-1.png diff --git a/docs/reference/mkinresplot.html b/docs/reference/mkinresplot.html index d917860a..a9638c93 100644 --- a/docs/reference/mkinresplot.html +++ b/docs/reference/mkinresplot.html @@ -75,7 +75,7 @@ argument show_residuals = TRUE." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,7 +124,7 @@ argument show_residuals = TRUE." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -246,9 +246,9 @@ combining the plot of the fit and the residual plot.</p></div> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='fu'>mkinresplot</span><span class='op'>(</span><span class='va'>fit</span>, <span class='st'>"m1"</span><span class='op'>)</span> +<span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'>mkinresplot</span><span class='op'>(</span><span class='va'>fit</span>, <span class='st'>"m1"</span><span class='op'>)</span> </div><div class='img'><img src='mkinresplot-1.png' alt='' width='700' height='433' /></div><div class='input'> </div></pre> </div> diff --git a/docs/reference/mmkin-1.png b/docs/reference/mmkin-1.png Binary files differindex c8f79dcb..cce02aed 100644 --- a/docs/reference/mmkin-1.png +++ b/docs/reference/mmkin-1.png diff --git a/docs/reference/mmkin-2.png b/docs/reference/mmkin-2.png Binary files differindex 5dd60e1c..4f2529fa 100644 --- a/docs/reference/mmkin-2.png +++ b/docs/reference/mmkin-2.png diff --git a/docs/reference/mmkin-3.png b/docs/reference/mmkin-3.png Binary files differindex 9351ca24..fb5d4470 100644 --- a/docs/reference/mmkin-3.png +++ b/docs/reference/mmkin-3.png diff --git a/docs/reference/mmkin-4.png b/docs/reference/mmkin-4.png Binary files differindex 69bd6e50..4f11753e 100644 --- a/docs/reference/mmkin-4.png +++ b/docs/reference/mmkin-4.png diff --git a/docs/reference/mmkin-5.png b/docs/reference/mmkin-5.png Binary files differindex c1c05eea..5d653de9 100644 --- a/docs/reference/mmkin-5.png +++ b/docs/reference/mmkin-5.png diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 7a01313f..20134030 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -75,7 +75,7 @@ datasets specified in its first two arguments." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,7 +124,7 @@ datasets specified in its first two arguments." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -155,7 +155,7 @@ datasets specified in its first two arguments.</p> <pre class="usage"><span class='fu'>mmkin</span><span class='op'>(</span> models <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>datasets</span>, - cores <span class='op'>=</span> <span class='fu'>detectCores</span><span class='op'>(</span><span class='op'>)</span>, + cores <span class='op'>=</span> <span class='fu'>parallel</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span><span class='op'>(</span><span class='op'>)</span>, cluster <span class='op'>=</span> <span class='cn'>NULL</span>, <span class='va'>...</span> <span class='op'>)</span></pre> @@ -210,37 +210,36 @@ plotting.</p></div> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># \dontrun{</span> -<span class='va'>m_synth_SFO_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='va'>m_synth_FOMC_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> +<span class='va'>m_synth_SFO_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>m_synth_FOMC_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='va'>models</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>SFO_lin <span class='op'>=</span> <span class='va'>m_synth_SFO_lin</span>, FOMC_lin <span class='op'>=</span> <span class='va'>m_synth_FOMC_lin</span><span class='op'>)</span> <span class='va'>datasets</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>datasets</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>)</span> <span class='va'>time_default</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>fits.0</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='va'>models</span>, <span class='va'>datasets</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> <span class='va'>time_1</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>fits.4</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='va'>models</span>, <span class='va'>datasets</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Optimisation did not converge:</span> -#> <span class='warning'>false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0117</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0174</span></div><div class='input'> + <span class='va'>time_default</span> </div><div class='output co'>#> user system elapsed -#> 4.828 0.413 1.467 </div><div class='input'><span class='va'>time_1</span> +#> 4.869 0.357 1.415 </div><div class='input'><span class='va'>time_1</span> </div><div class='output co'>#> user system elapsed -#> 5.228 0.000 5.231 </div><div class='input'> +#> 5.502 0.002 5.507 </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[[</span><span class='st'>"SFO_lin"</span>, <span class='fl'>2</span><span class='op'>]</span><span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> parent_M1 parent_sink M1_M2 M1_sink -#> 0.7340478 0.2659522 0.7505691 0.2494309 +#> 0.7340478 0.2659522 0.7505687 0.2494313 #> #> $distimes -#> DT50 DT90 -#> parent 0.8777688 2.915885 -#> M1 2.3257466 7.725963 -#> M2 33.7200800 112.015681 +#> DT50 DT90 +#> parent 0.877769 2.915885 +#> M1 2.325746 7.725960 +#> M2 33.720083 112.015691 #> </div><div class='input'> <span class='co'># plot.mkinfit handles rows or columns of mmkin result objects</span> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[</span><span class='fl'>1</span>, <span class='op'>]</span><span class='op'>)</span> @@ -253,7 +252,29 @@ plotting.</p></div> <span class='co'># Plotting with mmkin (single brackets, extracting an mmkin object) does not</span> <span class='co'># allow to plot the observed variables separately</span> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[</span><span class='fl'>1</span>, <span class='fl'>1</span><span class='op'>]</span><span class='op'>)</span> -</div><div class='img'><img src='mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> +</div><div class='img'><img src='mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'> +<span class='co'># On Windows, we can use multiple cores by making a cluster using the parallel</span> +<span class='co'># package, which gets loaded with mkin, and passing it to mmkin, e.g.</span> +<span class='va'>cl</span> <span class='op'><-</span> <span class='fu'>makePSOCKcluster</span><span class='op'>(</span><span class='fl'>12</span><span class='op'>)</span> +<span class='va'>f</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>A <span class='op'>=</span> <span class='va'>FOCUS_2006_A</span>, B <span class='op'>=</span> <span class='va'>FOCUS_2006_B</span>, C <span class='op'>=</span> <span class='va'>FOCUS_2006_C</span>, D <span class='op'>=</span> <span class='va'>FOCUS_2006_D</span><span class='op'>)</span>, + cluster <span class='op'>=</span> <span class='va'>cl</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> +</div><div class='output co'>#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model A B C D +#> SFO OK OK OK OK +#> FOMC C OK OK OK +#> DFOP OK OK OK OK +#> +#> OK: No warnings +#> C: Optimisation did not converge: +#> false convergence (8)</div><div class='input'><span class='co'># We get false convergence for the FOMC fit to FOCUS_2006_A because this</span> +<span class='co'># dataset is really SFO, and the FOMC fit is overparameterised</span> +<span class='fu'>stopCluster</span><span class='op'>(</span><span class='va'>cl</span><span class='op'>)</span> +<span class='co'># }</span> </div></pre> </div> diff --git a/docs/reference/nafta-1.png b/docs/reference/nafta-1.png Binary files differindex 4593158c..76d724f0 100644 --- a/docs/reference/nafta-1.png +++ b/docs/reference/nafta-1.png diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html index 9630e230..c6c1b173 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -76,7 +76,7 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -218,7 +218,7 @@ list element "data" contains the dataset used in the fits.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='va'>nafta_evaluation</span> <span class='op'><-</span> <span class='fu'>nafta</span><span class='op'>(</span><span class='va'>NAFTA_SOP_Appendix_D</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00192</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00258</span></div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding</span></div><div class='output co'>#> <span class='message'>to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The representative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>nafta_evaluation</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding</span></div><div class='output co'>#> <span class='message'>to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The representative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>nafta_evaluation</span><span class='op'>)</span> </div><div class='output co'>#> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png Binary files differindex 193722c7..82b952f7 100644 --- a/docs/reference/nlme-1.png +++ b/docs/reference/nlme-1.png diff --git a/docs/reference/nlme-2.png b/docs/reference/nlme-2.png Binary files differnew file mode 100644 index 00000000..6bc121d1 --- /dev/null +++ b/docs/reference/nlme-2.png diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index 4e61a08b..f9e68b7f 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -75,7 +75,7 @@ datasets. They are used internally by the nlme.mmkin() method." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,7 +124,7 @@ datasets. They are used internally by the nlme.mmkin() method." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -186,7 +186,7 @@ nlme for the case of a single grouping variable ds.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> -<span class='va'>m_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +<span class='va'>m_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> <span class='va'>d_SFO_1</span> <span class='op'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>98</span><span class='op'>)</span>, <span class='va'>sampling_times</span><span class='op'>)</span> @@ -215,7 +215,7 @@ nlme for the case of a single grouping variable ds.</p> <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span><span class='op'>(</span><span class='st'>"nlme_f"</span>, <span class='va'>nlme_f</span>, <span class='fu'><a href='https://rdrr.io/r/base/environment.html'>globalenv</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span><span class='op'>(</span><span class='st'>"grouped_data"</span>, <span class='va'>grouped_data</span>, <span class='fu'><a href='https://rdrr.io/r/base/environment.html'>globalenv</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> -<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme'>nlme</a></span><span class='op'>)</span> +<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span> <span class='va'>m_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'>nlme_f</span><span class='op'>(</span><span class='va'>name</span>, <span class='va'>time</span>, <span class='va'>parent_0</span>, <span class='va'>log_k_parent_sink</span><span class='op'>)</span>, data <span class='op'>=</span> <span class='va'>grouped_data</span>, fixed <span class='op'>=</span> <span class='va'>parent_0</span> <span class='op'>+</span> <span class='va'>log_k_parent_sink</span> <span class='op'>~</span> <span class='fl'>1</span>, @@ -224,35 +224,38 @@ nlme for the case of a single grouping variable ds.</p> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>m_nlme</span><span class='op'>)</span> </div><div class='output co'>#> Nonlinear mixed-effects model fit by maximum likelihood #> Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) -#> Data: grouped_data +#> Data: grouped_data #> AIC BIC logLik -#> 252.7798 262.1358 -121.3899 +#> 300.6824 310.2426 -145.3412 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1) #> Level: ds #> Structure: Diagonal -#> parent_0 log_k_parent_sink Residual -#> StdDev: 0.0006768135 0.6800777 2.489397 +#> parent_0 log_k_parent_sink Residual +#> StdDev: 1.697361 0.6801209 3.666073 #> -#> Fixed effects: parent_0 + log_k_parent_sink ~ 1 -#> Value Std.Error DF t-value p-value -#> parent_0 101.74884 0.6456014 44 157.60321 0 -#> log_k_parent_sink -3.05575 0.4015811 44 -7.60929 0 +#> Fixed effects: parent_0 + log_k_parent_sink ~ 1 +#> Value Std.Error DF t-value p-value +#> parent_0 100.99378 1.3890416 46 72.70753 0 +#> log_k_parent_sink -3.07521 0.4018589 46 -7.65246 0 #> Correlation: #> prnt_0 -#> log_k_parent_sink 0.026 +#> log_k_parent_sink 0.027 #> #> Standardized Within-Group Residuals: #> Min Q1 Med Q3 Max -#> -2.1317488 -0.6878121 0.0828385 0.8592270 2.9529864 +#> -1.9942823 -0.5622565 0.1791579 0.7165038 2.0704781 #> -#> Number of Observations: 48 +#> Number of Observations: 50 #> Number of Groups: 3 </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/pkg/nlme/man/augPred.html'>augPred</a></span><span class='op'>(</span><span class='va'>m_nlme</span>, level <span class='op'>=</span> <span class='fl'>0</span><span class='op'>:</span><span class='fl'>1</span><span class='op'>)</span>, layout <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fl'>1</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='img'><img src='nlme-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># augPred does not seem to work on fits with more than one state</span> +</div><div class='img'><img src='nlme-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># augPred does not work on fits with more than one state</span> <span class='co'># variable</span> - -</div></pre> +<span class='co'>#</span> +<span class='co'># The procedure is greatly simplified by the nlme.mmkin function</span> +<span class='va'>f_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> +</div><div class='img'><img src='nlme-2.png' alt='' width='700' height='433' /></div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> diff --git a/docs/reference/nlme.mmkin-1.png b/docs/reference/nlme.mmkin-1.png Binary files differindex 564f7e2b..546a3731 100644 --- a/docs/reference/nlme.mmkin-1.png +++ b/docs/reference/nlme.mmkin-1.png diff --git a/docs/reference/nlme.mmkin-2.png b/docs/reference/nlme.mmkin-2.png Binary files differindex a9ce4636..7b5b4ab0 100644 --- a/docs/reference/nlme.mmkin-2.png +++ b/docs/reference/nlme.mmkin-2.png diff --git a/docs/reference/nlme.mmkin.html b/docs/reference/nlme.mmkin.html index af3b712c..dd1670fe 100644 --- a/docs/reference/nlme.mmkin.html +++ b/docs/reference/nlme.mmkin.html @@ -74,7 +74,7 @@ have been obtained by fitting the same model to a list of datasets." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ have been obtained by fitting the same model to a list of datasets." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -154,11 +154,12 @@ have been obtained by fitting the same model to a list of datasets.</p> <pre class="usage"><span class='co'># S3 method for mmkin</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span> <span class='va'>model</span>, - data <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.frame</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.parent</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>, - <span class='va'>fixed</span>, - random <span class='op'>=</span> <span class='va'>fixed</span>, + data <span class='op'>=</span> <span class='st'>"auto"</span>, + fixed <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>as.list</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='fu'><a href='nlme_function.html'>mean_degparms</a></span><span class='op'>(</span><span class='va'>model</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>el</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/eval.html'>eval</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/parse.html'>parse</a></span><span class='op'>(</span>text <span class='op'>=</span> + <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='va'>el</span>, <span class='fl'>1</span>, sep <span class='op'>=</span> <span class='st'>"~"</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>, + random <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/pdDiag.html'>pdDiag</a></span><span class='op'>(</span><span class='va'>fixed</span><span class='op'>)</span>, <span class='va'>groups</span>, - <span class='va'>start</span>, + start <span class='op'>=</span> <span class='fu'><a href='nlme_function.html'>mean_degparms</a></span><span class='op'>(</span><span class='va'>model</span>, random <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, correlation <span class='op'>=</span> <span class='cn'>NULL</span>, weights <span class='op'>=</span> <span class='cn'>NULL</span>, <span class='va'>subset</span>, @@ -170,7 +171,7 @@ have been obtained by fitting the same model to a list of datasets.</p> <span class='op'>)</span> <span class='co'># S3 method for nlme.mmkin</span> -<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for nlme.mmkin</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre> @@ -180,7 +181,7 @@ have been obtained by fitting the same model to a list of datasets.</p> <colgroup><col class="name" /><col class="desc" /></colgroup> <tr> <th>model</th> - <td><p>An <code><a href='mmkin.html'>mmkin</a></code> row object.</p></td> + <td><p>An <a href='mmkin.html'>mmkin</a> row object.</p></td> </tr> <tr> <th>data</th> @@ -193,8 +194,10 @@ mmkin model are used as fixed parameters</p></td> </tr> <tr> <th>random</th> - <td><p>If not specified, all fixed effects are complemented -with uncorrelated random effects</p></td> + <td><p>If not specified, correlated random effects are set up +for all optimised degradation model parameters using the log-Cholesky +parameterization <a href='https://rdrr.io/pkg/nlme/man/pdLogChol.html'>nlme::pdLogChol</a> that is also the default of +the generic <a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a> method.</p></td> </tr> <tr> <th>groups</th> @@ -242,6 +245,10 @@ parameters taken from the mmkin object are used</p></td> <td><p>An nlme.mmkin object to print</p></td> </tr> <tr> + <th>digits</th> + <td><p>Number of digits to use for printing</p></td> + </tr> + <tr> <th>...</th> <td><p>Update specifications passed to update.nlme</p></td> </tr> @@ -253,183 +260,91 @@ parameters taken from the mmkin object are used</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> - <p>Upon success, a fitted nlme.mmkin object, which is an nlme object -with additional elements</p> + <p>Upon success, a fitted 'nlme.mmkin' object, which is an nlme object +with additional elements. It also inherits from 'mixed.mmkin'.</p> + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2> + + <p>As the object inherits from <a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme::nlme</a>, there is a wealth of +methods that will automatically work on 'nlme.mmkin' objects, such as +<code><a href='https://rdrr.io/pkg/nlme/man/intervals.html'>nlme::intervals()</a></code>, <code><a href='https://rdrr.io/pkg/nlme/man/anova.lme.html'>nlme::anova.lme()</a></code> and <code><a href='https://rdrr.io/pkg/nlme/man/coef.lme.html'>nlme::coef.lme()</a></code>.</p> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> - <div class='dont-index'><p><code><a href='nlme_function.html'>nlme_function</a></code></p></div> + <div class='dont-index'><p><code><a href='nlme_function.html'>nlme_function()</a></code>, <a href='plot.mixed.mmkin.html'>plot.mixed.mmkin</a>, <a href='summary.nlme.mmkin.html'>summary.nlme.mmkin</a></p></div> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='va'>ds</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span>, <span class='va'>name</span> <span class='op'>==</span> <span class='st'>"parent"</span><span class='op'>)</span><span class='op'>)</span> -<span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0195</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.011</span></div><div class='input'><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme'>nlme</a></span><span class='op'>)</span> -<span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> $distimes -#> DT50 DT90 -#> parent 11.96183 39.73634 -#> </div><div class='input'><span class='va'>f_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> -<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> -</div><div class='output co'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent) -#> Data: "Not shown" -#> Log-likelihood: -307.5269 -#> Fixed: list(parent_0 ~ 1, log_k_parent ~ 1) -#> parent_0 log_k_parent -#> 85.541149 -3.229596 +<span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> +<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span> +<span class='va'>f_nlme_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> + +<span class='co'># \dontrun{</span> + + <span class='va'>f_nlme_dfop</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_dfop</span><span class='op'>)</span> +</div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value +#> f_nlme_sfo 1 5 625.0539 637.5529 -307.5269 +#> f_nlme_dfop 2 9 495.1270 517.6253 -238.5635 1 vs 2 137.9268 <.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood +#> +#> 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 +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -238.6 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) +#> parent_0 log_k1 log_k2 g_qlogis +#> 94.1702 -1.8002 -4.1474 0.0324 #> #> Random effects: -#> Formula: list(parent_0 ~ 1, log_k_parent ~ 1) +#> Formula: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) #> Level: ds #> Structure: Diagonal -#> parent_0 log_k_parent Residual -#> StdDev: 1.30857 1.288591 6.304906 -#> -#> Number of Observations: 90 -#> Number of Groups: 5 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> +#> parent_0 log_k1 log_k2 g_qlogis Residual +#> StdDev: 2.488 0.8447 1.33 0.4652 2.321 +#> </div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> +</div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> </div><div class='output co'>#> $distimes -#> DT50 DT90 -#> parent 17.51545 58.18505 -#> </div><div class='input'><span class='co'># \dontrun{</span> - <span class='va'>f_nlme_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span>, start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, log_k_parent_sink <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</span><span class='op'>)</span> - <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_nlme_2</span>, random <span class='op'>=</span> <span class='va'>parent_0</span> <span class='op'>~</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent) -#> Data: "Not shown" -#> Log-likelihood: -404.3729 -#> Fixed: list(parent_0 ~ 1, log_k_parent ~ 1) -#> parent_0 log_k_parent -#> 75.933480 -3.555983 -#> -#> Random effects: -#> Formula: parent_0 ~ 1 | ds -#> parent_0 Residual -#> StdDev: 0.002416792 21.63027 -#> -#> Number of Observations: 90 -#> Number of Groups: 5 </div><div class='input'> <span class='co'># Test on some real data</span> +#> DT50 DT90 DT50back DT50_k1 DT50_k2 +#> parent 10.79857 100.7937 30.34192 4.193937 43.85442 +#> </div><div class='input'> <span class='va'>ds_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span> - <span class='va'>m_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, - A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> - <span class='va'>m_sfo_sfo_ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, - A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> - <span class='va'>m_fomc_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, - A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> - <span class='va'>m_dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, - A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='va'>m_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='va'>m_sfo_sfo_ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='va'>m_dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_2</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>, <span class='st'>"SFO-SFO-ff"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo_ff</span>, - <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>m_fomc_sfo</span>, <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>, <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> - <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> <span class='co'># Separate fits for datasets 3 and 4</span> -</div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'> + <span class='va'>f_nlme_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> - <span class='co'># plot(f_nlme_sfo_sfo) # not feasible with pkgdown figures</span> - <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># Global mixed model: Fits for datasets 3 and 4</span> + <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> </div><div class='img'><img src='nlme.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'> - <span class='co'># With formation fractions</span> - <span class='va'>f_nlme_sfo_sfo_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO-ff"</span>, <span class='op'>]</span><span class='op'>)</span> - <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_ff</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># chi2 different due to different df attribution</span> -</div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'> - <span class='co'># For more parameters, we need to increase pnlsMaxIter and the tolerance</span> - <span class='co'># to get convergence</span> - <span class='va'>f_nlme_fomc_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='op'>]</span>, - control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>100</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> -#> **Iteration 1 -#> LME step: Loglik: -394.1603, nlminb iterations: 3 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 -#> -0.2079793 0.8563830 1.7454105 1.0917354 1.2756825 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.8803 -#> fixed effects: 94.17379 -5.473193 -0.6970236 -0.2025091 2.103883 -#> iterations: 100 -#> Convergence crit. (must all become <= tolerance = 0.0001): -#> fixed reStruct -#> 0.7960134 0.1447728 -#> -#> **Iteration 2 -#> LME step: Loglik: -396.3824, nlminb iterations: 7 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 -#> -1.712404e-01 -2.432655e-05 1.842120e+00 1.073975e+00 1.322925e+00 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.8035 -#> fixed effects: 94.17385 -5.473487 -0.6970404 -0.2025137 2.103871 -#> iterations: 100 -#> Convergence crit. (must all become <= tolerance = 0.0001): -#> fixed reStruct -#> 5.382757e-05 1.236667e-03 -#> -#> **Iteration 3 -#> LME step: Loglik: -396.3825, nlminb iterations: 7 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 -#> -0.1712499044 -0.0001499831 1.8420971364 1.0739799123 1.3229167796 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.7948 -#> fixed effects: 94.17386 -5.473521 -0.6970422 -0.2025144 2.10387 -#> iterations: 100 -#> Convergence crit. (must all become <= tolerance = 0.0001): -#> fixed reStruct -#> 6.072817e-06 1.400857e-04 -#> -#> **Iteration 4 -#> LME step: Loglik: -396.3825, nlminb iterations: 7 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 -#> -0.1712529502 -0.0001641277 1.8420957542 1.0739797181 1.3229173076 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.7936 -#> fixed effects: 94.17386 -5.473526 -0.6970426 -0.2025146 2.103869 -#> iterations: 100 -#> Convergence crit. (must all become <= tolerance = 0.0001): -#> fixed reStruct -#> 1.027451e-06 2.275704e-05 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span>, - control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>120</span>, tolerance <span class='op'>=</span> <span class='fl'>5e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> -#> **Iteration 1 -#> LME step: Loglik: -404.9582, nlminb iterations: 1 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 ds6 -#> -0.4114355 0.9798697 1.6990037 0.7293315 0.3354323 1.7113046 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 630.3644 -#> fixed effects: 93.82269 -5.455991 -0.6788957 -1.862196 -4.199671 0.05532828 -#> iterations: 120 -#> Convergence crit. (must all become <= tolerance = 0.0005): -#> fixed reStruct -#> 0.7885368 0.5822683 -#> -#> **Iteration 2 -#> LME step: Loglik: -407.7755, nlminb iterations: 11 -#> reStruct parameters: -#> ds1 ds2 ds3 ds4 ds5 ds6 -#> -0.371224133 0.003056179 1.789939402 0.724671158 0.301602977 1.754200729 -#> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 630.3633 -#> fixed effects: 93.82269 -5.455992 -0.6788958 -1.862196 -4.199671 0.05532831 -#> iterations: 120 -#> Convergence crit. (must all become <= tolerance = 0.0005): -#> fixed reStruct -#> 4.789774e-07 2.200661e-05 </div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> -</div><div class='img'><img src='nlme.mmkin-4.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_fomc_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> -</div><div class='img'><img src='nlme.mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'> - <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> -</div><div class='img'><img src='nlme.mmkin-6.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> -</div><div class='img'><img src='nlme.mmkin-7.png' alt='' width='700' height='433' /></div><div class='input'> - <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_fomc_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> -</div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273 -#> f_nlme_fomc_sfo 2 11 818.5149 853.0087 -398.2575 1 vs 2 21.33975 <.0001 -#> f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716 <.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> <span class='co'># if we ignore FOMC</span> -</div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273 -#> f_nlme_sfo_sfo 2 9 1085.1821 1113.4043 -533.5910 1 vs 2 249.3274 <.0001</div><div class='input'> + <span class='co'># With formation fractions this does not coverge with defaults</span> + <span class='co'># f_nlme_sfo_sfo_ff <- nlme(f_2["SFO-SFO-ff", ])</span> + <span class='co'>#plot(f_nlme_sfo_sfo_ff)</span> + + <span class='co'># With the log-Cholesky parameterization, this converges in 11</span> + <span class='co'># iterations and around 100 seconds, but without tweaking control</span> + <span class='co'># parameters (with pdDiag, increasing the tolerance and pnlsMaxIter was</span> + <span class='co'># necessary)</span> + <span class='va'>f_nlme_dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in nlme.formula(model = value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_A1, f_parent_qlogis, log_k1, log_k2, g_qlogis), data = structure(list(ds = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L ), .Label = c("1", "2", "3", "4", "5"), class = c("ordered", "factor")), name = c("parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1"), time = c(0, 0, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 0, 0, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 0, 0, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120), value = c(97.2, 96.4, 71.1, 69.2, 58.1, 56.6, 44.4, 43.4, 33.3, 29.2, 17.6, 18, 10.5, 9.3, 4.5, 4.7, 3, 3.4, 2.3, 2.7, 4.3, 4.6, 7, 7.2, 8.2, 8, 11, 13.7, 11.5, 12.7, 14.9, 14.5, 12.1, 12.3, 9.9, 10.2, 8.8, 7.8, 93.6, 92.3, 87, 82.2, 74, 73.9, 64.2, 69.5, 54, 54.6, 41.1, 38.4, 32.5, 35.5, 28.1, 29, 26.5, 27.6, 3.9, 3.1, 6.9, 6.6, 10.4, 8.3, 14.4, 13.7, 22.1, 22.3, 27.5, 25.4, 28, 26.6, 25.8, 25.3, 91.9, 90.8, 64.9, 66.2, 43.5, 44.1, 18.3, 18.1, 10.2, 10.8, 4.9, 3.3, 1.6, 1.5, 1.1, 0.9, 9.6, 7.7, 15, 15.1, 21.2, 21.1, 19.7, 18.9, 17.5, 15.9, 9.5, 9.8, 6.2, 6.1, 99.8, 98.3, 77.1, 77.2, 59, 58.1, 27.4, 29.2, 19.1, 29.6, 10.1, 18.2, 4.5, 9.1, 2.3, 2.9, 2, 1.8, 2, 2.2, 4.2, 3.9, 7.4, 7.9, 14.5, 13.7, 14.2, 12.2, 13.7, 13.2, 13.6, 15.4, 10.4, 11.6, 10, 9.5, 9.1, 9, 96.1, 94.3, 73.9, 73.9, 69.4, 73.1, 65.6, 65.3, 55.9, 54.4, 47, 49.3, 44.7, 46.7, 42.1, 41.3, 3.3, 3.4, 3.9, 2.9, 6.4, 7.2, 9.1, 8.5, 11.7, 12, 13.3, 13.2, 14.3, 12.1)), row.names = c(NA, -170L), class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), formula = value ~ time | ds, FUN = function (x) max(x, na.rm = TRUE), order.groups = FALSE), start = list( fixed = c(parent_0 = 93.8101519326534, log_k_A1 = -9.76474551635931, f_parent_qlogis = -0.971114801595408, log_k1 = -1.87993711571859, log_k2 = -4.27081421366622, g_qlogis = 0.135644115277507 ), random = list(ds = structure(c(2.56569977430371, -3.49441920289139, -3.32614443321494, 4.35347873814922, -0.0986148763466161, 4.65850590018027, 1.8618544764481, 6.12693257601545, 4.91792724701579, -17.5652201996596, -0.466203822618637, 0.746660653597927, 0.282193987271096, -0.42053488943072, -0.142115928819667, 0.369240076779088, -1.38985563501659, 1.02592753494098, 0.73090914081534, -0.736221117518819, 0.768170629350299, -1.89347658079869, 1.72168783460352, 0.844607177798114, -1.44098906095325, -0.377731855445672, 0.168180098477565, 0.469683412912104, 0.500717664434525, -0.760849320378522), .Dim = 5:6, .Dimnames = list(c("1", "2", "3", "4", "5"), c("parent_0", "log_k_A1", "f_parent_qlogis", "log_k1", "log_k2", "g_qlogis"))))), fixed = list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), random = structure(numeric(0), class = c("pdDiag", "pdMat"), formula = structure(list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), class = "listForm"), Dimnames = list(NULL, NULL))): maximum number of iterations (maxIter = 50) reached without convergence</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 48.39 16.98 43</span></div><div class='input'> + <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in plot(f_nlme_dfop_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> + <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in anova(f_nlme_dfop_sfo, f_nlme_sfo_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> parent_sink parent_A1 A1_sink @@ -440,15 +355,93 @@ with additional elements</p> #> parent 19.13518 63.5657 #> A1 66.02155 219.3189 #> </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span> -</div><div class='output co'>#> $ff -#> parent_A1 parent_sink -#> 0.2768574 0.7231426 +</div><div class='output co'>#> <span class='error'>Error in endpoints(f_nlme_dfop_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> + <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='fu'>findFunction</span><span class='op'>(</span><span class='st'>"varConstProp"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>></span> <span class='fl'>0</span><span class='op'>)</span> <span class='op'>{</span> <span class='co'># tc error model for nlme available</span> + <span class='co'># Attempts to fit metabolite kinetics with the tc error model are possible,</span> + <span class='co'># but need tweeking of control values and sometimes do not converge</span> + + <span class='va'>f_tc</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> + <span class='va'>f_nlme_sfo_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_tc</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> + <span class='va'>f_nlme_dfop_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_tc</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_sfo_tc</span>, <span class='va'>f_nlme_dfop</span>, <span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span> + <span class='op'>}</span> +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood #> -#> $distimes -#> DT50 DT90 DT50back DT50_k1 DT50_k2 -#> parent 11.07091 104.6320 31.49738 4.462384 46.20825 -#> A1 162.30536 539.1667 NA NA NA -#> </div><div class='input'><span class='co'># }</span> +#> 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 +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -238.4 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) +#> parent_0 log_k1 log_k2 g_qlogis +#> 94.04775 -1.82340 -4.16715 0.05685 +#> +#> Random effects: +#> Formula: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) +#> Level: ds +#> Structure: Diagonal +#> parent_0 log_k1 log_k2 g_qlogis Residual +#> StdDev: 2.474 0.85 1.337 0.4659 1 +#> +#> Variance function: +#> Structure: Constant plus proportion of variance covariate +#> Formula: ~fitted(.) +#> Parameter estimates: +#> const prop +#> 2.23224114 0.01262341 </div><div class='input'> + <span class='va'>f_2_obs</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>, + <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>, + <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span><span class='op'>)</span> + <span class='va'>f_nlme_sfo_sfo_obs</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_obs</span><span class='op'>)</span> +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood +#> +#> Structural model: +#> d_parent/dt = - k_parent_sink * parent - k_parent_A1 * parent +#> d_A1/dt = + k_parent_A1 * parent - k_A1_sink * A1 +#> +#> Data: +#> 170 observations of 2 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -473 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k_parent_sink ~ 1, log_k_parent_A1 ~ 1, log_k_A1_sink ~ 1) +#> parent_0 log_k_parent_sink log_k_parent_A1 log_k_A1_sink +#> 87.976 -3.670 -4.164 -4.645 +#> +#> Random effects: +#> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1, log_k_parent_A1 ~ 1, log_k_A1_sink ~ 1) +#> Level: ds +#> Structure: Diagonal +#> parent_0 log_k_parent_sink log_k_parent_A1 log_k_A1_sink Residual +#> StdDev: 3.992 1.777 1.055 0.4821 6.483 +#> +#> Variance function: +#> Structure: Different standard deviations per stratum +#> Formula: ~1 | name +#> Parameter estimates: +#> parent A1 +#> 1.0000000 0.2050003 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo_obs</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in nlme.formula(model = value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_A1, f_parent_qlogis, log_k1, log_k2, g_qlogis), data = structure(list(ds = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L ), .Label = c("1", "2", "3", "4", "5"), class = c("ordered", "factor")), name = c("parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1"), time = c(0, 0, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 0, 0, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 0, 0, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120), value = c(97.2, 96.4, 71.1, 69.2, 58.1, 56.6, 44.4, 43.4, 33.3, 29.2, 17.6, 18, 10.5, 9.3, 4.5, 4.7, 3, 3.4, 2.3, 2.7, 4.3, 4.6, 7, 7.2, 8.2, 8, 11, 13.7, 11.5, 12.7, 14.9, 14.5, 12.1, 12.3, 9.9, 10.2, 8.8, 7.8, 93.6, 92.3, 87, 82.2, 74, 73.9, 64.2, 69.5, 54, 54.6, 41.1, 38.4, 32.5, 35.5, 28.1, 29, 26.5, 27.6, 3.9, 3.1, 6.9, 6.6, 10.4, 8.3, 14.4, 13.7, 22.1, 22.3, 27.5, 25.4, 28, 26.6, 25.8, 25.3, 91.9, 90.8, 64.9, 66.2, 43.5, 44.1, 18.3, 18.1, 10.2, 10.8, 4.9, 3.3, 1.6, 1.5, 1.1, 0.9, 9.6, 7.7, 15, 15.1, 21.2, 21.1, 19.7, 18.9, 17.5, 15.9, 9.5, 9.8, 6.2, 6.1, 99.8, 98.3, 77.1, 77.2, 59, 58.1, 27.4, 29.2, 19.1, 29.6, 10.1, 18.2, 4.5, 9.1, 2.3, 2.9, 2, 1.8, 2, 2.2, 4.2, 3.9, 7.4, 7.9, 14.5, 13.7, 14.2, 12.2, 13.7, 13.2, 13.6, 15.4, 10.4, 11.6, 10, 9.5, 9.1, 9, 96.1, 94.3, 73.9, 73.9, 69.4, 73.1, 65.6, 65.3, 55.9, 54.4, 47, 49.3, 44.7, 46.7, 42.1, 41.3, 3.3, 3.4, 3.9, 2.9, 6.4, 7.2, 9.1, 8.5, 11.7, 12, 13.3, 13.2, 14.3, 12.1)), row.names = c(NA, -170L), class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), formula = value ~ time | ds, FUN = function (x) max(x, na.rm = TRUE), order.groups = FALSE), start = list( fixed = c(parent_0 = 93.4272167134207, log_k_A1 = -9.71590717106959, f_parent_qlogis = -0.953712099744438, log_k1 = -1.95256957646888, log_k2 = -4.42919226610318, g_qlogis = 0.193023137298073 ), random = list(ds = structure(c(2.85557330683041, -3.87630303729395, -2.78062140212751, 4.82042042600536, -1.01906929341432, 4.613992019697, 2.05871276943309, 6.0766404049189, 4.86471337131288, -17.6140585653619, -0.480721175257541, 0.773079218835614, 0.260464433006093, -0.440615012802434, -0.112207463781733, 0.445812953745225, -1.49588630006094, 1.13602040717272, 0.801850880762046, -0.887797941619048, 0.936480292463262, -2.43093808171905, 1.91256225793793, 0.984827519864443, -1.40293198854659, -0.455176326336681, 0.376355651864385, 0.343919720700401, 0.46329187713133, -0.728390923359434 ), .Dim = 5:6, .Dimnames = list(c("1", "2", "3", "4", "5"), c("parent_0", "log_k_A1", "f_parent_qlogis", "log_k1", "log_k2", "g_qlogis"))))), fixed = list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), random = structure(numeric(0), class = c("pdDiag", "pdMat"), formula = structure(list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), class = "listForm"), Dimnames = list(NULL, NULL)), weights = structure(numeric(0), formula = ~1 | name, class = c("varIdent", "varFunc"))): maximum number of iterations (maxIter = 50) reached without convergence</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 58.24 16.62 52.48</span></div><div class='input'> + <span class='va'>f_2_tc</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>, + <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>, + <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> + <span class='co'># f_nlme_sfo_sfo_tc <- nlme(f_2_tc["SFO-SFO", ]) # stops with error message</span> + <span class='va'>f_nlme_dfop_sfo_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_tc</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='error'>Error in X[, fmap[[nm]]] <- gradnm: number of items to replace is not a multiple of replacement length</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 6.327 2.686 5.428</span></div><div class='input'> <span class='co'># We get warnings about false convergence in the LME step in several iterations</span> + <span class='co'># but as the last such warning occurs in iteration 25 and we have 28 iterations</span> + <span class='co'># we can ignore these</span> + <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_dfop_sfo_obs</span>, <span class='va'>f_nlme_dfop_sfo_tc</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in anova(f_nlme_dfop_sfo, f_nlme_dfop_sfo_obs, f_nlme_dfop_sfo_tc): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> +<span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> diff --git a/docs/reference/nobs.mkinfit.html b/docs/reference/nobs.mkinfit.html index 55eb6a3f..dff8a285 100644 --- a/docs/reference/nobs.mkinfit.html +++ b/docs/reference/nobs.mkinfit.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -136,7 +139,7 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Number of observations on which an mkinfit object was fitted</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/nobs.mkinfit.R'><code>R/nobs.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/nobs.mkinfit.R'><code>R/nobs.mkinfit.R</code></a></small> <div class="hidden name"><code>nobs.mkinfit.Rd</code></div> </div> @@ -145,7 +148,7 @@ </div> <pre class="usage"><span class='co'># S3 method for mkinfit</span> -<span class='fu'><a href='https://rdrr.io/r/stats/nobs.html'>nobs</a></span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre> +<span class='fu'><a href='https://rdrr.io/r/stats/nobs.html'>nobs</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -179,7 +182,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/parms.html b/docs/reference/parms.html index 30dc7770..ab5888fa 100644 --- a/docs/reference/parms.html +++ b/docs/reference/parms.html @@ -74,7 +74,7 @@ considering the error structure that was assumed for the fit." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ considering the error structure that was assumed for the fit." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -199,7 +199,7 @@ such matrices is returned.</p> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>)</span> <span class='co'># \dontrun{</span> <span class='va'>fits</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0195</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00408</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0492</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00985</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00815</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.011</span></div><div class='input'><span class='fu'>parms</span><span class='op'>(</span><span class='va'>fits</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +<span class='fu'>parms</span><span class='op'>(</span><span class='va'>fits</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 #> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450 #> k_parent 0.05794659 0.009647805 0.2102974 0.1232258 0.00720421 @@ -219,10 +219,10 @@ such matrices is returned.</p> #> #> $DFOP #> Dataset 7 -#> parent_0 91.058971503 +#> parent_0 91.058971597 #> k1 0.044946770 #> k2 0.002868336 -#> g 0.526942415 +#> g 0.526942414 #> sigma 2.221302196 #> </div><div class='input'><span class='fu'>parms</span><span class='op'>(</span><span class='va'>fits</span><span class='op'>)</span> </div><div class='output co'>#> $SFO @@ -240,10 +240,10 @@ such matrices is returned.</p> #> #> $DFOP #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.55213663 91.058971503 90.34509469 98.14858850 94.311323409 -#> k1 0.21954589 0.044946770 0.41232289 0.31697588 0.080663853 -#> k2 0.02957934 0.002868336 0.07581767 0.03260384 0.003425417 -#> g 0.44845068 0.526942415 0.66091965 0.65322767 0.342652880 +#> parent_0 96.55213663 91.058971597 90.34509493 98.14858820 94.311323733 +#> k1 0.21954588 0.044946770 0.41232288 0.31697588 0.080663857 +#> k2 0.02957934 0.002868336 0.07581766 0.03260384 0.003425417 +#> g 0.44845068 0.526942414 0.66091967 0.65322767 0.342652880 #> sigma 1.35690468 2.221302196 1.34169076 2.87159846 1.942067831 #> </div><div class='input'><span class='fu'>parms</span><span class='op'>(</span><span class='va'>fits</span>, transformed <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> </div><div class='output co'>#> $SFO @@ -260,12 +260,12 @@ such matrices is returned.</p> #> sigma 1.8476712 1.9167519 1.0660627 3.14605557 1.622278 #> #> $DFOP -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.5521366 91.05897150 90.3450947 98.1485885 94.311323 -#> log_k1 -1.5161940 -3.10227638 -0.8859485 -1.1489296 -2.517465 -#> log_k2 -3.5206791 -5.85402317 -2.5794240 -3.4233253 -5.676532 -#> g_ilr -0.1463234 0.07627854 0.4719196 0.4477805 -0.460676 -#> sigma 1.3569047 2.22130220 1.3416908 2.8715985 1.942068 +#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 +#> parent_0 96.5521366 91.0589716 90.3450949 98.1485882 94.3113237 +#> log_k1 -1.5161940 -3.1022764 -0.8859486 -1.1489296 -2.5174647 +#> log_k2 -3.5206791 -5.8540232 -2.5794240 -3.4233253 -5.6765322 +#> g_qlogis -0.2069326 0.1078741 0.6673953 0.6332573 -0.6514943 +#> sigma 1.3569047 2.2213022 1.3416908 2.8715985 1.9420678 #> </div><div class='input'><span class='co'># }</span> </div></pre> </div> diff --git a/docs/reference/plot.mixed.mmkin-1.png b/docs/reference/plot.mixed.mmkin-1.png Binary files differnew file mode 100644 index 00000000..9c46481c --- /dev/null +++ b/docs/reference/plot.mixed.mmkin-1.png diff --git a/docs/reference/plot.mixed.mmkin-2.png b/docs/reference/plot.mixed.mmkin-2.png Binary files differnew file mode 100644 index 00000000..e228f764 --- /dev/null +++ b/docs/reference/plot.mixed.mmkin-2.png diff --git a/docs/reference/plot.mixed.mmkin.html b/docs/reference/plot.mixed.mmkin.html new file mode 100644 index 00000000..232d26e7 --- /dev/null +++ b/docs/reference/plot.mixed.mmkin.html @@ -0,0 +1,313 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object — plot.mixed.mmkin • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object — plot.mixed.mmkin" /> +<meta property="og:description" content="Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object" /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/plot.mixed.mmkin.R'><code>R/plot.mixed.mmkin.R</code></a></small> + <div class="hidden name"><code>plot.mixed.mmkin.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object</p> + </div> + + <pre class="usage"><span class='co'># S3 method for mixed.mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span> + <span class='va'>x</span>, + i <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fu'><a href='https://rdrr.io/r/base/nrow.html'>ncol</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>mmkin</span><span class='op'>)</span>, + obs_vars <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>mkinmod</span><span class='op'>$</span><span class='va'>map</span><span class='op'>)</span>, + standardized <span class='op'>=</span> <span class='cn'>TRUE</span>, + xlab <span class='op'>=</span> <span class='st'>"Time"</span>, + xlim <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/range.html'>range</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>$</span><span class='va'>time</span><span class='op'>)</span>, + resplot <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"predicted"</span>, <span class='st'>"time"</span><span class='op'>)</span>, + pred_over <span class='op'>=</span> <span class='cn'>NULL</span>, + ymax <span class='op'>=</span> <span class='st'>"auto"</span>, + maxabs <span class='op'>=</span> <span class='st'>"auto"</span>, + ncol.legend <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'><=</span> <span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'>+</span> <span class='fl'>1</span>, <span class='fu'><a href='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'><=</span> <span class='fl'>8</span>, <span class='fl'>3</span>, <span class='fl'>4</span><span class='op'>)</span><span class='op'>)</span>, + nrow.legend <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Round.html'>ceiling</a></span><span class='op'>(</span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'>+</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ncol.legend</span><span class='op'>)</span>, + rel.height.legend <span class='op'>=</span> <span class='fl'>0.02</span> <span class='op'>+</span> <span class='fl'>0.07</span> <span class='op'>*</span> <span class='va'>nrow.legend</span>, + rel.height.bottom <span class='op'>=</span> <span class='fl'>1.1</span>, + pch_ds <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span>, + col_ds <span class='op'>=</span> <span class='va'>pch_ds</span> <span class='op'>+</span> <span class='fl'>1</span>, + lty_ds <span class='op'>=</span> <span class='va'>col_ds</span>, + frame <span class='op'>=</span> <span class='cn'>TRUE</span>, + <span class='va'>...</span> +<span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An object of class <a href='mixed.html'>mixed.mmkin</a>, <a href='nlme.mmkin.html'>nlme.mmkin</a></p></td> + </tr> + <tr> + <th>i</th> + <td><p>A numeric index to select datasets for which to plot the individual predictions, +in case plots get too large</p></td> + </tr> + <tr> + <th>obs_vars</th> + <td><p>A character vector of names of the observed variables for +which the data and the model should be plotted. Defauls to all observed +variables in the model.</p></td> + </tr> + <tr> + <th>standardized</th> + <td><p>Should the residuals be standardized? Only takes effect if +<code>resplot = "time"</code>.</p></td> + </tr> + <tr> + <th>xlab</th> + <td><p>Label for the x axis.</p></td> + </tr> + <tr> + <th>xlim</th> + <td><p>Plot range in x direction.</p></td> + </tr> + <tr> + <th>resplot</th> + <td><p>Should the residuals plotted against time or against +predicted values?</p></td> + </tr> + <tr> + <th>pred_over</th> + <td><p>Named list of alternative predictions as obtained +from <a href='mkinpredict.html'>mkinpredict</a> with a compatible <a href='mkinmod.html'>mkinmod</a>.</p></td> + </tr> + <tr> + <th>ymax</th> + <td><p>Vector of maximum y axis values</p></td> + </tr> + <tr> + <th>maxabs</th> + <td><p>Maximum absolute value of the residuals. This is used for the +scaling of the y axis and defaults to "auto".</p></td> + </tr> + <tr> + <th>ncol.legend</th> + <td><p>Number of columns to use in the legend</p></td> + </tr> + <tr> + <th>nrow.legend</th> + <td><p>Number of rows to use in the legend</p></td> + </tr> + <tr> + <th>rel.height.legend</th> + <td><p>The relative height of the legend shown on top</p></td> + </tr> + <tr> + <th>rel.height.bottom</th> + <td><p>The relative height of the bottom plot row</p></td> + </tr> + <tr> + <th>pch_ds</th> + <td><p>Symbols to be used for plotting the data.</p></td> + </tr> + <tr> + <th>col_ds</th> + <td><p>Colors used for plotting the observed data and the +corresponding model prediction lines for the different datasets.</p></td> + </tr> + <tr> + <th>lty_ds</th> + <td><p>Line types to be used for the model predictions.</p></td> + </tr> + <tr> + <th>frame</th> + <td><p>Should a frame be drawn around the plots?</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Further arguments passed to <code><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></code>.</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>The function is called for its side effect.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='va'>ds</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>, + <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span><span class='op'>(</span><span class='st'>"ds "</span>, <span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>)</span> +<span class='va'>dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='co'># \dontrun{</span> +<span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>dfop_sfo</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span>, standardized <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='img'><img src='plot.mixed.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'> +<span class='co'># For this fit we need to increase pnlsMaxiter, and we increase the</span> +<span class='co'># tolerance in order to speed up the fit for this example evaluation</span> +<span class='va'>f_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span>, control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>120</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-3</span><span class='op'>)</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> +</div><div class='img'><img src='plot.mixed.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'> +<span class='co'># }</span> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/plot.mkinfit-1.png b/docs/reference/plot.mkinfit-1.png Binary files differindex fc195031..e5da9f1c 100644 --- a/docs/reference/plot.mkinfit-1.png +++ b/docs/reference/plot.mkinfit-1.png diff --git a/docs/reference/plot.mkinfit-2.png b/docs/reference/plot.mkinfit-2.png Binary files differindex 994b516e..376c812f 100644 --- a/docs/reference/plot.mkinfit-2.png +++ b/docs/reference/plot.mkinfit-2.png diff --git a/docs/reference/plot.mkinfit-3.png b/docs/reference/plot.mkinfit-3.png Binary files differindex 28789544..c976d4b1 100644 --- a/docs/reference/plot.mkinfit-3.png +++ b/docs/reference/plot.mkinfit-3.png diff --git a/docs/reference/plot.mkinfit-4.png b/docs/reference/plot.mkinfit-4.png Binary files differindex edea6fce..c8bc00fe 100644 --- a/docs/reference/plot.mkinfit-4.png +++ b/docs/reference/plot.mkinfit-4.png diff --git a/docs/reference/plot.mkinfit-5.png b/docs/reference/plot.mkinfit-5.png Binary files differindex b4b6528b..bc44de88 100644 --- a/docs/reference/plot.mkinfit-5.png +++ b/docs/reference/plot.mkinfit-5.png diff --git a/docs/reference/plot.mkinfit-6.png b/docs/reference/plot.mkinfit-6.png Binary files differindex a939f8e9..eb8cbd92 100644 --- a/docs/reference/plot.mkinfit-6.png +++ b/docs/reference/plot.mkinfit-6.png diff --git a/docs/reference/plot.mkinfit-7.png b/docs/reference/plot.mkinfit-7.png Binary files differindex ae7807a8..92a664f4 100644 --- a/docs/reference/plot.mkinfit-7.png +++ b/docs/reference/plot.mkinfit-7.png diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index b82a8170..1be0f9af 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -74,7 +74,7 @@ observed data together with the solution of the fitted model." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -123,7 +123,7 @@ observed data together with the solution of the fitted model." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -157,7 +157,7 @@ observed data together with the solution of the fitted model.</p> fit <span class='op'>=</span> <span class='va'>x</span>, obs_vars <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>$</span><span class='va'>mkinmod</span><span class='op'>$</span><span class='va'>map</span><span class='op'>)</span>, xlab <span class='op'>=</span> <span class='st'>"Time"</span>, - ylab <span class='op'>=</span> <span class='st'>"Observed"</span>, + ylab <span class='op'>=</span> <span class='st'>"Residue"</span>, xlim <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/range.html'>range</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>$</span><span class='va'>data</span><span class='op'>$</span><span class='va'>time</span><span class='op'>)</span>, ylim <span class='op'>=</span> <span class='st'>"default"</span>, col_obs <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>obs_vars</span><span class='op'>)</span>, @@ -340,10 +340,10 @@ latex is being used for the formatting of the chi2 error level, if <span class='co'># One parent compound, one metabolite, both single first order, path from</span> <span class='co'># parent to sink included</span> <span class='co'># \dontrun{</span> -<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, full <span class='op'>=</span> <span class='st'>"Parent"</span><span class='op'>)</span>, - m1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, full <span class='op'>=</span> <span class='st'>"Metabolite M1"</span> <span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> +<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, full <span class='op'>=</span> <span class='st'>"Parent"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, full <span class='op'>=</span> <span class='st'>"Metabolite M1"</span> <span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> </div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> </div><div class='img'><img src='plot.mkinfit-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>plot_res</span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> </div><div class='img'><img src='plot.mkinfit-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'>plot_res</span><span class='op'>(</span><span class='va'>fit</span>, standardized <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> diff --git a/docs/reference/plot.mmkin-1.png b/docs/reference/plot.mmkin-1.png Binary files differindex 438d5a53..f12b7907 100644 --- a/docs/reference/plot.mmkin-1.png +++ b/docs/reference/plot.mmkin-1.png diff --git a/docs/reference/plot.mmkin-2.png b/docs/reference/plot.mmkin-2.png Binary files differindex ee04b3c4..e3127554 100644 --- a/docs/reference/plot.mmkin-2.png +++ b/docs/reference/plot.mmkin-2.png diff --git a/docs/reference/plot.mmkin-3.png b/docs/reference/plot.mmkin-3.png Binary files differindex e06ed002..5448976e 100644 --- a/docs/reference/plot.mmkin-3.png +++ b/docs/reference/plot.mmkin-3.png diff --git a/docs/reference/plot.mmkin-4.png b/docs/reference/plot.mmkin-4.png Binary files differindex 5869df55..9a25fc50 100644 --- a/docs/reference/plot.mmkin-4.png +++ b/docs/reference/plot.mmkin-4.png diff --git a/docs/reference/plot.mmkin-5.png b/docs/reference/plot.mmkin-5.png Binary files differindex 927c573b..82b422b5 100644 --- a/docs/reference/plot.mmkin-5.png +++ b/docs/reference/plot.mmkin-5.png diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index 2003b210..4e9836ec 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -76,7 +76,7 @@ the fit of at least one model to the same dataset is shown." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ the fit of at least one model to the same dataset is shown." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -160,6 +160,7 @@ the fit of at least one model to the same dataset is shown.</p> main <span class='op'>=</span> <span class='st'>"auto"</span>, legends <span class='op'>=</span> <span class='fl'>1</span>, resplot <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"time"</span>, <span class='st'>"errmod"</span><span class='op'>)</span>, + ylab <span class='op'>=</span> <span class='st'>"Residue"</span>, standardized <span class='op'>=</span> <span class='cn'>FALSE</span>, show_errmin <span class='op'>=</span> <span class='cn'>TRUE</span>, errmin_var <span class='op'>=</span> <span class='st'>"All data"</span>, @@ -193,6 +194,10 @@ column.</p></td> values, with the error model, using <code><a href='mkinerrplot.html'>mkinerrplot</a></code>.</p></td> </tr> <tr> + <th>ylab</th> + <td><p>Label for the y axis.</p></td> + </tr> + <tr> <th>standardized</th> <td><p>Should the residuals be standardized? This option is passed to <code><a href='mkinresplot.html'>mkinresplot</a></code>, it only takes effect if diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index 17a80aa2..29cc984a 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -73,7 +73,7 @@ function (SFO, then IORE, then DFOP)." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -110,6 +110,9 @@ function (SFO, then IORE, then DFOP)." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -118,8 +121,8 @@ function (SFO, then IORE, then DFOP)." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -137,7 +140,7 @@ function (SFO, then IORE, then DFOP)." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Plot the results of the three models used in the NAFTA scheme.</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/nafta.R'><code>R/nafta.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/nafta.R'><code>R/nafta.R</code></a></small> <div class="hidden name"><code>plot.nafta.Rd</code></div> </div> @@ -147,7 +150,7 @@ function (SFO, then IORE, then DFOP).</p> </div> <pre class="usage"><span class='co'># S3 method for nafta</span> -<span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>x</span>, <span class='kw'>legend</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>main</span> <span class='kw'>=</span> <span class='st'>"auto"</span>, <span class='no'>...</span>)</pre> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>x</span>, legend <span class='op'>=</span> <span class='cn'>FALSE</span>, main <span class='op'>=</span> <span class='st'>"auto"</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -176,6 +179,9 @@ function (SFO, then IORE, then DFOP).</p> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <p>Calls <code><a href='plot.mmkin.html'>plot.mmkin</a></code>.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke</p> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -192,7 +198,7 @@ function (SFO, then IORE, then DFOP).</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/print.mmkin.html b/docs/reference/print.mmkin.html new file mode 100644 index 00000000..0c094bfc --- /dev/null +++ b/docs/reference/print.mmkin.html @@ -0,0 +1,194 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Print method for mmkin objects — print.mmkin • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Print method for mmkin objects — print.mmkin" /> +<meta property="og:description" content="Print method for mmkin objects" /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Print method for mmkin objects</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mmkin.R'><code>R/mmkin.R</code></a></small> + <div class="hidden name"><code>print.mmkin.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Print method for mmkin objects</p> + </div> + + <pre class="usage"><span class='co'># S3 method for mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An <a href='mmkin.html'>mmkin</a> object.</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Not used.</p></td> + </tr> + </table> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 8a886c63..2bfeb582 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -45,6 +45,8 @@ below to see their documentation. lmtestlrtest + nlmenlme + " /> @@ -77,7 +79,7 @@ below to see their documentation. </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -114,6 +116,9 @@ below to see their documentation. <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -122,8 +127,8 @@ below to see their documentation. </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -141,16 +146,18 @@ below to see their documentation. <div class="col-md-9 contents"> <div class="page-header"> <h1>Objects exported from other packages</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/lrtest.mkinfit.R'><code>R/lrtest.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/lrtest.mkinfit.R'><code>R/lrtest.mkinfit.R</code></a>, <a href='https://github.com/jranke/mkin/blob/master/R/nlme.mmkin.R'><code>R/nlme.mmkin.R</code></a></small> <div class="hidden name"><code>reexports.Rd</code></div> </div> <div class="ref-description"> <p>These objects are imported from other packages. Follow the links below to see their documentation.</p> -<dl'> +<dl> <dt>lmtest</dt><dd><p><code><a href='https://rdrr.io/pkg/lmtest/man/lrtest.html'>lrtest</a></code></p></dd> + <dt>nlme</dt><dd><p><code><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></code></p></dd> + </dl> </div> @@ -172,7 +179,7 @@ below to see their documentation.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/residuals.mkinfit.html b/docs/reference/residuals.mkinfit.html index 0933cd7b..db7c1a40 100644 --- a/docs/reference/residuals.mkinfit.html +++ b/docs/reference/residuals.mkinfit.html @@ -72,7 +72,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -109,6 +109,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -117,8 +120,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -136,7 +139,7 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Extract residuals from an mkinfit model</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/residuals.mkinfit.R'><code>R/residuals.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/residuals.mkinfit.R'><code>R/residuals.mkinfit.R</code></a></small> <div class="hidden name"><code>residuals.mkinfit.Rd</code></div> </div> @@ -145,7 +148,7 @@ </div> <pre class="usage"><span class='co'># S3 method for mkinfit</span> -<span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span>(<span class='no'>object</span>, <span class='kw'>standardized</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)</pre> +<span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span><span class='op'>(</span><span class='va'>object</span>, standardized <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -167,10 +170,12 @@ standard deviation obtained from the fitted error model?</p></td> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='no'>f</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"DFOP"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span>(<span class='no'>f</span>)</div><div class='output co'>#> [1] 0.09726306 -0.13912135 -0.15351176 0.73388319 -0.08657030 -0.93204730 -#> [7] -0.03269102 1.45347805 -0.88423710</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span>(<span class='no'>f</span>, <span class='kw'>standardized</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> [1] 0.13969820 -0.19981894 -0.22048777 1.05407086 -0.12434027 -1.33869248 -#> [7] -0.04695387 2.08761953 -1.27002305</div></pre> + <pre class="examples"><div class='input'><span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='va'>FOCUS_2006_C</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 0.09726374 -0.13912142 -0.15351210 0.73388322 -0.08657004 -0.93204702 +#> [7] -0.03269080 1.45347823 -0.88423697</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/residuals.html'>residuals</a></span><span class='op'>(</span><span class='va'>f</span>, standardized <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> [1] 0.13969917 -0.19981904 -0.22048826 1.05407091 -0.12433989 -1.33869208 +#> [7] -0.04695354 2.08761977 -1.27002287</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> @@ -186,7 +191,7 @@ standard deviation obtained from the fitted error model?</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/schaefer07_complex_case-1.png b/docs/reference/schaefer07_complex_case-1.png Binary files differindex 7cf7484d..be903641 100644 --- a/docs/reference/schaefer07_complex_case-1.png +++ b/docs/reference/schaefer07_complex_case-1.png diff --git a/docs/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html index 70f1ee9a..74f71f46 100644 --- a/docs/reference/schaefer07_complex_case.html +++ b/docs/reference/schaefer07_complex_case.html @@ -74,7 +74,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -111,6 +111,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -119,8 +122,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -148,12 +151,12 @@ The results from the fitting are also included.</p> </div> - <pre class="usage"><span class='no'>schaefer07_complex_case</span></pre> + <pre class="usage"><span class='va'>schaefer07_complex_case</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> - <p>The data set is a data frame with 8 observations on the following 6 variables.</p><dl'> + <p>The data set is a data frame with 8 observations on the following 6 variables.</p><dl> <dt><code>time</code></dt><dd><p>a numeric vector</p></dd> <dt><code>parent</code></dt><dd><p>a numeric vector</p></dd> <dt><code>A1</code></dt><dd><p>a numeric vector</p></dd> @@ -170,28 +173,32 @@ Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='no'>data</span> <span class='kw'><-</span> <span class='fu'><a href='mkin_wide_to_long.html'>mkin_wide_to_long</a></span>(<span class='no'>schaefer07_complex_case</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"time"</span>) -<span class='no'>model</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"A1"</span>, <span class='st'>"B1"</span>, <span class='st'>"C1"</span>), <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>), - <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A2"</span>), - <span class='kw'>B1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>C1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>A2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> <span class='co'># \dontrun{</span> - <span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>model</span>, <span class='no'>data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) - <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>fit</span>)</div><div class='img'><img src='schaefer07_complex_case-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> $ff + <pre class="examples"><div class='input'><span class='va'>data</span> <span class='op'><-</span> <span class='fu'><a href='mkin_wide_to_long.html'>mkin_wide_to_long</a></span><span class='op'>(</span><span class='va'>schaefer07_complex_case</span>, time <span class='op'>=</span> <span class='st'>"time"</span><span class='op'>)</span> +<span class='va'>model</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"A1"</span>, <span class='st'>"B1"</span>, <span class='st'>"C1"</span><span class='op'>)</span>, sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + A1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"A2"</span><span class='op'>)</span>, + B1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + C1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + A2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># \dontrun{</span> + <span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>model</span>, <span class='va'>data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='img'><img src='schaefer07_complex_case-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='output co'>#> $ff #> parent_A1 parent_B1 parent_C1 parent_sink A1_A2 A1_sink -#> 0.3809619 0.1954667 0.4235714 0.0000000 0.4479609 0.5520391 +#> 0.3809620 0.1954665 0.4235715 0.0000000 0.4479662 0.5520338 #> #> $distimes #> DT50 DT90 #> parent 13.95078 46.34350 -#> A1 49.75343 165.27733 -#> B1 37.26907 123.80517 +#> A1 49.75343 165.27731 +#> B1 37.26912 123.80533 #> C1 11.23131 37.30959 -#> A2 28.50638 94.69614 +#> A2 28.50569 94.69386 #> </div><div class='input'> <span class='co'># }</span> <span class='co'># Compare with the results obtained in the original publication</span> - <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>schaefer07_complex_results</span>)</div><div class='output co'>#> compound parameter KinGUI ModelMaker deviation + <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>schaefer07_complex_results</span><span class='op'>)</span> +</div><div class='output co'>#> compound parameter KinGUI ModelMaker deviation #> 1 parent degradation rate 0.0496 0.0506 2.0 #> 2 parent DT50 13.9900 13.6900 2.2 #> 3 metabolite A1 formation fraction 0.3803 0.3696 2.9 @@ -221,7 +228,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/sigma_twocomp-1.png b/docs/reference/sigma_twocomp-1.png Binary files differnew file mode 100644 index 00000000..6e61684e --- /dev/null +++ b/docs/reference/sigma_twocomp-1.png diff --git a/docs/reference/sigma_twocomp.html b/docs/reference/sigma_twocomp.html index 26b08765..46ca562a 100644 --- a/docs/reference/sigma_twocomp.html +++ b/docs/reference/sigma_twocomp.html @@ -73,7 +73,7 @@ dependence of the measured value \(y\):" /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -122,7 +122,7 @@ dependence of the measured value \(y\):" /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -189,6 +189,33 @@ Additive, Multiplicative, and Mixed Analytical Errors. Clinical Chemistry <p>Rocke, David M. and Lorenzato, Stefan (1995) A two-component model for measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p> + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='va'>times</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> +<span class='va'>d_pred</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span><span class='op'>(</span>time <span class='op'>=</span> <span class='va'>times</span>, parent <span class='op'>=</span> <span class='fl'>100</span> <span class='op'>*</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>exp</a></span><span class='op'>(</span><span class='op'>-</span> <span class='fl'>0.03</span> <span class='op'>*</span> <span class='va'>times</span><span class='op'>)</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456</span><span class='op'>)</span> +<span class='va'>d_syn</span> <span class='op'><-</span> <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>d_pred</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>y</span><span class='op'>)</span> <span class='fu'>sigma_twocomp</span><span class='op'>(</span><span class='va'>y</span>, <span class='fl'>1</span>, <span class='fl'>0.07</span><span class='op'>)</span>, + reps <span class='op'>=</span> <span class='fl'>2</span>, n <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span> +<span class='va'>f_nls</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/nls.html'>nls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>, data <span class='op'>=</span> <span class='va'>d_syn</span>, + start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span><span class='op'>)</span> +<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span> +<span class='va'>f_gnls</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/gnls.html'>gnls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>, + data <span class='op'>=</span> <span class='va'>d_syn</span>, na.action <span class='op'>=</span> <span class='va'>na.omit</span>, + start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span><span class='op'>)</span> +<span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='fu'>findFunction</span><span class='op'>(</span><span class='st'>"varConstProp"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>></span> <span class='fl'>0</span><span class='op'>)</span> <span class='op'>{</span> + <span class='va'>f_gnls_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_gnls</span>, weights <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/varConstProp.html'>varConstProp</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> + <span class='va'>f_gnls_tc_sf</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_gnls_tc</span>, control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>sigma <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>)</span> +<span class='op'>}</span> +<span class='va'>f_mkin</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>d_syn</span>, error_model <span class='op'>=</span> <span class='st'>"const"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>f_mkin_tc</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>d_syn</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>f_mkin_tc</span>, standardized <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='img'><img src='sigma_twocomp-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nls</span>, <span class='va'>f_gnls</span>, <span class='va'>f_gnls_tc</span>, <span class='va'>f_gnls_tc_sf</span>, <span class='va'>f_mkin</span>, <span class='va'>f_mkin_tc</span><span class='op'>)</span> +</div><div class='output co'>#> df AIC +#> f_nls 3 114.4817 +#> f_gnls 3 114.4817 +#> f_gnls_tc 5 103.6447 +#> f_gnls_tc_sf 4 101.6447 +#> f_mkin 3 114.4817 +#> f_mkin_tc 4 101.6446</div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <nav id="toc" data-toggle="toc" class="sticky-top"> diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index a2ef3b75..7be427bf 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -76,7 +76,7 @@ values." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -125,7 +125,7 @@ values." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -235,18 +235,18 @@ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> - <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span>, <span class='va'>FOCUS_2006_A</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> mkin version used for fitting: 0.9.50.3 + <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span>, <span class='va'>FOCUS_2006_A</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> mkin version used for fitting: 1.0.0 #> R version used for fitting: 4.0.3 -#> Date of fit: Thu Oct 15 12:41:58 2020 -#> Date of summary: Thu Oct 15 12:41:58 2020 +#> Date of fit: Wed Feb 3 17:32:02 2021 +#> Date of summary: Wed Feb 3 17:32:02 2021 #> #> Equations: #> d_parent/dt = - k_parent * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.029 s +#> Fitted using 131 model solutions performed in 0.028 s #> #> Error model: Constant variance #> diff --git a/docs/reference/summary.nlme.mmkin.html b/docs/reference/summary.nlme.mmkin.html new file mode 100644 index 00000000..bc60b53e --- /dev/null +++ b/docs/reference/summary.nlme.mmkin.html @@ -0,0 +1,449 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Summary method for class "nlme.mmkin" — summary.nlme.mmkin • mkin</title> + + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" /> + +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script> + +<!-- bootstrap-toc --> +<link rel="stylesheet" href="../bootstrap-toc.css"> +<script src="../bootstrap-toc.js"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script> + +<!-- headroom.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + + +<meta property="og:title" content="Summary method for class "nlme.mmkin" — summary.nlme.mmkin" /> +<meta property="og:description" content="Lists model equations, initial parameter values, optimised parameters +for fixed effects (population), random effects (deviations from the +population mean) and residual error model, as well as the resulting +endpoints such as formation fractions and DT50 values. Optionally +(default is FALSE), the data are listed in full." /> + + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + + </head> + + <body data-spy="scroll" data-target="#toc"> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + <li> + <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> + </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + <ul class="nav navbar-nav navbar-right"> + <li> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Summary method for class "nlme.mmkin"</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/summary.nlme.mmkin.R'><code>R/summary.nlme.mmkin.R</code></a></small> + <div class="hidden name"><code>summary.nlme.mmkin.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Lists model equations, initial parameter values, optimised parameters +for fixed effects (population), random effects (deviations from the +population mean) and residual error model, as well as the resulting +endpoints such as formation fractions and DT50 values. Optionally +(default is FALSE), the data are listed in full.</p> + </div> + + <pre class="usage"><span class='co'># S3 method for nlme.mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span> + <span class='va'>object</span>, + data <span class='op'>=</span> <span class='cn'>FALSE</span>, + verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, + distimes <span class='op'>=</span> <span class='cn'>TRUE</span>, + alpha <span class='op'>=</span> <span class='fl'>0.05</span>, + <span class='va'>...</span> +<span class='op'>)</span> + +<span class='co'># S3 method for summary.nlme.mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>verbose</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>object</th> + <td><p>an object of class <a href='nlme.mmkin.html'>nlme.mmkin</a></p></td> + </tr> + <tr> + <th>data</th> + <td><p>logical, indicating whether the full data should be included in +the summary.</p></td> + </tr> + <tr> + <th>verbose</th> + <td><p>Should the summary be verbose?</p></td> + </tr> + <tr> + <th>distimes</th> + <td><p>logical, indicating whether DT50 and DT90 values should be +included.</p></td> + </tr> + <tr> + <th>alpha</th> + <td><p>error level for confidence interval estimation from the t +distribution</p></td> + </tr> + <tr> + <th>...</th> + <td><p>optional arguments passed to methods like <code>print</code>.</p></td> + </tr> + <tr> + <th>x</th> + <td><p>an object of class summary.nlme.mmkin</p></td> + </tr> + <tr> + <th>digits</th> + <td><p>Number of digits to use for printing</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>The summary function returns a list based on the <a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a> object +obtained in the fit, with at least the following additional components</p> +<dt>nlmeversion, mkinversion, Rversion</dt><dd><p>The nlme, mkin and R versions used</p></dd> +<dt>date.fit, date.summary</dt><dd><p>The dates where the fit and the summary were +produced</p></dd> +<dt>diffs</dt><dd><p>The differential equations used in the degradation model</p></dd> +<dt>use_of_ff</dt><dd><p>Was maximum or minimum use made of formation fractions</p></dd> +<dt>data</dt><dd><p>The data</p></dd> +<dt>confint_trans</dt><dd><p>Transformed parameters as used in the optimisation, with confidence intervals</p></dd> +<dt>confint_back</dt><dd><p>Backtransformed parameters, with confidence intervals if available</p></dd> +<dt>ff</dt><dd><p>The estimated formation fractions derived from the fitted +model.</p></dd> +<dt>distimes</dt><dd><p>The DT50 and DT90 values for each observed variable.</p></dd> +<dt>SFORB</dt><dd><p>If applicable, eigenvalues of SFORB components of the model.</p></dd> +The print method is called for its side effect, i.e. printing the summary. + + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> + + <p>Johannes Ranke for the mkin specific parts +José Pinheiro and Douglas Bates for the components inherited from nlme</p> + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'> +<span class='co'># Generate five datasets following SFO kinetics</span> +<span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> +<span class='va'>dt50_sfo_in_pop</span> <span class='op'><-</span> <span class='fl'>50</span> +<span class='va'>k_in_pop</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>2</span><span class='op'>)</span> <span class='op'>/</span> <span class='va'>dt50_sfo_in_pop</span> +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>1234</span><span class='op'>)</span> +<span class='va'>k_in</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='fl'>5</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='va'>k_in_pop</span><span class='op'>)</span>, <span class='fl'>0.5</span><span class='op'>)</span> +<span class='va'>SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> + +<span class='va'>pred_sfo</span> <span class='op'><-</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>k</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>SFO</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='va'>k</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span><span class='op'>)</span>, + <span class='va'>sampling_times</span><span class='op'>)</span> +<span class='op'>}</span> + +<span class='va'>ds_sfo_mean</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>k_in</span>, <span class='va'>pred_sfo</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>ds_sfo_mean</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"ds"</span>, <span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>12345</span><span class='op'>)</span> +<span class='va'>ds_sfo_syn</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>ds_sfo_mean</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>ds</span>, + sdfunc <span class='op'>=</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>+</span> <span class='va'>value</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>*</span> <span class='fl'>0.07</span><span class='op'>^</span><span class='fl'>2</span><span class='op'>)</span>, + n <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span> +<span class='op'>}</span><span class='op'>)</span> + +<span class='co'># Evaluate using mmkin and nlme</span> +<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span> +<span class='va'>f_mmkin</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>ds_sfo_syn</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Optimisation did not converge:</span> +#> <span class='warning'>iteration limit reached without convergence (10)</span></div><div class='input'><span class='va'>f_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Iteration 4, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>f_nlme</span>, data <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> nlme version used for fitting: 3.1.151 +#> mkin version used for pre-fitting: 1.0.0 +#> R version used for fitting: 4.0.3 +#> Date of fit: Wed Feb 3 17:32:05 2021 +#> Date of summary: Wed Feb 3 17:32:05 2021 +#> +#> Equations: +#> d_parent/dt = - k_parent * parent +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Model predictions using solution type analytical +#> +#> Fitted in 0.526 s using 4 iterations +#> +#> Variance model: Two-component variance function +#> +#> Mean of starting values for individual parameters: +#> parent_0 log_k_parent +#> 101.569 -4.454 +#> +#> Fixed degradation parameter values: +#> None +#> +#> Results: +#> +#> AIC BIC logLik +#> 584.5 599.5 -286.2 +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> lower est. upper +#> parent_0 99.371 101.592 103.814 +#> log_k_parent -4.973 -4.449 -3.926 +#> +#> Correlation: +#> prnt_0 +#> log_k_parent 0.051 +#> +#> Random effects: +#> Formula: list(parent_0 ~ 1, log_k_parent ~ 1) +#> Level: ds +#> Structure: Diagonal +#> parent_0 log_k_parent Residual +#> StdDev: 6.91e-05 0.5863 1 +#> +#> Variance function: +#> Structure: Constant plus proportion of variance covariate +#> Formula: ~fitted(.) +#> Parameter estimates: +#> const prop +#> 0.0001206605 0.0789967776 +#> +#> Backtransformed parameters with asymmetric confidence intervals: +#> lower est. upper +#> parent_0 99.370883 101.59243 103.81398 +#> k_parent 0.006923 0.01168 0.01972 +#> +#> Estimated disappearance times: +#> DT50 DT90 +#> parent 59.32 197.1 +#> +#> Data: +#> ds name time observed predicted residual std standardized +#> ds 1 parent 0 104.1 101.592 2.50757 8.0255 0.312451 +#> ds 1 parent 0 105.0 101.592 3.40757 8.0255 0.424594 +#> ds 1 parent 1 98.5 100.796 -2.29571 7.9625 -0.288314 +#> ds 1 parent 1 96.1 100.796 -4.69571 7.9625 -0.589725 +#> ds 1 parent 3 101.9 99.221 2.67904 7.8381 0.341796 +#> ds 1 parent 3 85.2 99.221 -14.02096 7.8381 -1.788813 +#> ds 1 parent 7 99.1 96.145 2.95512 7.5951 0.389081 +#> ds 1 parent 7 93.0 96.145 -3.14488 7.5951 -0.414065 +#> ds 1 parent 14 88.1 90.989 -2.88944 7.1879 -0.401988 +#> ds 1 parent 14 84.1 90.989 -6.88944 7.1879 -0.958480 +#> ds 1 parent 28 80.2 81.493 -1.29305 6.4377 -0.200857 +#> ds 1 parent 28 91.3 81.493 9.80695 6.4377 1.523365 +#> ds 1 parent 60 65.1 63.344 1.75642 5.0039 0.351008 +#> ds 1 parent 60 65.8 63.344 2.45642 5.0039 0.490898 +#> ds 1 parent 90 47.8 50.018 -2.21764 3.9512 -0.561253 +#> ds 1 parent 90 53.5 50.018 3.48236 3.9512 0.881335 +#> ds 1 parent 120 37.6 39.495 -1.89515 3.1200 -0.607423 +#> ds 1 parent 120 39.3 39.495 -0.19515 3.1200 -0.062549 +#> ds 2 parent 0 107.9 101.592 6.30757 8.0255 0.785944 +#> ds 2 parent 0 102.1 101.592 0.50757 8.0255 0.063245 +#> ds 2 parent 1 103.8 100.058 3.74159 7.9043 0.473362 +#> ds 2 parent 1 108.6 100.058 8.54159 7.9043 1.080627 +#> ds 2 parent 3 91.0 97.060 -6.05952 7.6674 -0.790297 +#> ds 2 parent 3 84.9 97.060 -12.15952 7.6674 -1.585874 +#> ds 2 parent 7 79.3 91.329 -12.02867 7.2147 -1.667252 +#> ds 2 parent 7 100.9 91.329 9.57133 7.2147 1.326648 +#> ds 2 parent 14 77.3 82.102 -4.80185 6.4858 -0.740366 +#> ds 2 parent 14 83.5 82.102 1.39815 6.4858 0.215571 +#> ds 2 parent 28 66.8 66.351 0.44945 5.2415 0.085748 +#> ds 2 parent 28 63.3 66.351 -3.05055 5.2415 -0.582002 +#> ds 2 parent 60 40.8 40.775 0.02474 3.2211 0.007679 +#> ds 2 parent 60 44.8 40.775 4.02474 3.2211 1.249486 +#> ds 2 parent 90 27.8 25.832 1.96762 2.0407 0.964198 +#> ds 2 parent 90 27.0 25.832 1.16762 2.0407 0.572171 +#> ds 2 parent 120 15.2 16.366 -1.16561 1.2928 -0.901596 +#> ds 2 parent 120 15.5 16.366 -0.86561 1.2928 -0.669547 +#> ds 3 parent 0 97.7 101.592 -3.89243 8.0255 -0.485009 +#> ds 3 parent 0 88.2 101.592 -13.39243 8.0255 -1.668740 +#> ds 3 parent 1 109.9 99.218 10.68196 7.8379 1.362859 +#> ds 3 parent 1 97.8 99.218 -1.41804 7.8379 -0.180921 +#> ds 3 parent 3 100.5 94.634 5.86555 7.4758 0.784603 +#> ds 3 parent 3 77.4 94.634 -17.23445 7.4758 -2.305360 +#> ds 3 parent 7 78.3 86.093 -7.79273 6.8010 -1.145813 +#> ds 3 parent 7 90.3 86.093 4.20727 6.8010 0.618621 +#> ds 3 parent 14 76.0 72.958 3.04222 5.7634 0.527849 +#> ds 3 parent 14 79.1 72.958 6.14222 5.7634 1.065723 +#> ds 3 parent 28 46.0 52.394 -6.39404 4.1390 -1.544842 +#> ds 3 parent 28 53.4 52.394 1.00596 4.1390 0.243046 +#> ds 3 parent 60 25.1 24.582 0.51786 1.9419 0.266676 +#> ds 3 parent 60 21.4 24.582 -3.18214 1.9419 -1.638665 +#> ds 3 parent 90 11.0 12.092 -1.09202 0.9552 -1.143200 +#> ds 3 parent 90 14.2 12.092 2.10798 0.9552 2.206777 +#> ds 3 parent 120 5.8 5.948 -0.14810 0.4699 -0.315178 +#> ds 3 parent 120 6.1 5.948 0.15190 0.4699 0.323282 +#> ds 4 parent 0 95.3 101.592 -6.29243 8.0255 -0.784057 +#> ds 4 parent 0 102.0 101.592 0.40757 8.0255 0.050785 +#> ds 4 parent 1 104.4 101.125 3.27549 7.9885 0.410025 +#> ds 4 parent 1 105.4 101.125 4.27549 7.9885 0.535205 +#> ds 4 parent 3 113.7 100.195 13.50487 7.9151 1.706218 +#> ds 4 parent 3 82.3 100.195 -17.89513 7.9151 -2.260887 +#> ds 4 parent 7 98.1 98.362 -0.26190 7.7703 -0.033706 +#> ds 4 parent 7 87.8 98.362 -10.56190 7.7703 -1.359270 +#> ds 4 parent 14 97.9 95.234 2.66590 7.5232 0.354357 +#> ds 4 parent 14 104.8 95.234 9.56590 7.5232 1.271522 +#> ds 4 parent 28 85.0 89.274 -4.27372 7.0523 -0.606001 +#> ds 4 parent 28 77.2 89.274 -12.07372 7.0523 -1.712017 +#> ds 4 parent 60 82.2 77.013 5.18661 6.0838 0.852526 +#> ds 4 parent 60 86.1 77.013 9.08661 6.0838 1.493571 +#> ds 4 parent 90 70.5 67.053 3.44692 5.2970 0.650733 +#> ds 4 parent 90 61.7 67.053 -5.35308 5.2970 -1.010591 +#> ds 4 parent 120 60.0 58.381 1.61905 4.6119 0.351058 +#> ds 4 parent 120 56.4 58.381 -1.98095 4.6119 -0.429530 +#> ds 5 parent 0 92.6 101.592 -8.99243 8.0255 -1.120486 +#> ds 5 parent 0 116.5 101.592 14.90757 8.0255 1.857531 +#> ds 5 parent 1 108.0 99.914 8.08560 7.8929 1.024413 +#> ds 5 parent 1 104.9 99.914 4.98560 7.8929 0.631656 +#> ds 5 parent 3 100.5 96.641 3.85898 7.6343 0.505477 +#> ds 5 parent 3 89.5 96.641 -7.14102 7.6343 -0.935383 +#> ds 5 parent 7 91.7 90.412 1.28752 7.1423 0.180267 +#> ds 5 parent 7 95.1 90.412 4.68752 7.1423 0.656305 +#> ds 5 parent 14 82.2 80.463 1.73715 6.3563 0.273296 +#> ds 5 parent 14 84.5 80.463 4.03715 6.3563 0.635141 +#> ds 5 parent 28 60.5 63.728 -3.22788 5.0343 -0.641178 +#> ds 5 parent 28 72.8 63.728 9.07212 5.0343 1.802063 +#> ds 5 parent 60 38.3 37.399 0.90061 2.9544 0.304835 +#> ds 5 parent 60 40.7 37.399 3.30061 2.9544 1.117174 +#> ds 5 parent 90 22.5 22.692 -0.19165 1.7926 -0.106913 +#> ds 5 parent 90 20.8 22.692 -1.89165 1.7926 -1.055273 +#> ds 5 parent 120 13.4 13.768 -0.36790 1.0876 -0.338259 +#> ds 5 parent 120 13.8 13.768 0.03210 1.0876 0.029517</div><div class='input'> +</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"> + <h2 data-toc-skip>Contents</h2> + </nav> + </div> +</div> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/reference/synthetic_data_for_UBA_2014-1.png b/docs/reference/synthetic_data_for_UBA_2014-1.png Binary files differindex 02976ced..4f11753e 100644 --- a/docs/reference/synthetic_data_for_UBA_2014-1.png +++ b/docs/reference/synthetic_data_for_UBA_2014-1.png diff --git a/docs/reference/synthetic_data_for_UBA_2014.html b/docs/reference/synthetic_data_for_UBA_2014.html index 1444be76..af8bdcb2 100644 --- a/docs/reference/synthetic_data_for_UBA_2014.html +++ b/docs/reference/synthetic_data_for_UBA_2014.html @@ -87,7 +87,7 @@ Compare also the code in the example section to see the degradation models." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,6 +124,9 @@ Compare also the code in the example section to see the degradation models." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -132,8 +135,8 @@ Compare also the code in the example section to see the degradation models." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -174,13 +177,13 @@ Compare also the code in the example section to see the degradation models." /> <p>Compare also the code in the example section to see the degradation models.</p> </div> - <pre class="usage"><span class='no'>synthetic_data_for_UBA_2014</span></pre> + <pre class="usage"><span class='va'>synthetic_data_for_UBA_2014</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <p>A list containing twelve datasets as an R6 class defined by <code><a href='mkinds.html'>mkinds</a></code>, - each containing, among others, the following components</p><dl'> + each containing, among others, the following components</p><dl> <dt><code>title</code></dt><dd><p>The name of the dataset, e.g. <code>SFO_lin_a</code></p></dd> <dt><code>data</code></dt><dd><p>A data frame with the data in the form expected by <code><a href='mkinfit.html'>mkinfit</a></code></p></dd> @@ -196,55 +199,59 @@ Compare also the code in the example section to see the degradation models." /> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> <span class='co'># The data have been generated using the following kinetic models</span> -<span class='no'>m_synth_SFO_lin</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M1"</span>), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M2"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> - -<span class='no'>m_synth_SFO_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>), - <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>m_synth_DFOP_lin</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"DFOP"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M1"</span>), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"M2"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>m_synth_DFOP_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"DFOP"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>), - <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> +<span class='va'>m_synth_SFO_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"M2"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> + +<span class='va'>m_synth_SFO_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, + sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>m_synth_DFOP_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='st'>"M1"</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"M2"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"DFOP"</span>, to <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, + sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='co'># The model predictions without intentional error were generated as follows</span> -<span class='no'>sampling_times</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span>) - -<span class='no'>d_synth_SFO_lin</span> <span class='kw'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span>(<span class='no'>m_synth_SFO_lin</span>, - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k_parent</span> <span class='kw'>=</span> <span class='fl'>0.7</span>, <span class='kw'>f_parent_to_M1</span> <span class='kw'>=</span> <span class='fl'>0.8</span>, - <span class='kw'>k_M1</span> <span class='kw'>=</span> <span class='fl'>0.3</span>, <span class='kw'>f_M1_to_M2</span> <span class='kw'>=</span> <span class='fl'>0.7</span>, - <span class='kw'>k_M2</span> <span class='kw'>=</span> <span class='fl'>0.02</span>), - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fl'>0</span>), - <span class='no'>sampling_times</span>) - -<span class='no'>d_synth_DFOP_lin</span> <span class='kw'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span>(<span class='no'>m_synth_DFOP_lin</span>, - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k1</span> <span class='kw'>=</span> <span class='fl'>0.2</span>, <span class='kw'>k2</span> <span class='kw'>=</span> <span class='fl'>0.02</span>, <span class='kw'>g</span> <span class='kw'>=</span> <span class='fl'>0.5</span>, - <span class='kw'>f_parent_to_M1</span> <span class='kw'>=</span> <span class='fl'>0.5</span>, <span class='kw'>k_M1</span> <span class='kw'>=</span> <span class='fl'>0.3</span>, - <span class='kw'>f_M1_to_M2</span> <span class='kw'>=</span> <span class='fl'>0.7</span>, <span class='kw'>k_M2</span> <span class='kw'>=</span> <span class='fl'>0.02</span>), - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fl'>0</span>), - <span class='no'>sampling_times</span>) - -<span class='no'>d_synth_SFO_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span>(<span class='no'>m_synth_SFO_par</span>, - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k_parent</span> <span class='kw'>=</span> <span class='fl'>0.2</span>, - <span class='kw'>f_parent_to_M1</span> <span class='kw'>=</span> <span class='fl'>0.8</span>, <span class='kw'>k_M1</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, - <span class='kw'>f_parent_to_M2</span> <span class='kw'>=</span> <span class='fl'>0.2</span>, <span class='kw'>k_M2</span> <span class='kw'>=</span> <span class='fl'>0.02</span>), - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fl'>0</span>), - <span class='no'>sampling_times</span>) - -<span class='no'>d_synth_DFOP_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span>(<span class='no'>m_synth_DFOP_par</span>, - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>k1</span> <span class='kw'>=</span> <span class='fl'>0.3</span>, <span class='kw'>k2</span> <span class='kw'>=</span> <span class='fl'>0.02</span>, <span class='kw'>g</span> <span class='kw'>=</span> <span class='fl'>0.7</span>, - <span class='kw'>f_parent_to_M1</span> <span class='kw'>=</span> <span class='fl'>0.6</span>, <span class='kw'>k_M1</span> <span class='kw'>=</span> <span class='fl'>0.04</span>, - <span class='kw'>f_parent_to_M2</span> <span class='kw'>=</span> <span class='fl'>0.4</span>, <span class='kw'>k_M2</span> <span class='kw'>=</span> <span class='fl'>0.01</span>), - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fl'>0</span>), - <span class='no'>sampling_times</span>) +<span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> + +<span class='va'>d_synth_SFO_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_synth_SFO_lin</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='fl'>0.7</span>, f_parent_to_M1 <span class='op'>=</span> <span class='fl'>0.8</span>, + k_M1 <span class='op'>=</span> <span class='fl'>0.3</span>, f_M1_to_M2 <span class='op'>=</span> <span class='fl'>0.7</span>, + k_M2 <span class='op'>=</span> <span class='fl'>0.02</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, M1 <span class='op'>=</span> <span class='fl'>0</span>, M2 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, + <span class='va'>sampling_times</span><span class='op'>)</span> + +<span class='va'>d_synth_DFOP_lin</span> <span class='op'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_lin</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k1 <span class='op'>=</span> <span class='fl'>0.2</span>, k2 <span class='op'>=</span> <span class='fl'>0.02</span>, g <span class='op'>=</span> <span class='fl'>0.5</span>, + f_parent_to_M1 <span class='op'>=</span> <span class='fl'>0.5</span>, k_M1 <span class='op'>=</span> <span class='fl'>0.3</span>, + f_M1_to_M2 <span class='op'>=</span> <span class='fl'>0.7</span>, k_M2 <span class='op'>=</span> <span class='fl'>0.02</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, M1 <span class='op'>=</span> <span class='fl'>0</span>, M2 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, + <span class='va'>sampling_times</span><span class='op'>)</span> + +<span class='va'>d_synth_SFO_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_synth_SFO_par</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='fl'>0.2</span>, + f_parent_to_M1 <span class='op'>=</span> <span class='fl'>0.8</span>, k_M1 <span class='op'>=</span> <span class='fl'>0.01</span>, + f_parent_to_M2 <span class='op'>=</span> <span class='fl'>0.2</span>, k_M2 <span class='op'>=</span> <span class='fl'>0.02</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, M1 <span class='op'>=</span> <span class='fl'>0</span>, M2 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, + <span class='va'>sampling_times</span><span class='op'>)</span> + +<span class='va'>d_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_par</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k1 <span class='op'>=</span> <span class='fl'>0.3</span>, k2 <span class='op'>=</span> <span class='fl'>0.02</span>, g <span class='op'>=</span> <span class='fl'>0.7</span>, + f_parent_to_M1 <span class='op'>=</span> <span class='fl'>0.6</span>, k_M1 <span class='op'>=</span> <span class='fl'>0.04</span>, + f_parent_to_M2 <span class='op'>=</span> <span class='fl'>0.4</span>, k_M2 <span class='op'>=</span> <span class='fl'>0.01</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, M1 <span class='op'>=</span> <span class='fl'>0</span>, M2 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, + <span class='va'>sampling_times</span><span class='op'>)</span> <span class='co'># Construct names for datasets with errors</span> -<span class='no'>d_synth_names</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='st'>"d_synth_"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"SFO_lin"</span>, <span class='st'>"SFO_par"</span>, - <span class='st'>"DFOP_lin"</span>, <span class='st'>"DFOP_par"</span>)) +<span class='va'>d_synth_names</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span><span class='op'>(</span><span class='st'>"d_synth_"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO_lin"</span>, <span class='st'>"SFO_par"</span>, + <span class='st'>"DFOP_lin"</span>, <span class='st'>"DFOP_par"</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># Original function used or adding errors. The add_err function now published</span> <span class='co'># with this package is a slightly generalised version where the names of</span> @@ -265,33 +272,35 @@ Compare also the code in the example section to see the degradation models." /> <span class='co'># The following is the simplified version of the two-component model of Rocke</span> <span class='co'># and Lorenzato (1995)</span> -<span class='no'>sdfunc_twocomp</span> <span class='kw'>=</span> <span class='kw'>function</span>(<span class='no'>value</span>, <span class='no'>sd_low</span>, <span class='no'>rsd_high</span>) { - <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span>(<span class='no'>sd_low</span>^<span class='fl'>2</span> + <span class='no'>value</span>^<span class='fl'>2</span> * <span class='no'>rsd_high</span>^<span class='fl'>2</span>) -} +<span class='va'>sdfunc_twocomp</span> <span class='op'>=</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span>, <span class='va'>sd_low</span>, <span class='va'>rsd_high</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span><span class='op'>(</span><span class='va'>sd_low</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>+</span> <span class='va'>value</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>*</span> <span class='va'>rsd_high</span><span class='op'>^</span><span class='fl'>2</span><span class='op'>)</span> +<span class='op'>}</span> <span class='co'># Add the errors.</span> -<span class='kw'>for</span> (<span class='no'>d_synth_name</span> <span class='kw'>in</span> <span class='no'>d_synth_names</span>) -{ - <span class='no'>d_synth</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/get.html'>get</a></span>(<span class='no'>d_synth_name</span>) - <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='no'>d_synth_name</span>, <span class='st'>"_a"</span>), <span class='fu'><a href='add_err.html'>add_err</a></span>(<span class='no'>d_synth</span>, <span class='kw'>function</span>(<span class='no'>value</span>) <span class='fl'>3</span>)) - <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='no'>d_synth_name</span>, <span class='st'>"_b"</span>), <span class='fu'><a href='add_err.html'>add_err</a></span>(<span class='no'>d_synth</span>, <span class='kw'>function</span>(<span class='no'>value</span>) <span class='fl'>7</span>)) - <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='no'>d_synth_name</span>, <span class='st'>"_c"</span>), <span class='fu'><a href='add_err.html'>add_err</a></span>(<span class='no'>d_synth</span>, - <span class='kw'>function</span>(<span class='no'>value</span>) <span class='fu'>sdfunc_twocomp</span>(<span class='no'>value</span>, <span class='fl'>0.5</span>, <span class='fl'>0.07</span>))) +<span class='kw'>for</span> <span class='op'>(</span><span class='va'>d_synth_name</span> <span class='kw'>in</span> <span class='va'>d_synth_names</span><span class='op'>)</span> +<span class='op'>{</span> + <span class='va'>d_synth</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/get.html'>get</a></span><span class='op'>(</span><span class='va'>d_synth_name</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span><span class='op'>(</span><span class='va'>d_synth_name</span>, <span class='st'>"_a"</span><span class='op'>)</span>, <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>d_synth</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fl'>3</span><span class='op'>)</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span><span class='op'>(</span><span class='va'>d_synth_name</span>, <span class='st'>"_b"</span><span class='op'>)</span>, <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>d_synth</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fl'>7</span><span class='op'>)</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/assign.html'>assign</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span><span class='op'>(</span><span class='va'>d_synth_name</span>, <span class='st'>"_c"</span><span class='op'>)</span>, <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>d_synth</span>, + <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fu'>sdfunc_twocomp</span><span class='op'>(</span><span class='va'>value</span>, <span class='fl'>0.5</span>, <span class='fl'>0.07</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span> -} +<span class='op'>}</span> -<span class='no'>d_synth_err_names</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>( - <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='no'>d_synth_names</span>, <span class='kw'>each</span> <span class='kw'>=</span> <span class='fl'>3</span>), <span class='no'>letters</span>[<span class='fl'>1</span>:<span class='fl'>3</span>], <span class='kw'>sep</span> <span class='kw'>=</span> <span class='st'>"_"</span>) -) +<span class='va'>d_synth_err_names</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span> + <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span><span class='op'>(</span><span class='va'>d_synth_names</span>, each <span class='op'>=</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>letters</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>]</span>, sep <span class='op'>=</span> <span class='st'>"_"</span><span class='op'>)</span> +<span class='op'>)</span> <span class='co'># This is just one example of an evaluation using the kinetic model used for</span> <span class='co'># the generation of the data</span> - <span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_synth_SFO_lin</span>, <span class='no'>synthetic_data_for_UBA_2014</span><span class='kw'>[[</span><span class='fl'>1</span>]]$<span class='no'>data</span>, - <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) - <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span>(<span class='no'>fit</span>)</div><div class='img'><img src='synthetic_data_for_UBA_2014-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.50.2 -#> R version used for fitting: 4.0.0 -#> Date of fit: Wed May 27 07:05:27 2020 -#> Date of summary: Wed May 27 07:05:27 2020 + <span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_SFO_lin</span>, <span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, + quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='img'><img src='synthetic_data_for_UBA_2014-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='output co'>#> mkin version used for fitting: 1.0.0 +#> R version used for fitting: 4.0.3 +#> Date of fit: Wed Feb 3 17:32:06 2021 +#> Date of summary: Wed Feb 3 17:32:06 2021 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -300,7 +309,7 @@ Compare also the code in the example section to see the degradation models." /> #> #> Model predictions using solution type deSolve #> -#> Fitted using 817 model solutions performed in 0.627 s +#> Fitted using 822 model solutions performed in 0.645 s #> #> Error model: Constant variance #> @@ -316,13 +325,13 @@ Compare also the code in the example section to see the degradation models." /> #> f_M1_to_M2 0.5000 deparm #> #> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 101.350000 -Inf Inf -#> log_k_parent -2.302585 -Inf Inf -#> log_k_M1 -2.301586 -Inf Inf -#> log_k_M2 -2.300587 -Inf Inf -#> f_parent_ilr_1 0.000000 -Inf Inf -#> f_M1_ilr_1 0.000000 -Inf Inf +#> value lower upper +#> parent_0 101.350000 -Inf Inf +#> log_k_parent -2.302585 -Inf Inf +#> log_k_M1 -2.301586 -Inf Inf +#> log_k_M2 -2.300587 -Inf Inf +#> f_parent_qlogis 0.000000 -Inf Inf +#> f_M1_qlogis 0.000000 -Inf Inf #> #> Fixed parameter values: #> value type @@ -335,32 +344,32 @@ Compare also the code in the example section to see the degradation models." /> #> 188.7274 200.3723 -87.36368 #> #> Optimised, transformed parameters with symmetric confidence intervals: -#> Estimate Std. Error Lower Upper -#> parent_0 102.1000 1.57000 98.8600 105.3000 -#> log_k_parent -0.3020 0.03885 -0.3812 -0.2229 -#> log_k_M1 -1.2070 0.07123 -1.3520 -1.0620 -#> log_k_M2 -3.9010 0.06571 -4.0350 -3.7670 -#> f_parent_ilr_1 0.8492 0.16640 0.5103 1.1880 -#> f_M1_ilr_1 0.6780 0.17600 0.3196 1.0360 -#> sigma 2.2730 0.25740 1.7490 2.7970 +#> Estimate Std. Error Lower Upper +#> parent_0 102.1000 1.57000 98.8600 105.3000 +#> log_k_parent -0.3020 0.03885 -0.3812 -0.2229 +#> log_k_M1 -1.2070 0.07123 -1.3520 -1.0620 +#> log_k_M2 -3.9010 0.06571 -4.0350 -3.7670 +#> f_parent_qlogis 1.2010 0.23530 0.7216 1.6800 +#> f_M1_qlogis 0.9589 0.24890 0.4520 1.4660 +#> sigma 2.2730 0.25740 1.7490 2.7970 #> #> Parameter correlation: -#> parent_0 log_k_parent log_k_M1 log_k_M2 f_parent_ilr_1 -#> parent_0 1.000e+00 3.933e-01 -1.605e-01 2.819e-02 -4.624e-01 -#> log_k_parent 3.933e-01 1.000e+00 -4.082e-01 7.166e-02 -5.682e-01 -#> log_k_M1 -1.605e-01 -4.082e-01 1.000e+00 -3.929e-01 7.478e-01 -#> log_k_M2 2.819e-02 7.166e-02 -3.929e-01 1.000e+00 -2.658e-01 -#> f_parent_ilr_1 -4.624e-01 -5.682e-01 7.478e-01 -2.658e-01 1.000e+00 -#> f_M1_ilr_1 1.614e-01 4.102e-01 -8.109e-01 5.419e-01 -8.605e-01 -#> sigma -1.384e-07 -2.581e-07 9.499e-08 1.518e-07 1.236e-07 -#> f_M1_ilr_1 sigma -#> parent_0 1.614e-01 -1.384e-07 -#> log_k_parent 4.102e-01 -2.581e-07 -#> log_k_M1 -8.109e-01 9.499e-08 -#> log_k_M2 5.419e-01 1.518e-07 -#> f_parent_ilr_1 -8.605e-01 1.236e-07 -#> f_M1_ilr_1 1.000e+00 8.795e-09 -#> sigma 8.795e-09 1.000e+00 +#> parent_0 log_k_parent log_k_M1 log_k_M2 f_parent_qlogis +#> parent_0 1.000e+00 3.933e-01 -1.605e-01 2.819e-02 -4.624e-01 +#> log_k_parent 3.933e-01 1.000e+00 -4.082e-01 7.166e-02 -5.682e-01 +#> log_k_M1 -1.605e-01 -4.082e-01 1.000e+00 -3.929e-01 7.478e-01 +#> log_k_M2 2.819e-02 7.166e-02 -3.929e-01 1.000e+00 -2.658e-01 +#> f_parent_qlogis -4.624e-01 -5.682e-01 7.478e-01 -2.658e-01 1.000e+00 +#> f_M1_qlogis 1.614e-01 4.102e-01 -8.109e-01 5.419e-01 -8.605e-01 +#> sigma -7.941e-08 -9.143e-09 -1.268e-08 5.947e-08 5.657e-08 +#> f_M1_qlogis sigma +#> parent_0 1.614e-01 -7.941e-08 +#> log_k_parent 4.102e-01 -9.143e-09 +#> log_k_M1 -8.109e-01 -1.268e-08 +#> log_k_M2 5.419e-01 5.947e-08 +#> f_parent_qlogis -8.605e-01 5.657e-08 +#> f_M1_qlogis 1.000e+00 -2.382e-10 +#> sigma -2.382e-10 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. @@ -407,8 +416,8 @@ Compare also the code in the example section to see the degradation models." /> #> 7 parent 0.3 5.772e-01 -0.27717 #> 14 parent 3.5 3.264e-03 3.49674 #> 28 parent 3.2 1.045e-07 3.20000 -#> 90 parent 0.6 9.535e-10 0.60000 -#> 120 parent 3.5 -5.941e-10 3.50000 +#> 90 parent 0.6 9.532e-10 0.60000 +#> 120 parent 3.5 -5.940e-10 3.50000 #> 1 M1 36.4 3.479e+01 1.61088 #> 1 M1 37.4 3.479e+01 2.61088 #> 3 M1 34.3 3.937e+01 -5.07027 @@ -418,9 +427,9 @@ Compare also the code in the example section to see the degradation models." /> #> 14 M1 5.8 1.995e+00 3.80469 #> 14 M1 1.2 1.995e+00 -0.79531 #> 60 M1 0.5 2.111e-06 0.50000 -#> 90 M1 3.2 -9.676e-10 3.20000 -#> 120 M1 1.5 7.671e-10 1.50000 -#> 120 M1 0.6 7.671e-10 0.60000 +#> 90 M1 3.2 -9.671e-10 3.20000 +#> 120 M1 1.5 7.670e-10 1.50000 +#> 120 M1 0.6 7.670e-10 0.60000 #> 1 M2 4.8 4.455e+00 0.34517 #> 3 M2 20.9 2.153e+01 -0.62527 #> 3 M2 19.3 2.153e+01 -2.22527 @@ -435,7 +444,7 @@ Compare also the code in the example section to see the degradation models." /> #> 90 M2 10.6 1.013e+01 0.47130 #> 90 M2 10.8 1.013e+01 0.67130 #> 120 M2 9.8 5.521e+00 4.27893 -#> 120 M2 3.3 5.521e+00 -2.22107</div><div class='input'># } +#> 120 M2 3.3 5.521e+00 -2.22107</div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -452,7 +461,7 @@ Compare also the code in the example section to see the degradation models." /> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/test_data_from_UBA_2014-1.png b/docs/reference/test_data_from_UBA_2014-1.png Binary files differindex 431181cf..168103ee 100644 --- a/docs/reference/test_data_from_UBA_2014-1.png +++ b/docs/reference/test_data_from_UBA_2014-1.png diff --git a/docs/reference/test_data_from_UBA_2014-2.png b/docs/reference/test_data_from_UBA_2014-2.png Binary files differindex 4a064163..68288aed 100644 --- a/docs/reference/test_data_from_UBA_2014-2.png +++ b/docs/reference/test_data_from_UBA_2014-2.png diff --git a/docs/reference/test_data_from_UBA_2014.html b/docs/reference/test_data_from_UBA_2014.html index 6059a4d2..eeaef9e0 100644 --- a/docs/reference/test_data_from_UBA_2014.html +++ b/docs/reference/test_data_from_UBA_2014.html @@ -73,7 +73,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -110,6 +110,9 @@ <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -118,8 +121,8 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -146,13 +149,13 @@ software packages (Ranke, 2014).</p> </div> - <pre class="usage"><span class='no'>test_data_from_UBA_2014</span></pre> + <pre class="usage"><span class='va'>test_data_from_UBA_2014</span></pre> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <p>A list containing three datasets as an R6 class defined by <code><a href='mkinds.html'>mkinds</a></code>. - Each dataset has, among others, the following components</p><dl'> + Each dataset has, among others, the following components</p><dl> <dt><code>title</code></dt><dd><p>The name of the dataset, e.g. <code>UBA_2014_WS_river</code></p></dd> <dt><code>data</code></dt><dd><p>A data frame with the data in the form expected by <code><a href='mkinfit.html'>mkinfit</a></code></p></dd> @@ -171,52 +174,62 @@ <span class='co'># generally considered deprecated due to the frequent occurrence of such</span> <span class='co'># large parameter correlations, among other reasons (e.g. the adequacy of the</span> <span class='co'># model).</span> - <span class='no'>m_ws</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent_w</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"parent_s"</span>), - <span class='kw'>parent_s</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"parent_w"</span>))</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> <span class='no'>f_river</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_ws</span>, <span class='no'>test_data_from_UBA_2014</span><span class='kw'>[[</span><span class='fl'>1</span>]]$<span class='no'>data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span>(<span class='no'>f_river</span>)</div><div class='img'><img src='test_data_from_UBA_2014-1.png' alt='' width='700' height='433' /></div><div class='input'> - <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>f_river</span>)$<span class='no'>bpar</span></div><div class='output co'>#> <span class='warning'>Warning: Could not calculate correlation; no covariance matrix</span></div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_w_0 95.91998116 NA NA NA NA NA + <span class='va'>m_ws</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent_w <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"parent_s"</span><span class='op'>)</span>, + parent_s <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"parent_w"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='va'>f_river</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_ws</span>, <span class='va'>test_data_from_UBA_2014</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span><span class='op'>(</span><span class='va'>f_river</span><span class='op'>)</span> +</div><div class='img'><img src='test_data_from_UBA_2014-1.png' alt='' width='700' height='433' /></div><div class='input'> + <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>f_river</span><span class='op'>)</span><span class='op'>$</span><span class='va'>bpar</span> +</div><div class='output co'>#> <span class='warning'>Warning: Could not calculate correlation; no covariance matrix</span></div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_w_0 95.91998118 NA NA NA NA NA #> k_parent_w 0.41145375 NA NA NA NA NA #> k_parent_s 0.04663944 NA NA NA NA NA #> f_parent_w_to_parent_s 0.12467894 NA NA NA NA NA #> f_parent_s_to_parent_w 0.50000000 NA NA NA NA NA -#> sigma 3.13612618 NA NA NA NA NA</div><div class='input'> <span class='fu'><a href='mkinerrmin.html'>mkinerrmin</a></span>(<span class='no'>f_river</span>)</div><div class='output co'>#> err.min n.optim df +#> sigma 3.13612618 NA NA NA NA NA</div><div class='input'> <span class='fu'><a href='mkinerrmin.html'>mkinerrmin</a></span><span class='op'>(</span><span class='va'>f_river</span><span class='op'>)</span> +</div><div class='output co'>#> err.min n.optim df #> All data 0.1090929 5 6 #> parent_w 0.0817436 3 3 #> parent_s 0.1619965 2 3</div><div class='input'> <span class='co'># This is the evaluation used for the validation of software packages</span> <span class='co'># in the expertise from 2014</span> - <span class='no'>m_soil</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>)), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"M3"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"M3"</span>), - <span class='kw'>M3</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> - <span class='no'>f_soil</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_soil</span>, <span class='no'>test_data_from_UBA_2014</span><span class='kw'>[[</span><span class='fl'>3</span>]]$<span class='no'>data</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span>(<span class='no'>f_soil</span>, <span class='kw'>lpos</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"topright"</span>, <span class='st'>"topright"</span>, <span class='st'>"topright"</span>, <span class='st'>"bottomright"</span>))</div><div class='img'><img src='test_data_from_UBA_2014-2.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>f_soil</span>)$<span class='no'>bpar</span></div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 76.55425584 0.859186419 89.1008681 1.113862e-26 74.755958720 -#> k_parent 0.12081956 0.004601919 26.2541703 1.077361e-16 0.111561576 -#> k_M1 0.84258629 0.806165149 1.0451783 1.545282e-01 0.113778910 -#> k_M2 0.04210878 0.017083049 2.4649452 1.170195e-02 0.018013823 -#> k_M3 0.01122919 0.007245870 1.5497364 6.885076e-02 0.002909418 -#> f_parent_to_M1 0.32240193 0.240785518 1.3389590 9.819221e-02 NA -#> f_parent_to_M2 0.16099854 0.033691991 4.7785404 6.531224e-05 NA -#> f_M1_to_M3 0.27921506 0.269425582 1.0363346 1.565282e-01 0.022977955 -#> f_M2_to_M3 0.55641331 0.595121774 0.9349571 1.807710e-01 0.008002320 + <span class='va'>m_soil</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M3"</span><span class='op'>)</span>, + M2 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M3"</span><span class='op'>)</span>, + M3 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> + <span class='va'>f_soil</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_soil</span>, <span class='va'>test_data_from_UBA_2014</span><span class='op'>[[</span><span class='fl'>3</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'> <span class='fu'><a href='plot.mkinfit.html'>plot_sep</a></span><span class='op'>(</span><span class='va'>f_soil</span>, lpos <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"topright"</span>, <span class='st'>"topright"</span>, <span class='st'>"topright"</span>, <span class='st'>"bottomright"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='img'><img src='test_data_from_UBA_2014-2.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>f_soil</span><span class='op'>)</span><span class='op'>$</span><span class='va'>bpar</span> +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower +#> parent_0 76.55425649 0.859186399 89.1008710 1.113861e-26 74.755959406 +#> k_parent 0.12081956 0.004601918 26.2541722 1.077359e-16 0.111561575 +#> k_M1 0.84258614 0.806159820 1.0451850 1.545267e-01 0.113779670 +#> k_M2 0.04210880 0.017083035 2.4649483 1.170188e-02 0.018013857 +#> k_M3 0.01122918 0.007245855 1.5497385 6.885052e-02 0.002909431 +#> f_parent_to_M1 0.32240200 0.240783909 1.3389682 9.819073e-02 NA +#> f_parent_to_M2 0.16099855 0.033691953 4.7785463 6.531137e-05 NA +#> f_M1_to_M3 0.27921507 0.269423745 1.0363417 1.565266e-01 0.022978220 +#> f_M2_to_M3 0.55641253 0.595119954 0.9349586 1.807707e-01 0.008002509 #> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 #> Upper -#> parent_0 78.35255297 +#> parent_0 78.35255357 #> k_parent 0.13084582 -#> k_M1 6.23974738 -#> k_M2 0.09843271 -#> k_M3 0.04334017 +#> k_M1 6.23970352 +#> k_M2 0.09843260 +#> k_M3 0.04333992 #> f_parent_to_M1 NA #> f_parent_to_M2 NA -#> f_M1_to_M3 0.86450905 -#> f_M2_to_M3 0.99489911 -#> sigma 1.45337221</div><div class='input'> <span class='fu'><a href='mkinerrmin.html'>mkinerrmin</a></span>(<span class='no'>f_soil</span>)</div><div class='output co'>#> err.min n.optim df +#> f_M1_to_M3 0.86450768 +#> f_M2_to_M3 0.99489895 +#> sigma 1.45337221</div><div class='input'> <span class='fu'><a href='mkinerrmin.html'>mkinerrmin</a></span><span class='op'>(</span><span class='va'>f_soil</span><span class='op'>)</span> +</div><div class='output co'>#> err.min n.optim df #> All data 0.09649963 9 20 #> parent 0.04721283 2 6 #> M1 0.26551208 2 5 #> M2 0.20327575 2 5 -#> M3 0.05196550 3 4</div><div class='input'> # } +#> M3 0.05196550 3 4</div><div class='input'> <span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -233,7 +246,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 9b84d6bf..efaf7b46 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -77,7 +77,7 @@ the ilr transformation is used." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -114,6 +114,9 @@ the ilr transformation is used." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -122,8 +125,8 @@ the ilr transformation is used." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -141,7 +144,7 @@ the ilr transformation is used." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Functions to transform and backtransform kinetic parameters for fitting</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/transform_odeparms.R'><code>R/transform_odeparms.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/transform_odeparms.R'><code>R/transform_odeparms.R</code></a></small> <div class="hidden name"><code>transform_odeparms.Rd</code></div> </div> @@ -151,22 +154,22 @@ restricted values to the full scale of real numbers. For kinetic rate constants and other parameters that can only take on positive values, a simple log transformation is used. For compositional parameters, such as the formations fractions that should always sum up to 1 and can not be negative, -the <code><a href='ilr.html'>ilr</a></code> transformation is used.</p> +the <a href='ilr.html'>ilr</a> transformation is used.</p> </div> - <pre class="usage"><span class='fu'>transform_odeparms</span>( - <span class='no'>parms</span>, - <span class='no'>mkinmod</span>, - <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, - <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span> -) + <pre class="usage"><span class='fu'>transform_odeparms</span><span class='op'>(</span> + <span class='va'>parms</span>, + <span class='va'>mkinmod</span>, + transform_rates <span class='op'>=</span> <span class='cn'>TRUE</span>, + transform_fractions <span class='op'>=</span> <span class='cn'>TRUE</span> +<span class='op'>)</span> -<span class='fu'>backtransform_odeparms</span>( - <span class='no'>transparms</span>, - <span class='no'>mkinmod</span>, - <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, - <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span> -)</pre> +<span class='fu'>backtransform_odeparms</span><span class='op'>(</span> + <span class='va'>transparms</span>, + <span class='va'>mkinmod</span>, + transform_rates <span class='op'>=</span> <span class='cn'>TRUE</span>, + transform_fractions <span class='op'>=</span> <span class='cn'>TRUE</span> +<span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -178,9 +181,9 @@ equations.</p></td> </tr> <tr> <th>mkinmod</th> - <td><p>The kinetic model of class <code><a href='mkinmod.html'>mkinmod</a></code>, containing + <td><p>The kinetic model of class <a href='mkinmod.html'>mkinmod</a>, containing the names of the model variables that are needed for grouping the -formation fractions before <code><a href='ilr.html'>ilr</a></code> transformation, the parameter +formation fractions before <a href='ilr.html'>ilr</a> transformation, the parameter names and the information if the pathway to sink is included in the model.</p></td> </tr> <tr> @@ -197,10 +200,13 @@ models and the break point tb of the HS model.</p></td> <td><p>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. 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 <code><a href='ilr.html'>ilr</a></code> transformation.</p></td> +of the estimator. The default (TRUE) is to do transformations. +The g parameter of the DFOP model is also seen as a fraction. +If a single fraction is transformed (g parameter of DFOP or only a single +target variable e.g. a single metabolite plus a pathway to sink), a +logistic transformation is used <code><a href='https://rdrr.io/r/stats/Logistic.html'>stats::qlogis()</a></code>. In other cases, i.e. if +two or more formation fractions need to be transformed whose sum cannot +exceed one, the <a href='ilr.html'>ilr</a> transformation is used.</p></td> </tr> <tr> <th>transparms</th> @@ -211,86 +217,101 @@ fitting procedure.</p></td> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> - <p>A vector of transformed or backtransformed parameters with the same -names as the original parameters.</p> + <p>A vector of transformed or backtransformed parameters</p> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <p>The transformation of sets of formation fractions is fragile, as it supposes the same ordering of the components in forward and backward transformation. -This is no problem for the internal use in <code><a href='mkinfit.html'>mkinfit</a></code>.</p> - <h2 class="hasAnchor" id="functions"><a class="anchor" href="#functions"></a>Functions</h2> +This is no problem for the internal use in <a href='mkinfit.html'>mkinfit</a>.</p> + <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2> - -<ul> -<li><p><code>backtransform_odeparms</code>: Backtransform the set of transformed parameters</p></li> -</ul> + <p>Johannes Ranke</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> -<span class='no'>SFO_SFO</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>), - <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span> -<span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='no'>fit.s</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>fit</span>) +<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span>, sink <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span> +<span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='va'>fit.s</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> <span class='co'># Transformed and backtransformed parameters</span> -<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.s</span>$<span class='no'>par</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate Std. Error Lower Upper -#> parent_0 99.598 1.5702 96.4038 102.793 -#> log_k_parent -2.316 0.0409 -2.3988 -2.233 -#> log_k_m1 -5.248 0.1332 -5.5184 -4.977 -#> f_parent_ilr_1 0.041 0.0631 -0.0875 0.169 -#> sigma 3.126 0.3585 2.3961 3.855</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.s</span>$<span class='no'>bpar</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.s</span><span class='op'>$</span><span class='va'>par</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate Std. Error Lower Upper +#> parent_0 99.5985 1.5702 96.404 102.79 +#> log_k_parent -2.3157 0.0409 -2.399 -2.23 +#> log_k_m1 -5.2475 0.1332 -5.518 -4.98 +#> f_parent_qlogis 0.0579 0.0893 -0.124 0.24 +#> sigma 3.1255 0.3585 2.396 3.85</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.s</span><span class='op'>$</span><span class='va'>bpar</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40383 102.7931 #> k_parent 0.09870 0.00403 24.47 4.96e-23 0.09082 0.1073 #> k_m1 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 #> f_parent_to_m1 0.51448 0.02230 23.07 3.10e-22 0.46912 0.5596 #> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549</div><div class='input'> <span class='co'># \dontrun{</span> <span class='co'># Compare to the version without transforming rate parameters</span> -<span class='no'>fit.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='error'>Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", cost.current, "\n", sep = "")}: missing value where TRUE/FALSE needed</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0.002 0 0.002</span></div><div class='input'><span class='no'>fit.2.s</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>fit.2</span>)</div><div class='output co'>#> <span class='error'>Error in summary(fit.2): object 'fit.2' not found</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.2.s</span>$<span class='no'>par</span>, <span class='fl'>3</span>)</div><div class='output co'>#> <span class='error'>Error in print(fit.2.s$par, 3): object 'fit.2.s' not found</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.2.s</span>$<span class='no'>bpar</span>, <span class='fl'>3</span>)</div><div class='output co'>#> <span class='error'>Error in print(fit.2.s$bpar, 3): object 'fit.2.s' not found</span></div><div class='input'><span class='co'># }</span> - -<span class='no'>initials</span> <span class='kw'><-</span> <span class='no'>fit</span>$<span class='no'>start</span>$<span class='no'>value</span> -<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span>(<span class='no'>initials</span>) <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>rownames</a></span>(<span class='no'>fit</span>$<span class='no'>start</span>) -<span class='no'>transformed</span> <span class='kw'><-</span> <span class='no'>fit</span>$<span class='no'>start_transformed</span>$<span class='no'>value</span> -<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span>(<span class='no'>transformed</span>) <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>rownames</a></span>(<span class='no'>fit</span>$<span class='no'>start_transformed</span>) -<span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#> parent_0 log_k_parent log_k_m1 f_parent_ilr_1 -#> 100.750000 -2.302585 -2.301586 0.000000 </div><div class='input'><span class='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#> parent_0 k_parent k_m1 f_parent_to_m1 +<span class='va'>fit.2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='va'>FOCUS_2006_D</span>, transform_rates <span class='op'>=</span> <span class='cn'>FALSE</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='output co'>#> <span class='error'>Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", signif(cost.current, 6), "\n", sep = "")}: missing value where TRUE/FALSE needed</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0.003 0 0.003</span></div><div class='input'><span class='va'>fit.2.s</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.2</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in summary(fit.2): object 'fit.2' not found</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.2.s</span><span class='op'>$</span><span class='va'>par</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in print(fit.2.s$par, 3): object 'fit.2.s' not found</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.2.s</span><span class='op'>$</span><span class='va'>bpar</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in print(fit.2.s$bpar, 3): object 'fit.2.s' not found</span></div><div class='input'><span class='co'># }</span> + +<span class='va'>initials</span> <span class='op'><-</span> <span class='va'>fit</span><span class='op'>$</span><span class='va'>start</span><span class='op'>$</span><span class='va'>value</span> +<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>initials</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>rownames</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>$</span><span class='va'>start</span><span class='op'>)</span> +<span class='va'>transformed</span> <span class='op'><-</span> <span class='va'>fit</span><span class='op'>$</span><span class='va'>start_transformed</span><span class='op'>$</span><span class='va'>value</span> +<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>transformed</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>rownames</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>$</span><span class='va'>start_transformed</span><span class='op'>)</span> +<span class='fu'>transform_odeparms</span><span class='op'>(</span><span class='va'>initials</span>, <span class='va'>SFO_SFO</span><span class='op'>)</span> +</div><div class='output co'>#> parent_0 log_k_parent log_k_m1 f_parent_qlogis +#> 100.750000 -2.302585 -2.301586 0.000000 </div><div class='input'><span class='fu'>backtransform_odeparms</span><span class='op'>(</span><span class='va'>transformed</span>, <span class='va'>SFO_SFO</span><span class='op'>)</span> +</div><div class='output co'>#> parent_0 k_parent k_m1 f_parent_to_m1 #> 100.7500 0.1000 0.1001 0.5000 </div><div class='input'> <span class='co'># \dontrun{</span> <span class='co'># The case of formation fractions</span> -<span class='no'>SFO_SFO.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>), - <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='no'>fit.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='no'>fit.ff.s</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>fit.ff</span>) -<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.ff.s</span>$<span class='no'>par</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate Std. Error Lower Upper -#> parent_0 99.598 1.5702 96.4038 102.793 -#> log_k_parent -2.316 0.0409 -2.3988 -2.233 -#> log_k_m1 -5.248 0.1332 -5.5184 -4.977 -#> f_parent_ilr_1 0.041 0.0631 -0.0875 0.169 -#> sigma 3.126 0.3585 2.3961 3.855</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.ff.s</span>$<span class='no'>bpar</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper -#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40384 102.7931 +<span class='va'>SFO_SFO.ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span>, sink <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>fit.ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.ff</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='va'>fit.ff.s</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.ff</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.ff.s</span><span class='op'>$</span><span class='va'>par</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate Std. Error Lower Upper +#> parent_0 99.5985 1.5702 96.404 102.79 +#> log_k_parent -2.3157 0.0409 -2.399 -2.23 +#> log_k_m1 -5.2475 0.1332 -5.518 -4.98 +#> f_parent_qlogis 0.0579 0.0893 -0.124 0.24 +#> sigma 3.1255 0.3585 2.396 3.85</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.ff.s</span><span class='op'>$</span><span class='va'>bpar</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper +#> parent_0 99.59848 1.57022 63.43 2.30e-36 96.40383 102.7931 #> k_parent 0.09870 0.00403 24.47 4.96e-23 0.09082 0.1073 #> k_m1 0.00526 0.00070 7.51 6.16e-09 0.00401 0.0069 #> f_parent_to_m1 0.51448 0.02230 23.07 3.10e-22 0.46912 0.5596 -#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549</div><div class='input'><span class='no'>initials</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"f_parent_to_m1"</span> <span class='kw'>=</span> <span class='fl'>0.5</span>) -<span class='no'>transformed</span> <span class='kw'><-</span> <span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO.ff</span>) -<span class='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO.ff</span>)</div><div class='output co'>#> f_parent_to_m1 +#> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549</div><div class='input'><span class='va'>initials</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"f_parent_to_m1"</span> <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span> +<span class='va'>transformed</span> <span class='op'><-</span> <span class='fu'>transform_odeparms</span><span class='op'>(</span><span class='va'>initials</span>, <span class='va'>SFO_SFO.ff</span><span class='op'>)</span> +<span class='fu'>backtransform_odeparms</span><span class='op'>(</span><span class='va'>transformed</span>, <span class='va'>SFO_SFO.ff</span><span class='op'>)</span> +</div><div class='output co'>#> f_parent_to_m1 #> 0.5 </div><div class='input'> <span class='co'># And without sink</span> -<span class='no'>SFO_SFO.ff.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( - <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>), - <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> - -<span class='no'>fit.ff.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff.2</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='no'>fit.ff.2.s</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>fit.ff.2</span>) -<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.ff.2.s</span>$<span class='no'>par</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate Std. Error Lower Upper +<span class='va'>SFO_SFO.ff.2</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span>, to <span class='op'>=</span> <span class='st'>"m1"</span>, sink <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>type <span class='op'>=</span> <span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> + +<span class='va'>fit.ff.2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.ff.2</span>, <span class='va'>FOCUS_2006_D</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='warning'>Warning: Observations with value of zero were removed from the data</span></div><div class='input'><span class='va'>fit.ff.2.s</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>fit.ff.2</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.ff.2.s</span><span class='op'>$</span><span class='va'>par</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate Std. Error Lower Upper #> parent_0 84.79 3.012 78.67 90.91 #> log_k_parent -2.76 0.082 -2.92 -2.59 #> log_k_m1 -4.21 0.123 -4.46 -3.96 -#> sigma 8.22 0.943 6.31 10.14</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>fit.ff.2.s</span>$<span class='no'>bpar</span>, <span class='fl'>3</span>)</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper +#> sigma 8.22 0.943 6.31 10.14</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>fit.ff.2.s</span><span class='op'>$</span><span class='va'>bpar</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> Estimate se_notrans t value Pr(>t) Lower Upper #> parent_0 84.7916 3.01203 28.15 1.92e-25 78.6704 90.913 #> k_parent 0.0635 0.00521 12.19 2.91e-14 0.0538 0.075 #> k_m1 0.0148 0.00182 8.13 8.81e-10 0.0115 0.019 -#> sigma 8.2229 0.94323 8.72 1.73e-10 6.3060 10.140</div><div class='input'># } +#> sigma 8.2229 0.94323 8.72 1.73e-10 6.3060 10.140</div><div class='input'><span class='co'># }</span> </div></pre> </div> @@ -308,7 +329,7 @@ This is no problem for the internal use in <code><a href='mkinfit.html'>mkinfit< </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/reference/update.mkinfit-1.png b/docs/reference/update.mkinfit-1.png Binary files differindex 4cbefa56..df8473c1 100644 --- a/docs/reference/update.mkinfit-1.png +++ b/docs/reference/update.mkinfit-1.png diff --git a/docs/reference/update.mkinfit-2.png b/docs/reference/update.mkinfit-2.png Binary files differindex f432f6f8..13c99b44 100644 --- a/docs/reference/update.mkinfit-2.png +++ b/docs/reference/update.mkinfit-2.png diff --git a/docs/reference/update.mkinfit.html b/docs/reference/update.mkinfit.html index 83b8c466..f7149d84 100644 --- a/docs/reference/update.mkinfit.html +++ b/docs/reference/update.mkinfit.html @@ -75,7 +75,7 @@ override these starting values." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -112,6 +112,9 @@ override these starting values." /> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + </li> </ul> </li> <li> @@ -120,8 +123,8 @@ override these starting values." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <a href="https://github.com/jranke/mkin/"> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -139,7 +142,7 @@ override these starting values." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Update an mkinfit model with different arguments</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/update.mkinfit.R'><code>R/update.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/update.mkinfit.R'><code>R/update.mkinfit.R</code></a></small> <div class="hidden name"><code>update.mkinfit.Rd</code></div> </div> @@ -151,7 +154,7 @@ override these starting values.</p> </div> <pre class="usage"><span class='co'># S3 method for mkinfit</span> -<span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>object</span>, <span class='no'>...</span>, <span class='kw'>evaluate</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</pre> +<span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span>, evaluate <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span></pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> @@ -175,11 +178,15 @@ remove arguments given in the original call</p></td> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'><span class='co'># \dontrun{</span> -<span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"SFO"</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>FOCUS_2006_D</span>, <span class='no'>value</span> <span class='kw'>!=</span> <span class='fl'>0</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='parms.html'>parms</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> parent_0 k_parent_sink sigma -#> 99.44423886 0.09793574 3.39632469 </div><div class='input'><span class='fu'><a href='plot.mkinfit.html'>plot_err</a></span>(<span class='no'>fit</span>)</div><div class='img'><img src='update.mkinfit-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='no'>fit_2</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>fit</span>, <span class='kw'>error_model</span> <span class='kw'>=</span> <span class='st'>"tc"</span>) -<span class='fu'><a href='parms.html'>parms</a></span>(<span class='no'>fit_2</span>)</div><div class='output co'>#> parent_0 k_parent_sink sigma_low rsd_high -#> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02 </div><div class='input'><span class='fu'><a href='plot.mkinfit.html'>plot_err</a></span>(<span class='no'>fit_2</span>)</div><div class='img'><img src='update.mkinfit-2.png' alt='' width='700' height='433' /></div><div class='input'># } +<span class='va'>fit</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='parms.html'>parms</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='output co'>#> parent_0 k_parent sigma +#> 99.44423885 0.09793574 3.39632469 </div><div class='input'><span class='fu'><a href='plot.mkinfit.html'>plot_err</a></span><span class='op'>(</span><span class='va'>fit</span><span class='op'>)</span> +</div><div class='img'><img src='update.mkinfit-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='va'>fit_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>fit</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> +<span class='fu'><a href='parms.html'>parms</a></span><span class='op'>(</span><span class='va'>fit_2</span><span class='op'>)</span> +</div><div class='output co'>#> parent_0 k_parent sigma_low rsd_high +#> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02 </div><div class='input'><span class='fu'><a href='plot.mkinfit.html'>plot_err</a></span><span class='op'>(</span><span class='va'>fit_2</span><span class='op'>)</span> +</div><div class='img'><img src='update.mkinfit-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -196,7 +203,7 @@ remove arguments given in the original call</p></td> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 81368436..7e3d8a53 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -10,6 +10,9 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/CAKE_export.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/D24_2014.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/DFOP.solution.html</loc> </url> <url> @@ -64,12 +67,21 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/create_deg_func.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/dimethenamid_2018.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/endpoints.html</loc> </url> <url> <loc>https://pkgdown.jrwb.de/mkin/reference/experimental_data_for_UBA.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/f_time_norm_focus.html</loc> + </url> + <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/focus_soil_moisture.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/get_deg_func.html</loc> </url> <url> @@ -94,6 +106,9 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/mccall81_245T.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/mixed.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/mkin_long_to_wide.html</loc> </url> <url> @@ -103,6 +118,9 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/mkinds.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/mkindsg.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/mkinerrmin.html</loc> </url> <url> @@ -127,9 +145,6 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/mkinresplot.html</loc> </url> <url> - <loc>https://pkgdown.jrwb.de/mkin/reference/mkinsub.html</loc> - </url> - <url> <loc>https://pkgdown.jrwb.de/mkin/reference/mmkin.html</loc> </url> <url> @@ -148,6 +163,9 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/parms.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/plot.mixed.mmkin.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/plot.mkinfit.html</loc> </url> <url> @@ -157,13 +175,7 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/plot.nafta.html</loc> </url> <url> - <loc>https://pkgdown.jrwb.de/mkin/reference/plot.nlme.mmkin.html</loc> - </url> - <url> - <loc>https://pkgdown.jrwb.de/mkin/reference/print.mkinds.html</loc> - </url> - <url> - <loc>https://pkgdown.jrwb.de/mkin/reference/print.mkinmod.html</loc> + <loc>https://pkgdown.jrwb.de/mkin/reference/print.mmkin.html</loc> </url> <url> <loc>https://pkgdown.jrwb.de/mkin/reference/reexports.html</loc> @@ -181,6 +193,9 @@ <loc>https://pkgdown.jrwb.de/mkin/reference/summary.mkinfit.html</loc> </url> <url> + <loc>https://pkgdown.jrwb.de/mkin/reference/summary.nlme.mmkin.html</loc> + </url> + <url> <loc>https://pkgdown.jrwb.de/mkin/reference/synthetic_data_for_UBA_2014.html</loc> </url> <url> diff --git a/man/endpoints.Rd b/man/endpoints.Rd index 72487717..0b225e62 100644 --- a/man/endpoints.Rd +++ b/man/endpoints.Rd @@ -8,8 +8,8 @@ with mkinfit} endpoints(fit) } \arguments{ -\item{fit}{An object of class \link{mkinfit}, \link{nlme.mmkin} or -\link{saem.mmkin}. Or another object that has list components +\item{fit}{An object of class \link{mkinfit} or \link{nlme.mmkin} +or another object that has list components mkinmod containing an \link{mkinmod} degradation model, and two numeric vectors, bparms.optim and bparms.fixed, that contain parameter values for that model.} @@ -32,8 +32,8 @@ Additional DT50 values are calculated from the FOMC DT90 and k1 and k2 from HS and DFOP, as well as from Eigenvalues b1 and b2 of any SFORB models } \note{ -The function is used internally by \link{summary.mkinfit}, -\link{summary.nlme.mmkin} and \link{summary.saem.mmkin}. +The function is used internally by \link{summary.mkinfit} +and \link{summary.nlme.mmkin} } \examples{ diff --git a/man/plot.mixed.mmkin.Rd b/man/plot.mixed.mmkin.Rd index c7b2344f..87a82286 100644 --- a/man/plot.mixed.mmkin.Rd +++ b/man/plot.mixed.mmkin.Rd @@ -17,7 +17,7 @@ maxabs = "auto", ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)), nrow.legend = ceiling((length(i) + 1)/ncol.legend), - rel.height.legend = 0.03 + 0.08 * nrow.legend, + rel.height.legend = 0.02 + 0.07 * nrow.legend, rel.height.bottom = 1.1, pch_ds = 1:length(i), col_ds = pch_ds + 1, @@ -27,7 +27,7 @@ ) } \arguments{ -\item{x}{An object of class \link{mixed.mmkin}, \link{saem.mmkin} or \link{nlme.mmkin}} +\item{x}{An object of class \link{mixed.mmkin}, \link{nlme.mmkin}} \item{i}{A numeric index to select datasets for which to plot the individual predictions, in case plots get too large} @@ -94,15 +94,6 @@ plot(f[, 3:4], standardized = TRUE) f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3)) plot(f_nlme) -f_saem <- saem(f, transformations = "saemix") -plot(f_saem) - -# We can overlay the two variants if we generate predictions -pred_nlme <- mkinpredict(dfop_sfo, - f_nlme$bparms.optim[-1], - c(parent = f_nlme$bparms.optim[[1]], A1 = 0), - seq(0, 180, by = 0.2)) -plot(f_saem, pred_over = list(nlme = pred_nlme)) } } \author{ diff --git a/man/saem.Rd b/man/saem.Rd deleted file mode 100644 index d5a8f17e..00000000 --- a/man/saem.Rd +++ /dev/null @@ -1,155 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/saem.R -\name{saem} -\alias{saem} -\alias{saem.mmkin} -\alias{print.saem.mmkin} -\alias{saemix_model} -\alias{saemix_data} -\title{Fit nonlinear mixed models with SAEM} -\usage{ -saem(object, ...) - -\method{saem}{mmkin}( - object, - transformations = c("mkin", "saemix"), - degparms_start = numeric(), - solution_type = "auto", - control = list(displayProgress = FALSE, print = FALSE, save = FALSE, save.graphs = - FALSE), - verbose = FALSE, - quiet = FALSE, - ... -) - -\method{print}{saem.mmkin}(x, digits = max(3, getOption("digits") - 3), ...) - -saemix_model( - object, - solution_type = "auto", - transformations = c("mkin", "saemix"), - degparms_start = numeric(), - verbose = FALSE, - ... -) - -saemix_data(object, verbose = FALSE, ...) -} -\arguments{ -\item{object}{An \link{mmkin} row object containing several fits of the same -\link{mkinmod} model to different datasets} - -\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{degparms_start}{Parameter values given as a named numeric vector will -be used to override the starting values obtained from the 'mmkin' object.} - -\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{verbose}{Should we print information about created objects of -type \link[saemix:SaemixModel-class]{saemix::SaemixModel} and \link[saemix:SaemixData-class]{saemix::SaemixData}?} - -\item{quiet}{Should we suppress the messages saemix prints at the beginning -and the end of the optimisation process?} - -\item{x}{An saem.mmkin object to print} - -\item{digits}{Number of digits to use for printing} -} -\value{ -An S3 object of class 'saem.mmkin', containing the fitted -\link[saemix:SaemixObject-class]{saemix::SaemixObject} as a list component named 'so'. The -object also inherits from 'mixed.mmkin'. - -An \link[saemix:SaemixModel-class]{saemix::SaemixModel} object. - -An \link[saemix:SaemixData-class]{saemix::SaemixData} object. -} -\description{ -This function uses \code{\link[saemix:saemix]{saemix::saemix()}} as a backend for fitting nonlinear mixed -effects models created from \link{mmkin} row objects using the Stochastic Approximation -Expectation Maximisation algorithm (SAEM). -} -\details{ -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 using \link{mkinfit}. - -Starting values for the fixed effects (population mean parameters, argument -psi0 of \code{\link[saemix:saemixModel]{saemix::saemixModel()}} are the mean values of the parameters found -using \link{mmkin}. -} -\examples{ -\dontrun{ -ds <- lapply(experimental_data_for_UBA_2019[6:10], - function(x) subset(x$data[c("name", "time", "value")])) -names(ds) <- paste("Dataset", 6:10) -f_mmkin_parent_p0_fixed <- mmkin("FOMC", ds, - state.ini = c(parent = 100), fixed_initials = "parent", quiet = TRUE) -f_saem_p0_fixed <- saem(f_mmkin_parent_p0_fixed) - -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", ]) - -# The returned saem.mmkin object contains an SaemixObject, therefore we can use -# functions from saemix -library(saemix) -compare.saemix(list(f_saem_sfo$so, f_saem_fomc$so, f_saem_dfop$so)) -plot(f_saem_fomc$so, plot.type = "convergence") -plot(f_saem_fomc$so, plot.type = "individual.fit") -plot(f_saem_fomc$so, plot.type = "npde") -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(list(f_saem_fomc$so, f_saem_fomc_tc$so)) - -sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"), - A1 = mkinsub("SFO")) -fomc_sfo <- mkinmod(parent = mkinsub("FOMC", "A1"), - A1 = mkinsub("SFO")) -dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"), - A1 = mkinsub("SFO")) -# The following fit uses analytical solutions for SFO-SFO and DFOP-SFO, -# and compiled ODEs for FOMC that are much slower -f_mmkin <- mmkin(list( - "SFO-SFO" = sfo_sfo, "FOMC-SFO" = fomc_sfo, "DFOP-SFO" = dfop_sfo), - ds, quiet = TRUE) -# saem fits of SFO-SFO and DFOP-SFO to these data take about five seconds -# each on this system, as we use analytical solutions written for saemix. -# When using the analytical solutions written for mkin this took around -# four minutes -f_saem_sfo_sfo <- saem(f_mmkin["SFO-SFO", ]) -f_saem_dfop_sfo <- saem(f_mmkin["DFOP-SFO", ]) -# We can use print, plot and summary methods to check the results -print(f_saem_dfop_sfo) -plot(f_saem_dfop_sfo) -summary(f_saem_dfop_sfo, data = TRUE) - -# The following takes about 6 minutes -#f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve", -# control = list(nbiter.saemix = c(200, 80), nbdisplay = 10)) - -#saemix::compare.saemix(list( -# f_saem_dfop_sfo$so, -# f_saem_dfop_sfo_deSolve$so)) - -# If the model supports it, we can also use eigenvalue based solutions, which -# take a similar amount of time -#f_saem_sfo_sfo_eigen <- saem(f_mmkin["SFO-SFO", ], solution_type = "eigen", -# control = list(nbiter.saemix = c(200, 80), nbdisplay = 10)) -} -} -\seealso{ -\link{summary.saem.mmkin} \link{plot.mixed.mmkin} -} diff --git a/man/summary.saem.mmkin.Rd b/man/summary.saem.mmkin.Rd deleted file mode 100644 index 67cb3cbb..00000000 --- a/man/summary.saem.mmkin.Rd +++ /dev/null @@ -1,100 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/summary.saem.mmkin.R -\name{summary.saem.mmkin} -\alias{summary.saem.mmkin} -\alias{print.summary.saem.mmkin} -\title{Summary method for class "saem.mmkin"} -\usage{ -\method{summary}{saem.mmkin}(object, data = FALSE, verbose = FALSE, distimes = TRUE, ...) - -\method{print}{summary.saem.mmkin}(x, digits = max(3, getOption("digits") - 3), verbose = x$verbose, ...) -} -\arguments{ -\item{object}{an object of class \link{saem.mmkin}} - -\item{data}{logical, indicating whether the full data should be included in -the summary.} - -\item{verbose}{Should the summary be verbose?} - -\item{distimes}{logical, indicating whether DT50 and DT90 values should be -included.} - -\item{\dots}{optional arguments passed to methods like \code{print}.} - -\item{x}{an object of class \link{summary.saem.mmkin}} - -\item{digits}{Number of digits to use for printing} -} -\value{ -The summary function returns a list based on the \link[saemix:SaemixObject-class]{saemix::SaemixObject} -obtained in the fit, with at least the following additional components -\item{saemixversion, mkinversion, Rversion}{The saemix, mkin and R versions used} -\item{date.fit, date.summary}{The dates where the fit and the summary were -produced} -\item{diffs}{The differential equations used in the degradation model} -\item{use_of_ff}{Was maximum or minimum use made of formation fractions} -\item{data}{The data} -\item{confint_trans}{Transformed parameters as used in the optimisation, with confidence intervals} -\item{confint_back}{Backtransformed parameters, with confidence intervals if available} -\item{confint_errmod}{Error model parameters with confidence intervals} -\item{ff}{The estimated formation fractions derived from the fitted -model.} -\item{distimes}{The DT50 and DT90 values for each observed variable.} -\item{SFORB}{If applicable, eigenvalues of SFORB components of the model.} -The print method is called for its side effect, i.e. printing the summary. -} -\description{ -Lists model equations, initial parameter values, optimised parameters -for fixed effects (population), random effects (deviations from the -population mean) and residual error model, as well as the resulting -endpoints such as formation fractions and DT50 values. Optionally -(default is FALSE), the data are listed in full. -} -\examples{ -# Generate five datasets following DFOP-SFO kinetics -sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) -dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "m1"), - m1 = mkinsub("SFO"), quiet = TRUE) -set.seed(1234) -k1_in <- rlnorm(5, log(0.1), 0.3) -k2_in <- rlnorm(5, log(0.02), 0.3) -g_in <- plogis(rnorm(5, qlogis(0.5), 0.3)) -f_parent_to_m1_in <- plogis(rnorm(5, qlogis(0.3), 0.3)) -k_m1_in <- rlnorm(5, log(0.02), 0.3) - -pred_dfop_sfo <- function(k1, k2, g, f_parent_to_m1, k_m1) { - mkinpredict(dfop_sfo, - c(k1 = k1, k2 = k2, g = g, f_parent_to_m1 = f_parent_to_m1, k_m1 = k_m1), - c(parent = 100, m1 = 0), - sampling_times) -} - -ds_mean_dfop_sfo <- lapply(1:5, function(i) { - mkinpredict(dfop_sfo, - c(k1 = k1_in[i], k2 = k2_in[i], g = g_in[i], - f_parent_to_m1 = f_parent_to_m1_in[i], k_m1 = k_m1_in[i]), - c(parent = 100, m1 = 0), - sampling_times) -}) -names(ds_mean_dfop_sfo) <- paste("ds", 1:5) - -ds_syn_dfop_sfo <- lapply(ds_mean_dfop_sfo, function(ds) { - add_err(ds, - sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2), - n = 1)[[1]] -}) - -\dontrun{ -# Evaluate using mmkin and saem -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) -} - -} -\author{ -Johannes Ranke for the mkin specific parts -saemix authors for the parts inherited from saemix. -} @@ -4,47 +4,34 @@ Testing mkin ✔ | OK F W S | Context ✔ | 5 | AIC calculation ✔ | 2 | Export dataset for reading into CAKE -✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [1.1 s] +✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [1.0 s] ✔ | 4 | Calculation of FOCUS chi2 error levels [0.5 s] -✔ | 7 | Fitting the SFORB model [4.0 s] -✔ | 5 | Analytical solutions for coupled models [3.6 s] +✔ | 7 | Fitting the SFORB model [3.5 s] +✔ | 5 | Analytical solutions for coupled models [3.3 s] ✔ | 5 | Calculation of Akaike weights -✔ | 14 | Confidence intervals and p-values [1.4 s] -✔ | 14 | Error model fitting [6.8 s] +✔ | 14 | Confidence intervals and p-values [1.2 s] +✔ | 14 | Error model fitting [4.4 s] ✔ | 5 | Time step normalisation -✔ | 4 | Test fitting the decline of metabolites from their maximum [0.5 s] -✔ | 1 | Fitting the logistic model [0.3 s] -✔ | 5 3 | Nonlinear mixed-effects models [0.1 s] -──────────────────────────────────────────────────────────────────────────────── -Skip (test_mixed.R:4:3): Parent fits using saemix are correctly implemented -Reason: !saemix_available is TRUE - -Skip (test_mixed.R:94:3): Print methods work -Reason: !saemix_available is TRUE - -Skip (test_mixed.R:118:3): saem results are reproducible for biphasic fits -Reason: !saemix_available is TRUE -──────────────────────────────────────────────────────────────────────────────── +✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3 s] +✔ | 1 | Fitting the logistic model [0.2 s] +✔ | 5 | Nonlinear mixed-effects models [0.1 s] ✔ | 2 | Test dataset classes mkinds and mkindsg -✔ | 1 | mkinfit features [0.4 s] -✔ | 10 | Special cases of mkinfit calls [0.4 s] +✔ | 1 | mkinfit features [0.3 s] +✔ | 10 | Special cases of mkinfit calls [0.3 s] ✔ | 8 | mkinmod model generation and printing [0.2 s] ✔ | 3 | Model predictions with mkinpredict [0.4 s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.0 s] -✔ | 9 | Nonlinear mixed-effects models [9.3 s] -✔ | 14 | Plotting [2.0 s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.6 s] +✔ | 9 | Nonlinear mixed-effects models [7.7 s] +✔ | 14 | Plotting [1.7 s] ✔ | 4 | Residuals extracted from mkinfit models -✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.8 s] -✔ | 4 | Summary [0.2 s] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5 s] +✔ | 4 | Summary [0.1 s] ✔ | 1 | Summaries of old mkinfit objects -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.5 s] -✔ | 9 | Hypothesis tests [7.9 s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.7 s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.3 s] +✔ | 9 | Hypothesis tests [7.2 s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.4 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 48.3 s - -── Skipped tests ────────────────────────────────────────────────────────────── -● !saemix_available is TRUE (3) +Duration: 40.4 s -[ FAIL 0 | WARN 0 | SKIP 3 | PASS 176 ] +[ FAIL 0 | WARN 0 | SKIP 0 | PASS 176 ] diff --git a/tests/testthat/setup_script.R b/tests/testthat/setup_script.R index 2071e05c..547b2d6c 100644 --- a/tests/testthat/setup_script.R +++ b/tests/testthat/setup_script.R @@ -178,10 +178,6 @@ ds_biphasic <- lapply(ds_biphasic_mean, function(ds) { }) # Mixed model fits -saemix_available <- FALSE -if (requireNamespace("saemix", quietly = TRUE)) { - if(packageVersion("saemix") > "3.1.9000") saemix_available <- TRUE -} mmkin_sfo_1 <- mmkin("SFO", ds_sfo, quiet = TRUE, error_model = "tc", cores = n_cores) mmkin_dfop_1 <- mmkin("DFOP", ds_dfop, quiet = TRUE, cores = n_cores) mmkin_biphasic <- mmkin(list("DFOP-SFO" = DFOP_SFO), ds_biphasic, quiet = TRUE, cores = n_cores) @@ -190,16 +186,6 @@ mmkin_biphasic_mixed <- mixed(mmkin_biphasic) dfop_nlme_1 <- nlme(mmkin_dfop_1) nlme_biphasic <- nlme(mmkin_biphasic) -if (saemix_available) { - sfo_saem_1 <- saem(mmkin_sfo_1, quiet = TRUE, transformations = "saemix") - - dfop_saemix_1 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "mkin") - dfop_saemix_2 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "saemix") - - saem_biphasic_m <- saem(mmkin_biphasic, transformations = "mkin", quiet = TRUE) - saem_biphasic_s <- saem(mmkin_biphasic, transformations = "saemix", quiet = TRUE) -} - ds_uba <- lapply(experimental_data_for_UBA_2019[6:10], function(x) subset(x$data[c("name", "time", "value")])) names(ds_uba) <- paste("Dataset", 6:10) @@ -211,7 +197,3 @@ f_uba_mmkin <- mmkin(list("SFO-SFO" = sfo_sfo_uba, "DFOP-SFO" = dfop_sfo_uba), ds_uba, quiet = TRUE, cores = n_cores) f_uba_dfop_sfo_mixed <- mixed(f_uba_mmkin[2, ]) -if (saemix_available) { - f_uba_sfo_sfo_saem <- saem(f_uba_mmkin["SFO-SFO", ], quiet = TRUE, transformations = "saemix") - f_uba_dfop_sfo_saem <- saem(f_uba_mmkin["DFOP-SFO", ], quiet = TRUE, transformations = "saemix") -} diff --git a/tests/testthat/summary_saem_biphasic_s.txt b/tests/testthat/summary_saem_biphasic_s.txt deleted file mode 100644 index b5777ce1..00000000 --- a/tests/testthat/summary_saem_biphasic_s.txt +++ /dev/null @@ -1,77 +0,0 @@ -saemix version used for fitting: Dummy 0.0 for testing -mkin version used for pre-fitting: Dummy 0.0 for testing -R version used for fitting: Dummy R version for testing -Date of fit: Dummy date for testing -Date of summary: Dummy date for testing - -Equations: -d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * - time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) - * parent -d_m1/dt = + f_parent_to_m1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g) - * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) * - exp(-k2 * time))) * parent - k_m1 * m1 - -Data: -509 observations of 2 variable(s) grouped in 15 datasets - -Model predictions using solution type analytical - -Fitted in test time 0 s using 300, 100 iterations - -Variance model: Constant variance - -Mean of starting values for individual parameters: - parent_0 k_m1 f_parent_to_m1 k1 k2 - 1.0e+02 1.8e-03 4.8e-01 4.5e-02 1.9e-02 - g - 5.1e-01 - -Fixed degradation parameter values: -None - -Results: - -Likelihood computed by importance sampling - AIC BIC logLik - 2692 2702 -1333 - -Optimised parameters: - est. lower upper -parent_0 1.0e+02 99.3030 1.0e+02 -k_m1 2.2e-03 0.0016 2.8e-03 -f_parent_to_m1 4.9e-01 0.4477 5.3e-01 -k1 4.0e-02 0.0239 5.6e-02 -k2 1.5e-02 0.0085 2.2e-02 -g 5.0e-01 0.3805 6.2e-01 - -Correlation: - prnt_0 k_m1 f_p__1 k1 k2 -k_m1 -0.152 -f_parent_to_m1 -0.138 0.396 -k1 0.085 -0.036 -0.026 -k2 0.005 0.067 0.018 -0.043 -g -0.075 -0.113 -0.029 -0.248 -0.263 - -Random effects: - est. lower upper -SD.parent_0 1.23 0.39 2.07 -SD.k_m1 0.14 -0.48 0.75 -SD.f_parent_to_m1 0.28 0.17 0.39 -SD.k1 0.71 0.42 1.00 -SD.k2 0.78 0.47 1.09 -SD.g 0.27 -0.33 0.86 - -Variance model: - est. lower upper -a.1 2.7 2.6 2.9 - -Resulting formation fractions: - ff -parent_m1 0.49 -parent_sink 0.51 - -Estimated disappearance times: - DT50 DT90 DT50back DT50_k1 DT50_k2 -parent 27 110 33 17 46 -m1 318 1055 NA NA NA diff --git a/tests/testthat/test_mixed.R b/tests/testthat/test_mixed.R index e9af10e6..ca0072ef 100644 --- a/tests/testthat/test_mixed.R +++ b/tests/testthat/test_mixed.R @@ -1,98 +1,9 @@ context("Nonlinear mixed-effects models") -test_that("Parent fits using saemix are correctly implemented", { - skip_if(!saemix_available) - - expect_error(saem(fits), "Only row objects") - # Some fits were done in the setup script - mmkin_sfo_2 <- update(mmkin_sfo_1, fixed_initials = c(parent = 100)) - expect_error(update(mmkin_sfo_1, models = c("SFOOO")), "Please supply models.*") - - sfo_saem_2 <- saem(mmkin_sfo_1, quiet = TRUE, transformations = "mkin") - sfo_saem_3 <- expect_error(saem(mmkin_sfo_2, quiet = TRUE), "at least two parameters") - s_sfo_s1 <- summary(sfo_saem_1) - s_sfo_s2 <- summary(sfo_saem_2) - - sfo_nlme_1 <- expect_warning(nlme(mmkin_sfo_1), "not converge") - s_sfo_n <- summary(sfo_nlme_1) - - # Compare with input - expect_equal(round(s_sfo_s2$confint_ranef["SD.log_k_parent", "est."], 1), 0.3) - # k_parent is a bit different from input 0.03 here - expect_equal(round(s_sfo_s1$confint_back["k_parent", "est."], 3), 0.035) - expect_equal(round(s_sfo_s2$confint_back["k_parent", "est."], 3), 0.035) - - # But the result is pretty unanimous between methods - expect_equal(round(s_sfo_s1$confint_back["k_parent", "est."], 3), - round(s_sfo_s2$confint_back["k_parent", "est."], 3)) - expect_equal(round(s_sfo_s1$confint_back["k_parent", "est."], 3), - round(s_sfo_n$confint_back["k_parent", "est."], 3)) - - mmkin_fomc_1 <- mmkin("FOMC", ds_fomc, quiet = TRUE, error_model = "tc", cores = n_cores) - fomc_saem_1 <- saem(mmkin_fomc_1, quiet = TRUE) - ci_fomc_s1 <- summary(fomc_saem_1)$confint_back - - fomc_pop <- as.numeric(fomc_pop) - expect_true(all(ci_fomc_s1[, "lower"] < fomc_pop)) - expect_true(all(ci_fomc_s1[, "upper"] > fomc_pop)) - - mmkin_fomc_2 <- update(mmkin_fomc_1, state.ini = 100, fixed_initials = "parent") - fomc_saem_2 <- saem(mmkin_fomc_2, quiet = TRUE, transformations = "mkin") - ci_fomc_s2 <- summary(fomc_saem_2)$confint_back - - expect_true(all(ci_fomc_s2[, "lower"] < fomc_pop[2:3])) - expect_true(all(ci_fomc_s2[, "upper"] > fomc_pop[2:3])) - - s_dfop_s1 <- summary(dfop_saemix_1) - s_dfop_s2 <- summary(dfop_saemix_2) - s_dfop_n <- summary(dfop_nlme_1) - - dfop_pop <- as.numeric(dfop_pop) - expect_true(all(s_dfop_s1$confint_back[, "lower"] < dfop_pop)) - expect_true(all(s_dfop_s1$confint_back[, "upper"] > dfop_pop)) - expect_true(all(s_dfop_s2$confint_back[, "lower"] < dfop_pop)) - expect_true(all(s_dfop_s2$confint_back[, "upper"] > dfop_pop)) - - dfop_mmkin_means_trans <- apply(parms(mmkin_dfop_1, transformed = TRUE), 1, mean) - dfop_mmkin_means <- backtransform_odeparms(dfop_mmkin_means_trans, mmkin_dfop_1$mkinmod) - - # We get < 22% deviations by averaging the transformed parameters - rel_diff_mmkin <- (dfop_mmkin_means - dfop_pop) / dfop_pop - expect_true(all(rel_diff_mmkin < 0.22)) - - # We get < 50% deviations with transformations made in mkin - rel_diff_1 <- (s_dfop_s1$confint_back[, "est."] - dfop_pop) / dfop_pop - expect_true(all(rel_diff_1 < 0.5)) - - # We get < 12% deviations with transformations made in saemix - rel_diff_2 <- (s_dfop_s2$confint_back[, "est."] - dfop_pop) / dfop_pop - expect_true(all(rel_diff_2 < 0.12)) - - mmkin_hs_1 <- mmkin("HS", ds_hs, quiet = TRUE, error_model = "const", cores = n_cores) - hs_saem_1 <- saem(mmkin_hs_1, quiet = TRUE) - ci_hs_s1 <- summary(hs_saem_1)$confint_back - - hs_pop <- as.numeric(hs_pop) - # expect_true(all(ci_hs_s1[, "lower"] < hs_pop)) # k1 is overestimated - expect_true(all(ci_hs_s1[, "upper"] > hs_pop)) - - mmkin_hs_2 <- update(mmkin_hs_1, state.ini = 100, fixed_initials = "parent") - hs_saem_2 <- saem(mmkin_hs_2, quiet = TRUE) - ci_hs_s2 <- summary(hs_saem_2)$confint_back - - #expect_true(all(ci_hs_s2[, "lower"] < hs_pop[2:4])) # k1 again overestimated - expect_true(all(ci_hs_s2[, "upper"] > hs_pop[2:4])) - - # HS would likely benefit from implemenation of transformations = "saemix" -}) - test_that("Print methods work", { expect_known_output(print(fits, digits = 2), "print_mmkin_parent.txt") expect_known_output(print(mmkin_biphasic_mixed, digits = 2), "print_mmkin_biphasic_mixed.txt") expect_known_output(print(nlme_biphasic, digits = 1), "print_nlme_biphasic.txt") - - skip_if(!saemix_available) - expect_known_output(print(sfo_saem_1, digits = 1), "print_sfo_saem_1.txt") }) test_that("nlme results are reproducible to some degree", { @@ -112,45 +23,3 @@ test_that("nlme results are reproducible to some degree", { # expect_true(all(ci_dfop_sfo_n[, "lower"] < dfop_sfo_pop)) # k2 is overestimated expect_true(all(ci_dfop_sfo_n[, "upper"] > dfop_sfo_pop)) }) - -test_that("saem results are reproducible for biphasic fits", { - - skip_if(!saemix_available) - test_summary <- summary(saem_biphasic_s) - test_summary$saemixversion <- "Dummy 0.0 for testing" - test_summary$mkinversion <- "Dummy 0.0 for testing" - test_summary$Rversion <- "Dummy R version for testing" - test_summary$date.fit <- "Dummy date for testing" - test_summary$date.summary <- "Dummy date for testing" - test_summary$time <- c(elapsed = "test time 0") - - expect_known_output(print(test_summary, digits = 2), "summary_saem_biphasic_s.txt") - - dfop_sfo_pop <- as.numeric(dfop_sfo_pop) - no_k1 <- c(1, 2, 3, 5, 6) - no_k2 <- c(1, 2, 3, 4, 6) - - ci_dfop_sfo_s_s <- summary(saem_biphasic_s)$confint_back - expect_true(all(ci_dfop_sfo_s_s[, "lower"] < dfop_sfo_pop)) - expect_true(all(ci_dfop_sfo_s_s[, "upper"] > dfop_sfo_pop)) - - # k1 and k2 are not fitted well - ci_dfop_sfo_s_m <- summary(saem_biphasic_m)$confint_back - expect_true(all(ci_dfop_sfo_s_m[no_k2, "lower"] < dfop_sfo_pop[no_k2])) - expect_true(all(ci_dfop_sfo_s_m[no_k1, "upper"] > dfop_sfo_pop[no_k1])) - - # I tried to only do few iterations in routine tests as this is so slow - # but then deSolve fails at some point (presumably at the switch between - # the two types of iterations) - #saem_biphasic_2 <- saem(mmkin_biphasic, solution_type = "deSolve", - # control = list(nbiter.saemix = c(10, 5), nbiter.burn = 5), quiet = TRUE) - - skip("Fitting with saemix takes around 10 minutes when using deSolve") - saem_biphasic_2 <- saem(mmkin_biphasic, solution_type = "deSolve", quiet = TRUE) - - # As with the analytical solution, k1 and k2 are not fitted well - ci_dfop_sfo_s_d <- summary(saem_biphasic_2)$confint_back - expect_true(all(ci_dfop_sfo_s_d[no_k2, "lower"] < dfop_sfo_pop[no_k2])) - expect_true(all(ci_dfop_sfo_s_d[no_k1, "upper"] > dfop_sfo_pop[no_k1])) -}) - diff --git a/tests/testthat/test_plot.R b/tests/testthat/test_plot.R index 1c95d069..0bf3ee66 100644 --- a/tests/testthat/test_plot.R +++ b/tests/testthat/test_plot.R @@ -35,11 +35,6 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", { plot_biphasic_mmkin <- function() plot(f_uba_dfop_sfo_mixed) vdiffr::expect_doppelganger("mixed model fit for mmkin object", plot_biphasic_mmkin) - if (saemix_available) { - plot_biphasic_saem_s <- function() plot(f_uba_dfop_sfo_saem) - vdiffr::expect_doppelganger("mixed model fit for saem object with saemix transformations", plot_biphasic_saem_s) - } - skip_on_travis() plot_biphasic_nlme <- function() plot(dfop_nlme_1) @@ -48,12 +43,6 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", { #plot_biphasic_mmkin <- function() plot(mixed(mmkin_biphasic)) # Biphasic fits with lots of data and fits have lots of potential for differences plot_biphasic_nlme <- function() plot(nlme_biphasic) - if (saemix_available) { - #plot_biphasic_saem_s <- function() plot(saem_biphasic_s) - plot_biphasic_saem_m <- function() plot(saem_biphasic_m) - - vdiffr::expect_doppelganger("mixed model fit for saem object with mkin transformations", plot_biphasic_saem_m) - } # different results when working with eigenvalues plot_errmod_fit_D_obs_eigen <- function() plot_err(fit_D_obs_eigen, sep_obs = FALSE) diff --git a/tests_slow.log b/tests_slow.log index 6337d80a..b5b646b6 100644 --- a/tests_slow.log +++ b/tests_slow.log @@ -1,11 +1,9 @@ +Loading required package: parallel ✔ | OK F W S | Context -✔ | 21 | Fitting of parent only models [39.2 s] -✔ | 15 | test_roundtrip_error_parameters [354.9 s] +✔ | 21 | Fitting of parent only models [24.2 s] +✔ | 15 | Roundtripping error model parameters [51.5 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 394.1 s +Duration: 75.7 s -OK: 36 -Failed: 0 -Warnings: 0 -Skipped: 0 +[ FAIL 0 | WARN 0 | SKIP 0 | PASS 36 ] diff --git a/vignettes/web_only/mkin_benchmarks.rda b/vignettes/web_only/mkin_benchmarks.rda Binary files differindex 4cd33ca1..b5f76c8e 100644 --- a/vignettes/web_only/mkin_benchmarks.rda +++ b/vignettes/web_only/mkin_benchmarks.rda |