From bbb74d4f60033899cd5cdd36aa70f157bc52209e Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 1 Nov 2019 12:19:03 +0100 Subject: Fix bug in yesterdays release, add methods for BIC --- DESCRIPTION | 4 +- NAMESPACE | 5 + NEWS.md | 8 +- R/AIC.mmkin.R | 32 +- R/mkinfit.R | 2 + R/nobs.mkinfit.R | 8 + _pkgdown.yml | 1 + build.log | 2 +- check.log | 2 +- docs/404.html | 2 +- docs/NEWS.html | 610 --------------------- docs/README.html | 200 ------- docs/articles/FOCUS_D.html | 21 +- docs/articles/FOCUS_D_files/figure-html/plot-1.png | Bin 97716 -> 97426 bytes docs/articles/FOCUS_L.html | 117 ++-- .../figure-html/unnamed-chunk-10-1.png | Bin 29061 -> 29158 bytes .../figure-html/unnamed-chunk-8-1.png | Bin 27887 -> 27992 bytes .../figure-html/unnamed-chunk-9-1.png | Bin 28307 -> 28432 bytes docs/articles/FOCUS_Z.html | 332 ----------- docs/articles/FOCUS_Z.pdf | Bin 384032 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_1-1.png | Bin 86312 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_10-1.png | Bin 129920 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_11-1.png | Bin 129452 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_11a-1.png | Bin 97933 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_11b-1.png | Bin 22321 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_2-1.png | Bin 86923 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_3-1.png | Bin 86529 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_5-1.png | Bin 102872 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_6-1.png | Bin 130096 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_7-1.png | Bin 130164 -> 0 bytes .../figure-html/FOCUS_2006_Z_fits_9-1.png | Bin 109280 -> 0 bytes docs/articles/compiled_models.html | 201 ------- docs/articles/index.html | 2 +- docs/articles/mkin.html | 2 +- docs/articles/mkin_vignettes.css | 16 - docs/articles/references.bib | 112 ---- docs/articles/twa.html | 3 +- docs/articles/web_only/FOCUS_Z.html | 34 +- .../figure-html/FOCUS_2006_Z_fits_1-1.png | Bin 84962 -> 85185 bytes .../figure-html/FOCUS_2006_Z_fits_10-1.png | Bin 127841 -> 128361 bytes .../figure-html/FOCUS_2006_Z_fits_11-1.png | Bin 127069 -> 127413 bytes .../figure-html/FOCUS_2006_Z_fits_11a-1.png | Bin 95832 -> 95903 bytes .../figure-html/FOCUS_2006_Z_fits_2-1.png | Bin 85657 -> 85869 bytes .../figure-html/FOCUS_2006_Z_fits_3-1.png | Bin 85239 -> 85461 bytes .../figure-html/FOCUS_2006_Z_fits_5-1.png | Bin 101416 -> 102008 bytes .../figure-html/FOCUS_2006_Z_fits_6-1.png | Bin 128185 -> 128536 bytes .../figure-html/FOCUS_2006_Z_fits_7-1.png | Bin 127782 -> 128135 bytes .../figure-html/FOCUS_2006_Z_fits_9-1.png | Bin 107730 -> 108179 bytes docs/articles/web_only/NAFTA_examples.html | 27 +- docs/articles/web_only/benchmarks.html | 25 +- docs/articles/web_only/compiled_models.html | 13 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/jquery.sticky-kit.min.js | 9 - docs/news/index.html | 18 +- docs/reference/AIC.mmkin.html | 13 +- docs/reference/Extract.mmkin.html | 8 +- docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html | 16 +- docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html | 16 +- docs/reference/FOCUS_2006_HS_ref_A_to_F.html | 16 +- docs/reference/FOCUS_2006_SFO_ref_A_to_F.html | 16 +- docs/reference/FOCUS_2006_datasets.html | 16 +- docs/reference/NAFTA_2015_datasets-1.png | Bin 41450 -> 0 bytes docs/reference/NAFTA_2015_datasets.html | 218 -------- docs/reference/NAFTA_SOP_2015.html | 16 +- docs/reference/NAFTA_SOP_Attachment.html | 16 +- docs/reference/confint.mkinfit.html | 2 +- docs/reference/experimental_data_for_UBA.html | 16 +- docs/reference/index.html | 12 +- docs/reference/mccall81_245T-1.png | Bin 58349 -> 58310 bytes docs/reference/mccall81_245T.html | 16 +- docs/reference/mkinfit.html | 28 +- docs/reference/mkinmod.html | 2 +- docs/reference/mkinpredict.html | 4 +- docs/reference/mmkin.html | 4 +- docs/reference/nobs.mkinfit.html | 189 +++++++ docs/reference/plot.mkinfit-6.png | Bin 65273 -> 0 bytes docs/reference/plot.mmkin-4.png | Bin 37076 -> 38129 bytes docs/reference/print.nafta.html | 197 ------- docs/reference/schaefer07_complex_case.html | 16 +- docs/reference/summary.mkinfit.html | 6 +- docs/reference/synthetic_data_for_UBA.html | 225 -------- docs/reference/synthetic_data_for_UBA_2014.html | 6 +- docs/reference/test_data_from_UBA_2014-1.png | Bin 53086 -> 52908 bytes docs/reference/test_data_from_UBA_2014-2.png | Bin 68670 -> 68111 bytes docs/reference/test_data_from_UBA_2014.html | 16 +- docs/reference/update.mkinfit.html | 12 +- docs/sitemap.xml | 3 + man/AIC.mmkin.Rd | 5 +- man/nobs.mkinfit.Rd | 19 + test.log | 24 +- tests/testthat/FOCUS_2006_D.csf | 2 +- tests/testthat/test_error_models.R | 8 +- tests/testthat/test_plots_summary_twa.R | 3 + vignettes/mkin_benchmarks.rda | Bin 875 -> 871 bytes 95 files changed, 529 insertions(+), 2449 deletions(-) create mode 100644 R/nobs.mkinfit.R delete mode 100644 docs/NEWS.html delete mode 100644 docs/README.html delete mode 100644 docs/articles/FOCUS_Z.html delete mode 100644 docs/articles/FOCUS_Z.pdf delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_1-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_10-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11a-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_11b-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_2-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_3-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_5-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_6-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_7-1.png delete mode 100644 docs/articles/FOCUS_Z_files/figure-html/FOCUS_2006_Z_fits_9-1.png delete mode 100644 docs/articles/compiled_models.html delete mode 100644 docs/articles/mkin_vignettes.css delete mode 100644 docs/articles/references.bib delete mode 100644 docs/jquery.sticky-kit.min.js delete mode 100644 docs/reference/NAFTA_2015_datasets-1.png delete mode 100644 docs/reference/NAFTA_2015_datasets.html create mode 100644 docs/reference/nobs.mkinfit.html delete mode 100644 docs/reference/plot.mkinfit-6.png delete mode 100644 docs/reference/print.nafta.html delete mode 100644 docs/reference/synthetic_data_for_UBA.html create mode 100644 man/nobs.mkinfit.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 13ccdb0d..d204bdd3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data -Version: 0.9.49.6 -Date: 2019-10-31 +Version: 0.9.49.7 +Date: 2019-11-01 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de", comment = c(ORCID = "0000-0003-4371-6538")), diff --git a/NAMESPACE b/NAMESPACE index 8557fcc4..01abdcbb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,11 +2,13 @@ S3method("[",mmkin) S3method(AIC,mmkin) +S3method(BIC,mmkin) S3method(confint,mkinfit) S3method(logLik,mkinfit) S3method(lrtest,mkinfit) S3method(mkinpredict,mkinfit) S3method(mkinpredict,mkinmod) +S3method(nobs,mkinfit) S3method(parms,mkinfit) S3method(plot,mkinfit) S3method(plot,mmkin) @@ -68,11 +70,14 @@ importFrom(methods,signature) importFrom(parallel,detectCores) importFrom(parallel,mclapply) importFrom(parallel,parLapply) +importFrom(stats,AIC) +importFrom(stats,BIC) importFrom(stats,aggregate) importFrom(stats,cov2cor) importFrom(stats,dist) importFrom(stats,logLik) importFrom(stats,nlminb) +importFrom(stats,nobs) importFrom(stats,optimize) importFrom(stats,pt) importFrom(stats,qchisq) diff --git a/NEWS.md b/NEWS.md index 2bd7a242..78423592 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,10 @@ -# mkin 0.9.49.6 (unreleased) +# mkin 0.9.49.7 (2019-11-01) + +- Fix a bug introduced in 0.9.49.6 that occurred if the direct optimisation yielded a higher likelihood than the three-step optimisation in the d_3 algorithm, which caused the fitted parameters of the three-step optimisation to be returned instead of the parameters of the direct optimisation + +- Add an 'nobs' method for mkinfit methods, enabling the default 'BIC' method from the stats package. Also, add a 'BIC' method for mmkin column objects. + +# mkin 0.9.49.6 (2019-10-31) - Implement a likelihood ratio test as a method for 'lrtest' from the lmtest package diff --git a/R/AIC.mmkin.R b/R/AIC.mmkin.R index ab17f0a0..7d405c4a 100644 --- a/R/AIC.mmkin.R +++ b/R/AIC.mmkin.R @@ -1,8 +1,9 @@ -#' Calculated the AIC for a column of an mmkin object -#' +#' Calculate the AIC for a column of an mmkin object +#' #' Provides a convenient way to compare different kinetic models fitted to the #' same dataset. -#' +#' +#' @importFrom stats AIC BIC #' @param object An object of class \code{\link{mmkin}}, containing only one #' column. #' @param \dots For compatibility with the generic method @@ -11,22 +12,22 @@ #' dataframe if there are several fits in the column). #' @author Johannes Ranke #' @examples -#' +#' #' \dontrun{ # skip, as it takes > 10 s on winbuilder #' f <- mmkin(c("SFO", "FOMC", "DFOP"), #' list("FOCUS A" = FOCUS_2006_A, #' "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE) #' AIC(f[1, "FOCUS A"]) # We get a single number for a single fit -#' +#' #' # For FOCUS A, the models fit almost equally well, so the higher the number #' # of parameters, the higher (worse) the AIC #' AIC(f[, "FOCUS A"]) #' AIC(f[, "FOCUS A"], k = 0) # If we do not penalize additional parameters, we get nearly the same -#' +#' #' # For FOCUS C, the more complex models fit better #' AIC(f[, "FOCUS C"]) #' } -#' +#' #' @export AIC.mmkin <- function(object, ..., k = 2) { @@ -42,3 +43,20 @@ AIC.mmkin <- function(object, ..., k = 2) if (n.fits > 1) rownames(res) <- model_names return(res) } + +#' @rdname AIC.mmkin +#' @export +BIC.mmkin <- function(object, ...) +{ + # We can only handle a single column + if (ncol(object) != 1) stop("Please provide a single column object") + n.fits <- length(object) + model_names <- rownames(object) + + code <- paste0("BIC(", + paste0("object[[", 1:n.fits, "]]", collapse = ", "), + ")") + res <- eval(parse(text = code)) + if (n.fits > 1) rownames(res) <- model_names + return(res) +} diff --git a/R/mkinfit.R b/R/mkinfit.R index 27c769db..1c409569 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -781,6 +781,8 @@ mkinfit <- function(mkinmod, observed, if (!quiet) message(d_3_messages["direct"]) fit <- fit_direct fit$d_3_message <- d_3_messages["direct"] + degparms <- fit$par[degparms_index] + errparms <- fit$par[errparms_index] } } } diff --git a/R/nobs.mkinfit.R b/R/nobs.mkinfit.R new file mode 100644 index 00000000..0e0dbbbb --- /dev/null +++ b/R/nobs.mkinfit.R @@ -0,0 +1,8 @@ +#' Number of observations on which an mkinfit object was fitted +#' +#' @importFrom stats nobs +#' @param object An mkinfit object +#' @param \dots For compatibility with the generic method +#' @return The number of rows in the data included in the mkinfit object +#' @export +nobs.mkinfit <- function(object, ...) nrow(object$data) diff --git a/_pkgdown.yml b/_pkgdown.yml index 2409bc85..c222a817 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -65,6 +65,7 @@ reference: - sigma_twocomp - logLik.mkinfit - residuals.mkinfit + - nobs.mkinfit - mkinresplot - mkinparplot - mkinerrplot diff --git a/build.log b/build.log index 65e585da..41df1d5d 100644 --- a/build.log +++ b/build.log @@ -6,5 +6,5 @@ * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories * looking to see if a ‘data/datalist’ file should be added -* building ‘mkin_0.9.49.6.tar.gz’ +* building ‘mkin_0.9.49.7.tar.gz’ diff --git a/check.log b/check.log index e809af23..be2746c3 100644 --- a/check.log +++ b/check.log @@ -5,7 +5,7 @@ * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘0.9.49.6’ +* this is package ‘mkin’ version ‘0.9.49.7’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers Maintainer: ‘Johannes Ranke ’ diff --git a/docs/404.html b/docs/404.html index ecb80807..f10cadb9 100644 --- a/docs/404.html +++ b/docs/404.html @@ -67,7 +67,7 @@ mkin - 0.9.49.6 + 0.9.49.7 diff --git a/docs/NEWS.html b/docs/NEWS.html deleted file mode 100644 index 744b8db4..00000000 --- a/docs/NEWS.html +++ /dev/null @@ -1,610 +0,0 @@ - - - - - - - - -/home/jranke/git/mkin/NEWS.md • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - - -
-

-mkin 0.9.47.1 (2018-02-06)

-
    -
  • Skip some test on CRAN and winbuilder to avoid timeouts

  • -
  • ‘test_data_from_UBA_2014’: Added this list of datasets containing experimental data used in the expertise from 2014

  • -
  • ‘mkinfit’: Added the iterative reweighting method ‘tc’ using the two-component error model from Rocke and Lorenzato. NA values in the data are not returned any more.

  • -
  • ‘mkinfit’: Work around a bug in the current FME version that prevented the convergence message to be returned in the case of non-convergence.

  • -
  • ‘summary.mkinfit’: Improved output regarding weighting method. No predictions are returned for NA values in the model (see above).

  • -
  • ‘summary.mkinfit’: Show versions of mkin and R used for fitting (not the ones used for the summary) if the fit was generated with mkin >= 0.9.47.1

  • -
-
-
-

-mkin 0.9.46.3 (2017-11-16)

-
    -
  • README.md, vignettes/mkin.Rmd: URLs were updated

  • -
  • synthetic_data_for_UBA: Add the code used to generate the data in the interest of reproducibility

  • -
-
-
-

-mkin 0.9.46.2 (2017-10-10)

-
    -
  • Converted the vignette FOCUS_Z from tex/pdf to markdown/html

  • -
  • DESCRIPTION: Add ORCID

  • -
-
-
-

-mkin 0.9.46.1 (2017-09-14)

-
    -
  • plot.mkinfit: Fix scaling of residual plots for the case of separate plots for each observed variable

  • -
  • plot.mkinfit: Use all data points of the fitted curve for y axis scaling for the case of separate plots for each observed variable

  • -
  • Documentation updates

  • -
-
-
-

-mkin 0.9.46 (2017-07-24)

-
    -
  • Remove test_FOMC_ill-defined.R as it is too platform dependent
  • -
-
-
-

-mkin 0.9.45.2 (2017-07-24)

-
    -
  • Rename twa to max_twa_parent to avoid conflict with twa from my pfm package

  • -
  • Update URLs in documentation

  • -
  • Limit test code to one core to pass on windows

  • -
  • Switch from microbenchmark to rbenchmark as the former is not supported on all platforms

  • -
-
-
-

-mkin 0.9.45.1 (2016-12-20)

-
-

-New features

-
    -
  • A twa function, calculating maximum time weighted average concentrations for the parent (SFO, FOMC and DFOP).
  • -
-
-
-
-

-mkin 0.9.45 (2016-12-08)

-
-

-Minor changes

-
    -
  • plot.mkinfit and plot.mmkin: If the plotting device is tikz, LaTeX markup is being used for the chi2 error in the graphs.

  • -
  • Use pkgdown, the successor of staticdocs for generating static HTML documentation. Include example output and graphs also for dontrun sections.

  • -
  • plot.mkinfit: Plotting does not fail any more when the compiled model is not available, e.g. because it was removed from the temporary directory. In this case, the uncompiled model is now used for plotting

  • -
-
-
-
-

-mkin 0.9.44 (2016-06-29)

-
-

-Bug fixes

-
    -
  • The test test_FOMC_ill-defined failed on several architectures, so the test is now skipped
  • -
-
-
-
-

-mkin 0.9.43 (2016-06-28)

-
-

-Major changes

-
    -
  • The title was changed to Kinetic evaluations of chemical degradation data

  • -
  • plot.mkinfit: Add the possibility to show fits (and residual plots if requested) separately for the observed variables

  • -
  • plot.mkinfit: Add the possibility to show the chi2 error levels in the plot, similar to the way they are shown in plot.mmkin

  • -
  • plot_sep: Add this function as a convenience wrapper for plotting observed variables of mkinfit objects separately, with chi2 error values and residual plots.

  • -
  • Vignettes: The main vignette mkin was converted to R markdown and updated. The other vignettes were also updated to show current improved functionality.

  • -
  • The function add_err was added to the package, making it easy to generate simulated data using an error model based on the normal distribution

  • -
-
-
-

-Minor changes

-
    -
  • Remove an outdated reference to the inline package in the compiled_models vignette

  • -
  • mkinfit: Do not error out in cases where the fit converges, but the Jacobian for the untransformed model cost can not be estimated. Give a warning instead and return NA for the t-test results.

  • -
  • summary.mkinfit: Give a warning message when the covariance matrix can not be obtained.

  • -
  • A test has been added to containing a corresponding edge case to check that the warnings are correctly issued and the fit does not terminate.

  • -
  • plot.mmkin: Round the chi2 error value to three significant digits, instead of two decimal digits.

  • -
  • mkinfit: Return the err values used on weighted fits as a column named err. Also include these inverse weights when the column value in the observed data is used, which is returned as observed in the data component of the mkinfit object.

  • -
-
-
-

-Bug fixes

-
    -
  • endpoints: When the name of a substance degrading to a metabolite (e.g. a parent compound) used in the model formulation ended in the letter f, some rate parameters could be listed as formation fractions with mixed up names. These would also appear in the summary.

  • -
  • mkinfit: Check for all observed variables when checking if the user tried to fix formation fractions when fitting them using ilr transformation.

  • -
  • plot.mmkin: Set the plot margins correctly, also in the case of a single fit to be plotted, so the main title is placed in a reasonable way.

  • -
  • plot.mkinfit: Correct default values for col_obs, pch_obs and lty_obs for the case that obs_vars is specified.

  • -
-
-
-
-

-mkin 0.9.42 (2016-03-25)

-
-

-Major changes

-
    -
  • Add the argument from_max_mean to mkinfit, for fitting only the decline from the maximum observed value for models with a single observed variable
  • -
-
-
-

-Minor changes

-
    -
  • Add plots to compiled_models vignette

  • -
  • Give an explanatory error message when mkinmod fails due to a missing definition of a target variable

  • -
  • print.mkinmod(): Improve formatting when printing mkinmod model definitions

  • -
-
-
-
-

-mkin 0.9-41 (2015-11-09)

-
-

-Minor changes

-
    -
  • Add an R6 class mkinds representing datasets with a printing method

  • -
  • Add a printing method for mkinmod objects

  • -
  • Make it possible to specify arbitrary strings as names for the compounds in mkinmod, and show them in the plot

  • -
  • Use an index.r file to group help topics in static documentation

  • -
-
-
-

-Bug fixes

-
    -
  • -print.summary.mkinfit(): Avoid an error that occurred when printing summaries generated with mkin versions before 0.9-36
  • -
-
-
-
-

-mkin 0.9-40 (2015-07-21)

-
-

-Bug fixes

-
    -
  • -endpoints(): For DFOP and SFORB models, where optimize() is used, make use of the fact that the DT50 must be between DT50_k1 and DT50_k2 (DFOP) or DT50_b1 and DT50_b2 (SFORB), as optimize() sometimes did not find the minimum. Likewise for finding DT90 values. Also fit on the log scale to make the function more efficient.
  • -
-
-
-

-Internal changes

-
    -
  • -DESCRIPTION, NAMESPACE, R/*.R: Import (from) stats, graphics and methods packages, and qualify some function calls for non-base packages installed with R to avoid NOTES made by R CMD check –as-cran with upcoming R versions.
  • -
-
-
-
-

-mkin 0.9-39 (2015-06-26)

-
-

-Major changes

-
    -
  • New function mmkin(): This function takes a character vector of model shorthand names, or alternatively a list of mkinmod models, as well as a list of dataset as main arguments. It returns a matrix of mkinfit objects, with a row for each model and a column for each dataset. A subsetting method with single brackets is available. Fitting the models in parallel using the parallel package is supported.

  • -
  • New function plot.mmkin(): Plots single-row or single-column mmkin objects including residual plots.

  • -
-
-
-

-Bug fixes

-
    -
  • -mkinparplot(): Fix the x axis scaling for rate constants and formation fractions that got confused by the introduction of the t-values of transformed parameters.
  • -
-
-
-
-

-mkin 0.9-38 (2015-06-24)

-
-

-Minor changes

-
    -
  • vignettes/compiled_models.html: Show the performance improvement factor actually obtained when building the vignette, as well as mkin version, some system info and the CPU model used for building the vignette.

  • -
  • GNUMakefile,vignettes/*: Clean up vignette generation and include table of contents in HTML vignettes.

  • -
-
-
-

-Bug fixes

-
    -
  • -mkinmod(): When generating the C code for the derivatives, only declare the time variable when it is needed and remove the ‘-W-no-unused-variable’ compiler flag as the C compiler used in the CRAN checks on Solaris does not know it.
  • -
-
-
-
-

-mkin 0.9-36 (2015-06-21)

-
-

-Major changes

-
    -
  • summary.mkinfit(): A one-sided t-test for significant difference of untransformed parameters from zero is now always shown, based on the assumption of normal distribution for estimators of all untransformed parameters. Use with caution, as this assumption is unrealistic e.g. for rate constants in these nonlinear kinetic models.

  • -
  • If a compiler (gcc) is installed, use a version of the differential equation model compiled from C code, which is a huge performance boost for models where only the deSolve method works.

  • -
  • mkinmod(): Create a list component $cf (of class CFuncList) in the list returned by mkinmod, if a version can be compiled from autogenerated C code (see above).

  • -
  • mkinfit(): Set the default solution_type to deSolve when a compiled version of the model is present, except when an analytical solution is possible.

  • -
-
-
-

-Minor changes

-
    -
  • Added a simple showcase vignette with an evaluation of FOCUS example dataset D
  • -
-
-
-
-

-mkin 0.9-35 (2015-05-15)

-
-

-Major changes

-
    -
  • Switch from RUnit to testthat for testing
  • -
-
-
-

-Bug fixes

-
    -
  • mkinparplot(): Avoid warnings that occurred when not all confidence intervals were available in the summary of the fit

  • -
  • print.summary.mkinfit(): Fix printing the summary for the case that the number of iterations is not available

  • -
  • NAMESPACE: export S3 methods plot.mkinfit, summary.mkinfit and print.summary.mkinfit to satisfy R CMD check on R-devel

  • -
  • mkinparplot(): Avoid warning in R CMD check about undeclared global variable Lower

  • -
-
-
-

-New features

-
    -
  • mkinfit(): Report successful termination when quiet = FALSE. This is helpful for more difficult problems fitted with reweight.method = obs, as no progress is often indicated during the reweighting.

  • -
  • A first test using results established in the expertise written for the German Federal Environmental Agency (UBA) was added.

  • -
  • Add synthetic datasets generated for expertise written for the German Federal Environmental Agency UBA

  • -
  • Add tests based on these datasets

  • -
-
-
-
-

-mkin 0.9-34 (2014-11-22)

-
-

-New features

-
    -
  • Add the convenience function mkinsub() for creating the lists used in mkinmod()

  • -
  • 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.

  • -
  • 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.

  • -
-
-
-

-Minor changes

-
    -
  • The formatting of differential equations in the summary was further improved

  • -
  • Always include 0 on y axis when plotting during the fit

  • -
-
-
-
-

-mkin 0.9-33 (2014-10-22)

-
-

-New features

-
    -
  • The initial value (state.ini) for the observed variable with the highest observed residue is set to 100 in case it has no time zero observation and state.ini = "auto"

  • -
  • A basic unit test for mkinerrmin() was written

  • -
-
-
-

-Bug fixes

-
    -
  • mkinfit(): The internally fitted parameter for g was named g_ilr even when transform_fractions=FALSE

  • -
  • mkinfit(): The initial value (state.ini) for the parent compound was not set when the parent was not the (only) variable with the highest value in the observed data.

  • -
  • mkinerrmin(): When checking for degrees of freedom for metabolites, check if their time zero value is fixed instead of checking if the observed value is zero. This ensures correct calculation of degrees of freedom also in cases where the metabolite residue at time zero is greater zero.

  • -
  • plot.mkinfit(): Avoid a warning message about only using the first component of ylim that occurred when ylim was specified explicitly

  • -
-
-
-

-Minor changes

-
    -
  • The formatting of differential equations in the summary was improved by wrapping overly long lines

  • -
  • The FOCUS_Z vignette was rebuilt with the above improvement and using a width of 70 to avoid output outside of the grey area

  • -
  • print.summary.mkinfit(): Avoid a warning that occurred when gmkin showed summaries ofinitial fits without iterations

  • -
  • mkinfit(): Avoid a warning that occurred when summarising a fit that was performed with maxitmodFit = 0 as done in gmkin for configuring new fits.

  • -
-
-
-
-

-mkin 0.9-32 (2014-07-24)

-
-

-New features

-
    -
  • The number of degrees of freedom is difficult to define in the case of ilr transformation of formation fractions. Now for each source compartment the number of ilr parameters (=number of optimised parameters) is divided by the number of pathways to metabolites (=number of affected data series) which leads to fractional degrees of freedom in some cases.

  • -
  • The default for the initial value for the first state value is now taken from the mean of the observations at time zero, if available.

  • -
  • The kinetic model can alternatively be specified with a shorthand name for parent only degradation models, e.g. SFO, or DFOP.

  • -
  • Optimisation method, number of model evaluations and time elapsed during optimisation are given in the summary of mkinfit objects.

  • -
  • The maximum number of iterations in the optimisation algorithm can be specified using the argument maxit.modFit to the mkinfit function.

  • -
  • mkinfit gives a warning when the fit does not converge (does not apply to SANN method). This warning is included in the summary.

  • -
-
-
-

-Bug fixes

-
    -
  • Avoid plotting an artifical 0 residual at time zero in mkinresplot

  • -
  • In the determination of the degrees of freedom in mkinerrmin, formation fractions were accounted for multiple times in the case of parallel formation of metabolites. See the new feature described above for the solution.

  • -
  • transform_rates=FALSE in mkinfit now also works for FOMC and HS models.

  • -
  • Initial values for formation fractions were not set in all cases.

  • -
  • No warning was given when the fit did not converge when a method other than the default Levenberg-Marquardt method Marq was used.

  • -
-
-
-

-Minor changes

-
    -
  • Vignettes were rebuilt to reflect the changes in the summary method.

  • -
  • Algorithm Pseudo was excluded because it needs user-defined parameter limits which are not supported.

  • -
  • Algorithm Newton was excluded because of its different way to specify the maximum number of iterations and because it does not appear to provide additional benefits.

  • -
-
-
-
-

-mkin 0.9-31 (2014-07-14)

-
-

-Bug fixes

-
    -
  • The internal renaming of optimised parameters in Version 0.9-30 led to errors in the determination of the degrees of freedom for the chi2 error level calulations in mkinerrmin() used by the summary function.
  • -
-
-
-
-

-mkin 0.9-30 (2014-07-11)

-
-

-New features

-
    -
  • It is now possible to use formation fractions in combination with turning off the sink in mkinmod().
  • -
-
-
-

-Major changes

-
    -
  • The original and the transformed parameters now have different names (e.g. k_parent and log_k_parent. They also differ in how many they are when we have formation fractions but no pathway to sink.

  • -
  • The order of some of the information blocks in print.summary.mkinfit.R() has been ordered in a more logical way.

  • -
-
-
-

-Minor changes

-
    -
  • The vignette FOCUS_Z has been simplified to use formation fractions with turning off the sink, and slightly amended to use the new versions of DT50 values calculated since mkin 0.9-29.

  • -
  • All vignettes have been rebuilt so they reflect all changes.

  • -
  • The ChangeLog was renamed to NEWS.md and the entries were converted to markdown syntax compatible with the tools::news() function built into R.

  • -
  • The test suite was overhauled. Tests of the DFOP and SFORB models with dataset FOCUS_2006_A were removed, as they were too much dependent on the optimisation algorithm and/or starting parameters, because the dataset is SFO (compare kinfit vignette).

  • -
  • Also, the Schaefer complex case can now be fitted using formation fractions, and with the ‘Port’ optimisation method we also fit A2 in the same way as published in the Piacenza paper.

  • -
  • Some more checks were introduced to mkinfit(), leading to warnings or stopping execution if unsupported combinations of methods and parameters are requested.

  • -
-
-
-
-

-mkin 0.9-29 (2014-06-27)

-
    -
  • R/mkinresplot.R: Make it possible to specify xlim

  • -
  • R/geometric_mean.R, man/geometric_mean.Rd: Add geometric mean function

  • -
  • R/endpoints.R, man/endpoints.Rd: Calculate additional (pseudo)-DT50 values for FOMC, DFOP, HS and SFORB. Avoid calculation of formation fractions from rate constants when they are directly fitted

  • -
-
-
-

-mkin 0.9-28 (2014-05-20)

-
    -
  • Do not backtransform confidence intervals for formation fractions if more than one compound is formed, as such parameters only define the pathways as a set

  • -
  • Add historical remarks and some background to the main package vignette

  • -
  • Correct ‘isotropic’ into ‘isometric’ for the ilr transformation

  • -
-
-
-

-mkin 0.9-27 (2014-05-10)

-
    -
  • Fork the GUI into a separate package gmkin

  • -
  • DESCRIPTION, NAMESPACE, TODO: Adapt and add copyright information

  • -
  • Remove files belonging to the GUI

  • -
  • Possibility to fit without parameter transformations, using bounds as implemented in FME

  • -
  • Add McCall 2,4,5-T dataset

  • -
  • Enable selection of observed variables in plotting

  • -
  • Add possibility to show residual plot in plot.mkinfit

  • -
  • R/mkinparplot.R, man/mkinparplot.Rd: plot parameters with confidence intervals

  • -
  • Change vignette format from Sweave to knitr

  • -
  • Split examples vignette to FOCUS_L and FOCUS_Z

  • -
  • Remove warning about constant formation fractions in mkinmod as it was based on a misconception

  • -
  • Restrict the unit test with the Schaefer data to parent and primary metabolites as formation fraction and DT50 for A2 are higly correlated and passing the test is platform dependent. For example, the test fails in 1 out of 14 platforms on CRAN as of today.

  • -
  • Add Eurofins Regulatory AG copyright notices

  • -
  • Import FME and deSolve instead of depending on them to have clean startup

  • -
  • Add a starter function for the GUI: gmkin()

  • -
  • Change the format of the workspace files of gmkin so they can be distributed and documented in the package

  • -
  • Add gmkin workspace datasets FOCUS_2006_gmkin and FOCUS_2006_Z_gmkin

  • -
-
-
-

-mkin 0.9-24 (2013-11-06)

-
    -
  • Bugfix re-enabling the fixing of any combination of initial values for state variables

  • -
  • Default values for kinetic rate constants are not all 0.1 any more but are “salted” with a small increment to avoid numeric artefacts with the eigenvalue based solutions

  • -
  • Backtransform fixed ODE parameters for the summary

  • -
-
-
-

-mkin 0.9-22 (2013-10-26)

-
    -
  • Get rid of the optimisation step in mkinerrmin - this was unnecessary. Thanks to KinGUII for the inspiration - actually this is equation 6-2 in FOCUS kinetics p. 91 that I had overlooked originally

  • -
  • Fix plot.mkinfit as it passed graphical arguments like main to the solver

  • -
  • Do not use plot=TRUE in mkinfit() example

  • -
  • The first successful fits in the not so simple GUI

  • -
  • Fix iteratively reweighted least squares for the case of many metabolites

  • -
  • Unify naming of initial values of state variables

  • -
  • Unify naming in dataframes of optimised and fixed parameters in the summary

  • -
  • Show the weighting method for residuals in the summary

  • -
  • Correct the output of the data in the case of manual weighting

  • -
  • Implement IRLS assuming different variances for observed variables

  • -
  • Do not use 0 values at time zero for chi2 error level calculations. This is the way it is done in KinGUII and it makes sense. It does impact the chi2 error levels in the output. Generally they seem to be lower for metabolites now, presumably because the mean of the observed values is higher

  • -
-

For a detailed list of changes to the mkin source please consult the commit history on http://github.com/jranke/mkin

-
- - -
- -
- - -
- - -
-

Site built with pkgdown.

-
- -
-
- - - - diff --git a/docs/README.html b/docs/README.html deleted file mode 100644 index 98d42ebc..00000000 --- a/docs/README.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - -/home/jranke/git/mkin/README.md • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - -
-

-mkin

-

-

The R package mkin provides calculation routines for the analysis of chemical degradation data, including multicompartment kinetics as needed for modelling the formation and decline of transformation products, or if several compartments are involved.

-
-

-Installation

-

You can install the latest released version from CRAN from within R:

-
install.packages("mkin")
-
-
-

-Background

-

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 and helpful tools have been developed as detailed in ‘Credits and historical remarks’ below.

-
-
-

-Usage

-

For a start, have a look a the code examples provided for plot.mkinfit and plot.mmkin, and at the package vignettes FOCUS L and FOCUS D.

-
-
-

-Documentation

-

The HTML documentation is available at jrwb.de, at github and at R-Forge.

-
-
-

-Features

-
    -
  • Highly flexible model specification using mkinmod, including equilibrium reactions and using the single first-order reversible binding (SFORB) model, which will automatically create two latent state variables for the observed variable.
  • -
  • As of version 0.9-39, fitting of several models to several datasets, optionally in parallel, is supported, see for example plot.mmkin.
  • -
  • Model solution (forward modelling) in the function mkinpredict is performed either using the analytical solution for the case of parent only degradation, an eigenvalue based solution if only simple first-order (SFO) or SFORB kinetics are used in the model, or using a numeric solver from the deSolve package (default is lsoda).
  • -
  • If a C compiler is installed, the kinetic models are compiled from automatically generated C code, see vignette compiled_models. The autogeneration of C code was inspired by the ccSolve package. Thanks to Karline Soetaert for her work on that.
  • -
  • By default, kinetic rate constants and kinetic formation fractions are transformed internally using transform_odeparms so their estimators can more reasonably be expected to follow a normal distribution. This has the side effect that no constraints are needed in the optimisation. Thanks to René Lehmann for the nice cooperation on this, especially the isometric logration transformation that is now used for the formation fractions.
  • -
  • A side effect of this is that when parameter estimates are backtransformed to match the model definition, confidence intervals calculated from standard errors are also backtransformed to the correct scale, and will not include meaningless values like negative rate constants or formation fractions adding up to more than 1, which can not occur in a single experiment with a single defined radiolabel position.
  • -
  • The usual one-sided t-test for significant difference from zero is nevertheless shown based on estimators for the untransformed parameters.
  • -
  • Summary and plotting functions. The summary of an mkinfit object is in fact a full report that should give enough information to be able to approximately reproduce the fit with other tools.
  • -
  • The chi-squared error level as defined in the FOCUS kinetics guidance (see below) is calculated for each observed variable.
  • -
  • Iteratively reweighted least squares fitting is implemented in a similar way as in KinGUII and CAKE (see below). Simply add the argument reweight.method = "obs" to your call to mkinfit and a separate variance componenent for each of the observed variables will be optimised in a second stage after the primary optimisation algorithm has converged.
  • -
  • Iterative reweighting is also possible using the two-component error model for analytical data of Rocke and Lorenzato using the argument reweight.method = "tc".
  • -
  • When a metabolite decline phase is not described well by SFO kinetics, SFORB kinetics can be used for the metabolite.
  • -
-
-
-

-GUI

-

There is a graphical user interface that I consider useful for real work. Please refer to its documentation page for installation instructions and a manual.

-
-
-

-News

-

There is a ChangeLog, for the latest CRAN release and one for the github master branch.

-
-
-

-Credits and historical remarks

-

mkin would not be possible without the underlying software stack consisting of R and the packages deSolve and FME, to say the least.

-

It could not have been written without me being introduced to regulatory fate modelling of pesticides by Adrian Gurney during my time at Harlan Laboratories Ltd (formerly RCC Ltd). mkin greatly profits from and largely follows the work done by the FOCUS Degradation Kinetics Workgroup, as detailed in their guidance document from 2006, slightly updated in 2011 and in 2014.

-

Also, it was inspired by the first version of KinGUI developed by BayerCropScience, which is based on the MatLab runtime environment.

-

The companion package kinfit (now deprecated) was started in 2008 and first published on CRAN on 01 May 2010.

-

The first mkin code was published on 11 May 2010 and the first CRAN version on 18 May 2010.

-

In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named KinGUII whose R code is based on mkin, but which added, amongst other refinements, a closed source graphical user interface (GUI), iteratively reweighted least squares (IRLS) optimisation of the variance for each of the observed variables, and Markov Chain Monte Carlo (MCMC) simulation functionality, similar to what is available e.g. in the FME package.

-

Somewhat in parallel, Syngenta has sponsored the development of an mkin and KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is more limited in the model formulation, but puts more weight on usability. CAKE is available for download from the CAKE website, where you can also find a zip archive of the R scripts derived from mkin, published under the GPL license.

-

Finally, there is KineticEval, which contains a further development of the scripts used for KinGUII, so the different tools will hopefully be able to learn from each other in the future as well.

-
-
-

-Development

-

Contributions are welcome! Your mkin fork is just a mouse click away… The master branch on github should always be in good shape, I implement new features in separate branches now. If you prefer subversion, project members for the r-forge project are welcome as well. Generally, the source code of the latest CRAN version should be available there. You can also browse the source code at cgit.jrwb.de/mkin.

-
-
- -
- -
- - -
- - -
-

Site built with pkgdown.

-
- -
-
- - - - diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index f8c51e2d..42361b92 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -90,7 +90,7 @@

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2019-09-19

+

2019-11-01

@@ -170,8 +170,8 @@
summary(fit)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:52:55 2019 
-## Date of summary: Thu Sep 19 09:52:56 2019 
+## Date of fit:     Fri Nov  1 10:10:44 2019 
+## Date of summary: Fri Nov  1 10:10:44 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -179,19 +179,18 @@
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted using 389 model solutions performed in 1.001 s
+## Fitted using 389 model solutions performed in 1.015 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##                    value   type
-## parent_0      100.750000  state
-## k_parent_sink   0.100000 deparm
-## k_parent_m1     0.100100 deparm
-## k_m1_sink       0.100200 deparm
-## sigma           3.125504  error
+##                  value   type
+## parent_0      100.7500  state
+## k_parent_sink   0.1000 deparm
+## k_parent_m1     0.1001 deparm
+## k_m1_sink       0.1002 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##                        value lower upper
@@ -199,7 +198,6 @@
 ## log_k_parent_sink  -2.302585  -Inf   Inf
 ## log_k_parent_m1    -2.301586  -Inf   Inf
 ## log_k_m1_sink      -2.300587  -Inf   Inf
-## sigma               3.125504     0   Inf
 ## 
 ## Fixed parameter values:
 ##      value  type
@@ -298,6 +296,7 @@
   
 
   
 
 
diff --git a/docs/articles/FOCUS_D_files/figure-html/plot-1.png b/docs/articles/FOCUS_D_files/figure-html/plot-1.png
index fc1142ab..6f4fa093 100644
Binary files a/docs/articles/FOCUS_D_files/figure-html/plot-1.png and b/docs/articles/FOCUS_D_files/figure-html/plot-1.png differ
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 7b35beeb..4033beba 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -90,7 +90,7 @@
       

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2019-09-19

+

2019-11-01

@@ -116,8 +116,8 @@ summary(m.L1.SFO)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:52:57 2019 
-## Date of summary: Thu Sep 19 09:52:57 2019 
+## Date of fit:     Fri Nov  1 10:10:46 2019 
+## Date of summary: Fri Nov  1 10:10:46 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
@@ -131,16 +131,14 @@
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##                   value   type
-## parent_0      89.850000  state
-## k_parent_sink  0.100000 deparm
-## sigma          2.779827  error
+##               value   type
+## parent_0      89.85  state
+## k_parent_sink  0.10 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##                       value lower upper
 ## parent_0          89.850000  -Inf   Inf
 ## log_k_parent_sink -2.302585  -Inf   Inf
-## sigma              2.779827     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -214,12 +212,12 @@
 
summary(m.L1.FOMC, data = FALSE)
## Warning in sqrt(diag(covar)): NaNs wurden erzeugt
## Warning in sqrt(1/diag(V)): NaNs wurden erzeugt
-
## Warning in cov2cor(ans$cov.unscaled): diag(.) had 0 or NA entries; non-
-## finite result is doubtful
+
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite
+## result is doubtful
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:52:59 2019 
-## Date of summary: Thu Sep 19 09:52:59 2019 
+## Date of fit:     Fri Nov  1 10:10:48 2019 
+## Date of summary: Fri Nov  1 10:10:48 2019 
 ## 
 ## 
 ## Warning: Optimisation did not converge:
@@ -231,25 +229,23 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 899 model solutions performed in 1.908 s
+## Fitted using 899 model solutions performed in 1.91 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##              value   type
-## parent_0 89.850000  state
-## alpha     1.000000 deparm
-## beta     10.000000 deparm
-## sigma     2.779871  error
+##          value   type
+## parent_0 89.85  state
+## alpha     1.00 deparm
+## beta     10.00 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##               value lower upper
 ## parent_0  89.850000  -Inf   Inf
 ## log_alpha  0.000000  -Inf   Inf
 ## log_beta   2.302585  -Inf   Inf
-## sigma      2.779871     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -323,33 +319,31 @@
 
summary(m.L2.FOMC, data = FALSE)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:53:00 2019 
-## Date of summary: Thu Sep 19 09:53:00 2019 
+## Date of fit:     Fri Nov  1 10:10:49 2019 
+## Date of summary: Fri Nov  1 10:10:49 2019 
 ## 
 ## 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.49 s
+## Fitted using 239 model solutions performed in 0.489 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##              value   type
-## parent_0 93.950000  state
-## alpha     1.000000 deparm
-## beta     10.000000 deparm
-## sigma     2.275722  error
+##          value   type
+## parent_0 93.95  state
+## alpha     1.00 deparm
+## beta     10.00 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##               value lower upper
 ## parent_0  93.950000  -Inf   Inf
 ## log_alpha  0.000000  -Inf   Inf
 ## log_beta   2.302585  -Inf   Inf
-## sigma      2.275722     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -399,8 +393,8 @@
 
summary(m.L2.DFOP, data = FALSE)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:53:02 2019 
-## Date of summary: Thu Sep 19 09:53:02 2019 
+## Date of fit:     Fri Nov  1 10:10:51 2019 
+## Date of summary: Fri Nov  1 10:10:51 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -409,19 +403,18 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 572 model solutions performed in 1.204 s
+## Fitted using 572 model solutions performed in 1.218 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##              value   type
-## parent_0 93.950000  state
-## k1        0.100000 deparm
-## k2        0.010000 deparm
-## g         0.500000 deparm
-## sigma     1.413899  error
+##          value   type
+## parent_0 93.95  state
+## k1        0.10 deparm
+## k2        0.01 deparm
+## g         0.50 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##              value lower upper
@@ -429,7 +422,6 @@
 ## log_k1   -2.302585  -Inf   Inf
 ## log_k2   -4.605170  -Inf   Inf
 ## g_ilr     0.000000  -Inf   Inf
-## sigma     1.413899     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -499,8 +491,8 @@
 
summary(mm.L3[["DFOP", 1]])
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:53:04 2019 
-## Date of summary: Thu Sep 19 09:53:04 2019 
+## Date of fit:     Fri Nov  1 10:10:53 2019 
+## Date of summary: Fri Nov  1 10:10:53 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -509,19 +501,18 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 373 model solutions performed in 0.799 s
+## Fitted using 373 model solutions performed in 0.784 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##              value   type
-## parent_0 97.800000  state
-## k1        0.100000 deparm
-## k2        0.010000 deparm
-## g         0.500000 deparm
-## sigma     1.017292  error
+##          value   type
+## parent_0 97.80  state
+## k1        0.10 deparm
+## k2        0.01 deparm
+## g         0.50 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##              value lower upper
@@ -529,7 +520,6 @@
 ## log_k1   -2.302585  -Inf   Inf
 ## log_k2   -4.605170  -Inf   Inf
 ## g_ilr     0.000000  -Inf   Inf
-## sigma     1.017292     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -605,31 +595,29 @@
 
summary(mm.L4[["SFO", 1]], data = FALSE)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:53:04 2019 
-## Date of summary: Thu Sep 19 09:53:05 2019 
+## Date of fit:     Fri Nov  1 10:10:53 2019 
+## Date of summary: Fri Nov  1 10:10:54 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 142 model solutions performed in 0.287 s
+## Fitted using 142 model solutions performed in 0.292 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##                  value   type
-## parent_0      96.60000  state
-## k_parent_sink  0.10000 deparm
-## sigma          3.16181  error
+##               value   type
+## parent_0       96.6  state
+## k_parent_sink   0.1 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##                       value lower upper
 ## parent_0          96.600000  -Inf   Inf
 ## log_k_parent_sink -2.302585  -Inf   Inf
-## sigma              3.161810     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -670,33 +658,31 @@
 
summary(mm.L4[["FOMC", 1]], data = FALSE)
## mkin version used for fitting:    0.9.49.6 
 ## R version used for fitting:       3.6.1 
-## Date of fit:     Thu Sep 19 09:53:05 2019 
-## Date of summary: Thu Sep 19 09:53:05 2019 
+## Date of fit:     Fri Nov  1 10:10:54 2019 
+## Date of summary: Fri Nov  1 10:10:54 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted using 224 model solutions performed in 0.48 s
+## Fitted using 224 model solutions performed in 0.455 s
 ## 
 ## Error model: Constant variance 
 ## 
 ## Error model algorithm: OLS 
 ## 
 ## Starting values for parameters to be optimised:
-##              value   type
-## parent_0 96.600000  state
-## alpha     1.000000 deparm
-## beta     10.000000 deparm
-## sigma     1.830055  error
+##          value   type
+## parent_0  96.6  state
+## alpha      1.0 deparm
+## beta      10.0 deparm
 ## 
 ## Starting values for the transformed parameters actually optimised:
 ##               value lower upper
 ## parent_0  96.600000  -Inf   Inf
 ## log_alpha  0.000000  -Inf   Inf
 ## log_beta   2.302585  -Inf   Inf
-## sigma      1.830055     0   Inf
 ## 
 ## Fixed parameter values:
 ## None
@@ -746,6 +732,7 @@
   
 
   
 
   
 
 
diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html
index 5ea0b256..14234785 100644
--- a/docs/articles/web_only/FOCUS_Z.html
+++ b/docs/articles/web_only/FOCUS_Z.html
@@ -90,7 +90,7 @@
       

Example evaluation of FOCUS dataset Z

Johannes Ranke

-

2019-09-19

+

2019-11-01

@@ -244,36 +244,7 @@
plot_sep(m.Z.mkin.1)

summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
-
##                            Z0_0 log_k_Z0_Z1 log_k_Z1_Z2 log_k_Z2_sink
-## Z0_0                 3.8375e+00  5.4918e-03  3.0584e-02    1.2969e-01
-## log_k_Z0_Z1          5.4918e-03  2.7613e-03 -1.8820e-04    2.6634e-04
-## log_k_Z1_Z2          3.0584e-02 -1.8820e-04  3.3807e-03    3.2177e-03
-## log_k_Z2_sink        1.2969e-01  2.6634e-04  3.2177e-03    3.4256e-02
-## log_k_Z2_Z3_free    -2.4223e-02 -2.6169e-04 -1.1845e-03   -8.1134e-03
-## log_k_Z3_free_sink  -6.5467e-02 -4.0815e-04 -3.2978e-03   -3.6010e-02
-## log_k_Z3_free_bound -6.0659e-02 -4.4768e-04 -3.0588e-03   -3.9074e-02
-## log_k_Z3_bound_free  5.2844e-01  4.5458e-03  7.9800e-03    4.6274e-02
-## sigma                2.0366e-10 -3.4658e-10  8.9910e-11   -2.5946e-10
-##                     log_k_Z2_Z3_free log_k_Z3_free_sink
-## Z0_0                     -2.4223e-02        -6.5467e-02
-## log_k_Z0_Z1              -2.6169e-04        -4.0815e-04
-## log_k_Z1_Z2              -1.1845e-03        -3.2978e-03
-## log_k_Z2_sink            -8.1134e-03        -3.6010e-02
-## log_k_Z2_Z3_free          1.5500e-02         2.1583e-02
-## log_k_Z3_free_sink        2.1583e-02         7.5705e-02
-## log_k_Z3_free_bound       2.5836e-02         1.1964e-01
-## log_k_Z3_bound_free       5.2534e-02         2.9441e-01
-## sigma                     1.3063e-10         3.4170e-10
-##                     log_k_Z3_free_bound log_k_Z3_bound_free       sigma
-## Z0_0                        -6.0659e-02          5.2844e-01  2.0366e-10
-## log_k_Z0_Z1                 -4.4768e-04          4.5458e-03 -3.4658e-10
-## log_k_Z1_Z2                 -3.0588e-03          7.9800e-03  8.9910e-11
-## log_k_Z2_sink               -3.9074e-02          4.6274e-02 -2.5946e-10
-## log_k_Z2_Z3_free             2.5836e-02          5.2534e-02  1.3063e-10
-## log_k_Z3_free_sink           1.1964e-01          2.9441e-01  3.4170e-10
-## log_k_Z3_free_bound          6.5902e-01          5.4737e+00 -6.7704e-10
-## log_k_Z3_bound_free          5.4737e+00          2.8722e+08  7.2421e-02
-## sigma                       -6.7704e-10          7.2421e-02  1.4170e-01
+
## NULL

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.

Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
                     Z1 = mkinsub("SFO", "Z2", sink = FALSE),
@@ -358,6 +329,7 @@
   
+## Linux, AMD Ryzen 7 1700 Eight-Core Processor, mkin version 0.9.49.6 10.787
save(mkin_benchmarks, file = "~/git/mkin/vignettes/mkin_benchmarks.rda")
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   3.171    1.000     3.170        0
-## 1 deSolve, not compiled            3  29.012    9.149    28.996        0
-## 2      Eigenvalue based            3   4.473    1.411     4.470        0
+## 3     deSolve, compiled            3   3.143    1.000     3.142        0
+## 1 deSolve, not compiled            3  29.169    9.281    29.154        0
+## 2      Eigenvalue based            3   4.358    1.387     4.356        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
@@ -216,8 +216,8 @@
 ## Warning in mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
 ## value of zero were removed from the data
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   4.913    1.000     4.909        0
-## 1 deSolve, not compiled            3  53.418   10.873    53.393        0
+## 2     deSolve, compiled            3   4.840    1.000     4.837        0
+## 1 deSolve, not compiled            3  54.338   11.227    54.309        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
@@ -231,6 +231,7 @@ diff --git a/docs/jquery.sticky-kit.min.js b/docs/jquery.sticky-kit.min.js deleted file mode 100644 index e2a3c6de..00000000 --- a/docs/jquery.sticky-kit.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net -*/ -(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); -if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, -u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), -a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", -y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n mkin - 0.9.49.6 + 0.9.49.7
@@ -129,9 +129,18 @@ -
+

-mkin 0.9.49.6 (unreleased) Unreleased +mkin 0.9.49.7 (2019-11-01) Unreleased +

+
    +
  • Fix a bug introduced in 0.9.49.6 that occurred if the direct optimisation yielded a higher likelihood than the three-step optimisation in the d_3 algorithm, which caused the fitted parameters of the three-step optimisation to be returned instead of the parameters of the direct optimisation

  • +
  • Add an ‘nobs’ method for mkinfit methods, enabling the default ‘BIC’ method from the stats package. Also, add a ‘BIC’ method for mmkin column objects.

  • +
+
+
+

+mkin 0.9.49.6 (2019-10-31) 2019-10-31

  • Implement a likelihood ratio test as a method for ‘lrtest’ from the lmtest package

  • @@ -726,7 +735,8 @@

    Contents

    @@ -128,7 +128,7 @@ same dataset." />
    @@ -139,7 +139,10 @@ same dataset.

    # S3 method for mmkin
    -AIC(object, ..., k = 2)
    +AIC(object, ..., k = 2) + +# S3 method for mmkin +BIC(object, ...)

Arguments

diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index 879c1444..7273b5de 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -176,16 +176,16 @@ either a list of mkinfit objects or a single mkinfit object.

cores=1, quiet=TRUE) fits["FOMC", ]
#> dataset #> model B C -#> FOMC List,40 List,40 +#> FOMC List,41 List,41 #> attr(,"class") #> [1] "mmkin"
fits[, "B"]
#> dataset #> model B -#> SFO List,40 -#> FOMC List,40 +#> SFO List,41 +#> FOMC List,41 #> attr(,"class") #> [1] "mmkin"
fits["SFO", "B"]
#> dataset #> model B -#> SFO List,40 +#> SFO List,41 #> attr(,"class") #> [1] "mmkin"
head( 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 8f418b75..83d624bb 100644 --- a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html +++ b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html @@ -8,11 +8,13 @@ Results of fitting the DFOP model to Datasets A to B of FOCUS (2006) — FOCUS_2006_DFOP_ref_A_to_B • mkin + + @@ -32,8 +34,8 @@ - + + @@ -113,7 +116,6 @@ in this fit." /> News - @@ -135,17 +137,16 @@ in this fit." />
-

A table with the fitted parameters and the resulting DT50 and DT90 values generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit.

-
FOCUS_2006_DFOP_ref_A_to_B
- + +

Format

A data frame containing the following variables.

@@ -160,7 +161,6 @@ in this fit.

-

Source

FOCUS (2006) “Guidance Document on Estimating Persistence and @@ -168,7 +168,6 @@ in this fit.

Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

-

Examples

data(FOCUS_2006_DFOP_ref_A_to_B)
@@ -176,11 +175,8 @@ in this fit.

-

A table with the fitted parameters and the resulting DT50 and DT90 values generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit.

-
FOCUS_2006_FOMC_ref_A_to_F
- + +

Format

A data frame containing the following variables.

@@ -159,7 +160,6 @@ in this fit.

-

Source

FOCUS (2006) “Guidance Document on Estimating Persistence and @@ -167,7 +167,6 @@ in this fit.

Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

-

Examples

data(FOCUS_2006_FOMC_ref_A_to_F)
@@ -175,11 +174,8 @@ in this fit.

-

A table with the fitted parameters and the resulting DT50 and DT90 values generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit.

-
FOCUS_2006_HS_ref_A_to_F
- + +

Format

A data frame containing the following variables.

@@ -160,7 +161,6 @@ in this fit.

-

Source

FOCUS (2006) “Guidance Document on Estimating Persistence and @@ -168,7 +168,6 @@ in this fit.

Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

-

Examples

data(FOCUS_2006_HS_ref_A_to_F)
@@ -176,11 +175,8 @@ in this fit.

-

A table with the fitted parameters and the resulting DT50 and DT90 values generated with different software packages. Taken directly from FOCUS (2006). The results from fitting the data with the Topfit software was removed, as the initial concentration of the parent compound was fixed to a value of 100 in this fit.

-
FOCUS_2006_SFO_ref_A_to_F
- + +

Format

A data frame containing the following variables.

@@ -158,7 +159,6 @@ in this fit.

-

Source

FOCUS (2006) “Guidance Document on Estimating Persistence and @@ -166,7 +166,6 @@ in this fit.

Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

-

Examples

data(FOCUS_2006_SFO_ref_A_to_F)
@@ -174,11 +173,8 @@ in this fit.

-

Data taken from FOCUS (2006), p. 258.

-
FOCUS_2006_A
@@ -142,7 +142,8 @@
   FOCUS_2006_D
   FOCUS_2006_E
   FOCUS_2006_F
- + +

Format

6 datasets with observations on the following variables.

@@ -152,7 +153,6 @@
-

Source

FOCUS (2006) “Guidance Document on Estimating Persistence and @@ -160,7 +160,6 @@ Registration” Report of the FOCUS Work Group on Degradation Kinetics, EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

-

Examples

FOCUS_2006_C
#> name time value @@ -177,11 +176,8 @@
-

Data taken from US EPA (2015), p. 19 and 23.

-
NAFTA_SOP_Appendix_B
   NAFTA_SOP_Appendix_D
- + +

Format

2 datasets with observations on the following variables.

@@ -148,7 +149,6 @@
-

Source

NAFTA (2011) Guidance for evaluating and calculating degradation kinetics @@ -159,7 +159,6 @@ Calculate Representative Half-life Values and Characterizing Pesticide Degradation https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

-

Examples

nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The representative half-life of the IORE model is longer than the one corresponding
#> to the terminal degradation rate found with the DFOP model.
#> The representative half-life obtained from the DFOP model may be used
print(nafta_evaluation)
#> Sums of squares: @@ -204,11 +203,8 @@
-

Data taken from from Attachment 1 of the SOP.

-
NAFTA_SOP_Attachment
- + +

Format

A list (NAFTA_SOP_Attachment) containing 16 datasets suitable for the evaluation with nafta

-

Source

NAFTA (2011) Guidance for evaluating and calculating degradation kinetics @@ -153,7 +153,6 @@ Calculate Representative Half-life Values and Characterizing Pesticide Degradation https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

-

Examples

nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1)
#> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
#> The half-life obtained from the IORE model may be used
print(nafta_att_p5a)
#> Sums of squares: @@ -198,11 +197,8 @@
#> User System verstrichen -#> 50.987 0.008 51.023
# The following does not save much time, as parent_0 takes up most of the time +#> 51.646 0.000 51.673
# The following does not save much time, as parent_0 takes up most of the time # system.time(ci_profile <- confint(f_d_1, cores = 5)) # system.time(ci_profile <- confint(f_d_1, # c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = 1)) diff --git a/docs/reference/experimental_data_for_UBA.html b/docs/reference/experimental_data_for_UBA.html index f35aee5f..18e11261 100644 --- a/docs/reference/experimental_data_for_UBA.html +++ b/docs/reference/experimental_data_for_UBA.html @@ -8,11 +8,13 @@ Experimental datasets used for development and testing of error models — experimental_data_for_UBA_2019 • mkin + + @@ -32,8 +34,8 @@ - + @@ -137,7 +140,6 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl News - @@ -159,7 +161,6 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl
-

The 12 datasets were extracted from active substance evaluation dossiers published by EFSA. Kinetic evaluations shown for these datasets are intended to illustrate and advance error model specifications. The fact that these data and some @@ -189,11 +190,11 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl to one half of the LOD reported to be 1% AR.

Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl (United Kingdom, 2014, p. 81).

-
experimental_data_for_UBA_2019
- + +

Format

A list containing twelve datasets as an R6 class defined by mkinds, @@ -203,7 +204,6 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl -

Source

@@ -225,7 +225,6 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl

United Kingdom (2014). Thifensulfuron-methyl - Annex B.8 (Volume 3) to the Report and Proposed Decision of the United Kingdom made to the European Commission under Regulation (EC) No. 1141/2010 for renewal of an active substance

-

Examples

# \dontrun{ @@ -264,11 +263,8 @@ Dataset 12 is from the Renewal Assessment Report (RAR) for thifensulfuron-methyl @@ -255,9 +255,9 @@ of an mmkin object

- + @@ -447,6 +447,12 @@ kinetic models fitted with mkinfit

+ + + + diff --git a/docs/reference/mccall81_245T-1.png b/docs/reference/mccall81_245T-1.png index b9a42571..5b70455c 100644 Binary files a/docs/reference/mccall81_245T-1.png and b/docs/reference/mccall81_245T-1.png differ diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html index 91c55a6a..ce2d40cd 100644 --- a/docs/reference/mccall81_245T.html +++ b/docs/reference/mccall81_245T.html @@ -8,11 +8,13 @@ Datasets on aerobic soil metabolism of 2,4,5-T in six soils — mccall81_245T • mkin + + @@ -32,8 +34,8 @@ - + @@ -41,6 +43,7 @@ + @@ -111,7 +114,6 @@ News - @@ -133,15 +135,14 @@
-

Time course of 2,4,5-trichlorophenoxyacetic acid, and the corresponding 2,4,5-trichlorophenol and 2,4,5-trichloroanisole as recovered in diethylether extracts.

-
mccall81_245T
- + +

Format

A dataframe containing the following variables.

@@ -156,12 +157,10 @@
-

Source

McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labeled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 http://dx.doi.org/10.1021/jf00103a026

-

Examples

SFO_SFO_SFO <- mkinmod(T245 = list(type = "SFO", to = "phenol"), @@ -228,11 +227,8 @@
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.1 -#> Date of fit: Thu Oct 31 01:48:29 2019 -#> Date of summary: Thu Oct 31 01:48:29 2019 +#> Date of fit: Fri Nov 1 10:08:21 2019 +#> Date of summary: Fri Nov 1 10:08:21 2019 #> #> 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.455 s +#> Fitted using 222 model solutions performed in 0.456 s #> #> Error model: Constant variance #> @@ -482,7 +482,7 @@ estimators.

m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> User System verstrichen -#> 1.464 0.000 1.465
coef(fit)
#> NULL
#> $ff +#> 1.488 0.000 1.491
coef(fit)
#> NULL
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -555,7 +555,7 @@ estimators.

#> Sum of squared residuals at call 126: 371.2134 #> Sum of squared residuals at call 135: 371.2134 #> Negative log-likelihood at call 145: 97.22429
#> Optimisation successfully terminated.
#> User System verstrichen -#> 1.047 0.000 1.047
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff +#> 1.058 0.000 1.059
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -591,8 +591,8 @@ estimators.

SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.noweight)
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.1 -#> Date of fit: Thu Oct 31 01:48:44 2019 -#> Date of summary: Thu Oct 31 01:48:44 2019 +#> Date of fit: Fri Nov 1 10:08:36 2019 +#> Date of summary: Fri Nov 1 10:08:36 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -600,7 +600,7 @@ estimators.

#> #> Model predictions using solution type deSolve #> -#> Fitted using 421 model solutions performed in 1.136 s +#> Fitted using 421 model solutions performed in 1.083 s #> #> Error model: Constant variance #> @@ -708,8 +708,8 @@ estimators.

#> 120 m1 25.15 28.78984 -3.640e+00 #> 120 m1 33.31 28.78984 4.520e+00
f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.obs)
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.1 -#> Date of fit: Thu Oct 31 01:48:47 2019 -#> Date of summary: Thu Oct 31 01:48:47 2019 +#> Date of fit: Fri Nov 1 10:08:39 2019 +#> Date of summary: Fri Nov 1 10:08:39 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -717,7 +717,7 @@ estimators.

#> #> Model predictions using solution type deSolve #> -#> Fitted using 978 model solutions performed in 2.512 s +#> Fitted using 978 model solutions performed in 2.553 s #> #> Error model: Variance unique to each observed variable #> @@ -840,8 +840,8 @@ estimators.

#> 120 m1 25.15 28.80429 -3.654e+00 #> 120 m1 33.31 28.80429 4.506e+00
f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
summary(f.tc)
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.1 -#> Date of fit: Thu Oct 31 01:48:56 2019 -#> Date of summary: Thu Oct 31 01:48:56 2019 +#> Date of fit: Fri Nov 1 10:08:48 2019 +#> Date of summary: Fri Nov 1 10:08:48 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -849,7 +849,7 @@ estimators.

#> #> Model predictions using solution type deSolve #> -#> Fitted using 2289 model solutions performed in 9.124 s +#> Fitted using 2289 model solutions performed in 9.253 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 2eefdc2e..317ffe5f 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -239,7 +239,7 @@ in the FOCUS and NAFTA guidance documents are used.

SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file59d942b9ac06.c 2> file59d942b9ac06.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file12cd48616f1.c 2> file12cd48616f1.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index f7d543ad..0eca973c 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -350,7 +350,7 @@ solver is used.

c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "eigen")[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.004 0.000 0.004
system.time( +#> 0.004 0.000 0.003
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve")[201,]))
#> time parent m1 @@ -360,7 +360,7 @@ solver is used.

c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.021 0.000 0.021
+#> 0.021 0.000 0.022
# \dontrun{ # Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C)
#> Ordinary least squares optimisation
#> Sum of squared residuals at call 1: 552.5739 diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 8312c17c..d1ea7a52 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -202,8 +202,8 @@ for parallel execution.

time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) time_default
#> User System verstrichen -#> 0.011 0.032 4.774
time_1
#> User System verstrichen -#> 18.676 0.000 18.687
+#> 0.014 0.024 4.895
time_1
#> User System verstrichen +#> 19.047 0.004 19.063
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340481 0.2659519 0.7505684 0.2494316 diff --git a/docs/reference/nobs.mkinfit.html b/docs/reference/nobs.mkinfit.html new file mode 100644 index 00000000..1bd97732 --- /dev/null +++ b/docs/reference/nobs.mkinfit.html @@ -0,0 +1,189 @@ + + + + + + + + +Number of observations on which an mkinfit object was fitted — nobs.mkinfit • mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

Number of observations on which an mkinfit object was fitted

+
+ +
# S3 method for mkinfit
+nobs(object, ...)
+ +

Arguments

+
-

AIC(<mmkin>)

+

AIC(<mmkin>) BIC(<mmkin>)

Calculated the AIC for a column of an mmkin object

Calculate the AIC for a column of an mmkin object

Extract residuals from an mkinfit model

+

nobs(<mkinfit>)

+

Number of observations on which an mkinfit object was fitted

mkinresplot()

+ + + + + + + + + +
object

An mkinfit object

...

For compatibility with the generic method

+ +

Value

+ +

The number of rows in the data included in the mkinfit object

+ + + + + + +
+ + +
+

Site built with pkgdown 1.4.1.

+
+ +
+ + + + + + + + + diff --git a/docs/reference/plot.mkinfit-6.png b/docs/reference/plot.mkinfit-6.png deleted file mode 100644 index ad2ffa8c..00000000 Binary files a/docs/reference/plot.mkinfit-6.png and /dev/null differ diff --git a/docs/reference/plot.mmkin-4.png b/docs/reference/plot.mmkin-4.png index 13d96256..44037bb4 100644 Binary files a/docs/reference/plot.mmkin-4.png and b/docs/reference/plot.mmkin-4.png differ diff --git a/docs/reference/print.nafta.html b/docs/reference/print.nafta.html deleted file mode 100644 index fa8223ad..00000000 --- a/docs/reference/print.nafta.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Print nafta objects — print.nafta • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
- -

Print nafta objects. The results for the three models - are printed in the order of increasing model complexity, - i.e. SFO, then IORE, and finally DFOP.

- -
- -
# S3 method for nafta
-print(x, quiet = TRUE, digits = 3, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

An nafta object.

quiet

Should the evaluation text be shown?

digits

Number of digits to be used for printing parameters and dissipation times.

...

Not used.

- - -
- -
- - -
- - -
-

Site built with pkgdown 1.4.1.

-
- -
-
- - - - - - - - diff --git a/docs/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html index c6635409..27b19430 100644 --- a/docs/reference/schaefer07_complex_case.html +++ b/docs/reference/schaefer07_complex_case.html @@ -8,11 +8,13 @@ Metabolism data set used for checking the software quality of KinGUI — schaefer07_complex_case • mkin + + @@ -32,8 +34,8 @@ - + @@ -41,6 +43,7 @@ + @@ -111,7 +114,6 @@ News - @@ -133,15 +135,14 @@
-

This dataset was used for a comparison of KinGUI and ModelMaker to check the software quality of KinGUI in the original publication (Schäfer et al., 2007). The results from the fitting are also included.

-
schaefer07_complex_case
- + +

Format

The data set is a data frame with 8 observations on the following 6 variables.

@@ -153,14 +154,12 @@
A2

a numeric vector

The results are a data frame with 14 results for different parameter values

-

References

Schäfer D, Mikolasch B, Rainbird P and Harvey B (2007). KinGUI: a new kinetic software tool for evaluations according to FOCUS degradation kinetics. In: Del Re AAM, Capri E, Fragoulis G and Trevisan M (Eds.). Proceedings of the XIII Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923.

-

Examples

data <- mkin_wide_to_long(schaefer07_complex_case, time = "time") @@ -206,11 +205,8 @@