From e5d1df9a9b1f0951d7dfbaf24eee4294470b73e2 Mon Sep 17 00:00:00 2001
From: Johannes Ranke ‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel. ‘R/saem.R’: Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported. ‘R/saem.R’: ‘logLik’ and ‘update’ methods for ‘saem.mmkin’ objects. ‘R/convergence.R’: New generic to show convergence information with methods for ‘mmkin’ and ‘mhmkin’ objects. ‘R/saem.R’: ‘logLik’, ‘update’ and ‘anova’ methods for ‘saem.mmkin’ objects. ‘R/saem.R’: Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions. ‘R/status.R’: New generic to show status information for fit array objects with methods for ‘mmkin’, ‘mhmkin’ and ‘multistart’ objects. ‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel. ‘R/mhmkin.R’: ‘anova.mhmkin’ for conveniently comparing the resulting fits. ‘R/illparms.R’: New generic to show ill-defined parameters with methods for ‘mkinfit’, ‘mmkin’, ‘saem.mmkin’ and ‘mhmkin’ objects. ‘R/multistart.R’: New method for testing multiple start parameters for hierarchical model fits, with function ‘llhist’ and new generic ‘parplot’ for diagnostics, and new generics ‘which.best’ and ‘best’ for extracting the fit with the highest likelihood ‘R/summary.mmkin.R’: Summary method for mmkin objects. ‘R/saem.R’: Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported. ‘R/read_spreadsheet.R’: Conveniently read in data from a spreadsheet file. ‘R/tex_listings.R’: Conveniently include summaries of fit objects in R markdown documents that are compiled to LaTeX. Ranke J (2022).
mkin: Kinetic Evaluation of Chemical Degradation Data.
-R package version 1.2.0, https://pkgdown.jrwb.de/mkin/.
+R package version 1.2.1, https://pkgdown.jrwb.de/mkin/.
‘tests/testthat/setup_script.R’: Excluded another ill-defined random effect for the DFOP fit with ‘saem’, in an attempt to avoid a platform dependence that surfaced on Fedora systems on the CRAN check farm ‘tests/testthat/test_mixed.R’: Round parameters found by saemix to two significant digits before printing, to also help to avoid platform dependence of tests ‘R/saem.R’: Fix a bug that prevented that ‘error.ini’ is passed to ‘saemix_model’, and set default to c(1, 1) to avoid changing test results ‘R/parplot.R’: Show initial values for error model parameters ‘R/loglik.mkinfit.R’: Add ‘nobs’ attribute to the resulting ‘logLik’ object, in order to make test_AIC.R succeed on current R-devel ‘R/saem.R’: ‘logLik’, ‘update’ and ‘anova’ methods for ‘saem.mmkin’ objects. The R code used to create this data object is installed with this package in
+the 'dataset_generation' directory.mkin 1.1.2
-mkin 1.2.0 (2022-11-17)
+mkin 1.1.1 (2022-07-12)
--
cgit v1.2.3
From 317fd7514e638780c09ed6349a165a854ba2deea Mon Sep 17 00:00:00 2001
From: Johannes Ranke @Manual{,
title = {mkin: Kinetic Evaluation of Chemical Degradation Data},
author = {Johannes Ranke},
year = {2022},
- note = {R package version 1.2.0},
+ note = {R package version 1.2.1},
url = {https://pkgdown.jrwb.de/mkin/},
}
diff --git a/docs/index.html b/docs/index.html
index 9048bc38..bb14906d 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -44,7 +44,7 @@
diff --git a/docs/news/index.html b/docs/news/index.html
index 90768141..6b9a7d51 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -17,7 +17,7 @@
@@ -87,6 +87,14 @@
Source: NEWS.md
+ mkin 1.2.1 (unreleased)
+mkin 1.2.0 (2022-11-17)
Examples
+ # \dontrun{
+ sfo_mmkin <- mmkin("SFO", ds_sfo, quiet = TRUE, error_model = "tc", cores = 15)
+ sfo_saem <- saem(sfo_mmkin, no_random_effect = "parent_0")
+ plot(sfo_saem)
+
+# }
+
+# This is the code used to generate the datasets
+cat(readLines(system.file("dataset_generation/ds_mixed.R", package = "mkin")), sep = "\n")
+#> # Synthetic data for hierarchical kinetic models
+#> # Refactored version of the code previously in tests/testthat/setup_script.R
+#> # The number of datasets was 3 for FOMC, and 10 for HS in that script, now it
+#> # is always 15 for consistency
+#>
+#> library(mkin) # We use mkinmod and mkinpredict
+#> sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
+#> n <- 15
+#> log_sd <- 0.3
+#> err_1 = list(const = 1, prop = 0.05)
+#> tc <- function(value) sigma_twocomp(value, err_1$const, err_1$prop)
+#> const <- function(value) 2
+#>
+#> set.seed(123456)
+#> SFO <- mkinmod(parent = mkinsub("SFO"))
+#> sfo_pop <- list(parent_0 = 100, k_parent = 0.03)
+#> sfo_parms <- as.matrix(data.frame(
+#> k_parent = rlnorm(n, log(sfo_pop$k_parent), log_sd)))
+#> set.seed(123456)
+#> ds_sfo <- lapply(1:n, function(i) {
+#> ds_mean <- mkinpredict(SFO, sfo_parms[i, ],
+#> c(parent = sfo_pop$parent_0), sampling_times)
+#> add_err(ds_mean, tc, n = 1)[[1]]
+#> })
+#> attr(ds_sfo, "pop") <- sfo_pop
+#> attr(ds_sfo, "parms") <- sfo_parms
+#>
+#> set.seed(123456)
+#> FOMC <- mkinmod(parent = mkinsub("FOMC"))
+#> fomc_pop <- list(parent_0 = 100, alpha = 2, beta = 8)
+#> fomc_parms <- as.matrix(data.frame(
+#> alpha = rlnorm(n, log(fomc_pop$alpha), 0.4),
+#> beta = rlnorm(n, log(fomc_pop$beta), 0.2)))
+#> set.seed(123456)
+#> ds_fomc <- lapply(1:n, function(i) {
+#> ds_mean <- mkinpredict(FOMC, fomc_parms[i, ],
+#> c(parent = fomc_pop$parent_0), sampling_times)
+#> add_err(ds_mean, tc, n = 1)[[1]]
+#> })
+#> attr(ds_fomc, "pop") <- fomc_pop
+#> attr(ds_fomc, "parms") <- fomc_parms
+#>
+#> set.seed(123456)
+#> DFOP <- mkinmod(parent = mkinsub("DFOP"))
+#> dfop_pop <- list(parent_0 = 100, k1 = 0.06, k2 = 0.015, g = 0.4)
+#> dfop_parms <- as.matrix(data.frame(
+#> k1 = rlnorm(n, log(dfop_pop$k1), log_sd),
+#> k2 = rlnorm(n, log(dfop_pop$k2), log_sd),
+#> g = plogis(rnorm(n, qlogis(dfop_pop$g), log_sd))))
+#> set.seed(123456)
+#> ds_dfop <- lapply(1:n, function(i) {
+#> ds_mean <- mkinpredict(DFOP, dfop_parms[i, ],
+#> c(parent = dfop_pop$parent_0), sampling_times)
+#> add_err(ds_mean, tc, n = 1)[[1]]
+#> })
+#> attr(ds_dfop, "pop") <- dfop_pop
+#> attr(ds_dfop, "parms") <- dfop_parms
+#>
+#> set.seed(123456)
+#> HS <- mkinmod(parent = mkinsub("HS"))
+#> hs_pop <- list(parent_0 = 100, k1 = 0.08, k2 = 0.01, tb = 15)
+#> hs_parms <- as.matrix(data.frame(
+#> k1 = rlnorm(n, log(hs_pop$k1), log_sd),
+#> k2 = rlnorm(n, log(hs_pop$k2), log_sd),
+#> tb = rlnorm(n, log(hs_pop$tb), 0.1)))
+#> set.seed(123456)
+#> ds_hs <- lapply(1:n, function(i) {
+#> ds_mean <- mkinpredict(HS, hs_parms[i, ],
+#> c(parent = hs_pop$parent_0), sampling_times)
+#> add_err(ds_mean, const, n = 1)[[1]]
+#> })
+#> attr(ds_hs, "pop") <- hs_pop
+#> attr(ds_hs, "parms") <- hs_parms
+#>
+#> set.seed(123456)
+#> DFOP_SFO <- mkinmod(
+#> parent = mkinsub("DFOP", "m1"),
+#> m1 = mkinsub("SFO"),
+#> quiet = TRUE)
+#> dfop_sfo_pop <- list(parent_0 = 100,
+#> k_m1 = 0.007, f_parent_to_m1 = 0.5,
+#> k1 = 0.1, k2 = 0.02, g = 0.5)
+#> dfop_sfo_parms <- as.matrix(data.frame(
+#> k1 = rlnorm(n, log(dfop_sfo_pop$k1), log_sd),
+#> k2 = rlnorm(n, log(dfop_sfo_pop$k2), log_sd),
+#> g = plogis(rnorm(n, qlogis(dfop_sfo_pop$g), log_sd)),
+#> f_parent_to_m1 = plogis(rnorm(n,
+#> qlogis(dfop_sfo_pop$f_parent_to_m1), log_sd)),
+#> k_m1 = rlnorm(n, log(dfop_sfo_pop$k_m1), log_sd)))
+#> ds_dfop_sfo_mean <- lapply(1:n,
+#> function(i) {
+#> mkinpredict(DFOP_SFO, dfop_sfo_parms[i, ],
+#> c(parent = dfop_sfo_pop$parent_0, m1 = 0), sampling_times)
+#> }
+#> )
+#> set.seed(123456)
+#> ds_dfop_sfo <- lapply(ds_dfop_sfo_mean, function(ds) {
+#> add_err(ds,
+#> sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2),
+#> n = 1, secondary = "m1")[[1]]
+#> })
+#> attr(ds_dfop_sfo, "pop") <- dfop_sfo_pop
+#> attr(ds_dfop_sfo, "parms") <- dfop_sfo_parms
+#>
+#> #save(ds_sfo, ds_fomc, ds_dfop, ds_hs, ds_dfop_sfo, file = "data/ds_mixed.rda", version = 2)
+
FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar
Synthetic data for hierarchical kinetic degradation models
Three experimental datasets from two water sediment systems and one soil
FOCUS default values for soil moisture contents at field capacity, MWHC and 1/3 bar