From af7c6de4db9981ac814362c441fbac22c8faa2d7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 24 Nov 2022 09:02:26 +0100 Subject: Start online docs of the development version --- docs/dev/reference/mhmkin.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/dev/reference/mhmkin.html') diff --git a/docs/dev/reference/mhmkin.html b/docs/dev/reference/mhmkin.html index e87e20a1..e72d17f9 100644 --- a/docs/dev/reference/mhmkin.html +++ b/docs/dev/reference/mhmkin.html @@ -22,7 +22,7 @@ mixed-effects model fitting functions."> mkin - 1.2.0 + 1.2.2 @@ -64,7 +64,10 @@ mixed-effects model fitting functions.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • -- cgit v1.2.3 From 9a1136dc5550663b352239502a39a07601959644 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 2 Dec 2022 08:00:40 +0100 Subject: Update online docs --- docs/dev/news/index.html | 4 +- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/Rplot001.png | Bin 14083 -> 18113 bytes docs/dev/reference/Rplot002.png | Bin 13699 -> 38732 bytes docs/dev/reference/mhmkin-1.png | Bin 0 -> 53169 bytes docs/dev/reference/mhmkin-2.png | Bin 0 -> 113443 bytes docs/dev/reference/mhmkin.html | 103 +++++++++++++++++++++++++++++++++++----- 7 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 docs/dev/reference/mhmkin-1.png create mode 100644 docs/dev/reference/mhmkin-2.png (limited to 'docs/dev/reference/mhmkin.html') diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index 50afb3e9..c9663964 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -89,7 +89,9 @@
    -
    +
    • ‘R/mhmkin.R’: Allow an ‘illparms.mhmkin’ object or a list with suitable dimensions as value of the argument ‘no_random_effects’, making it possible to exclude random effects that were ill-defined in simpler variants of the set of degradation models. Remove the possibility to exclude random effects based on separate fits, as it did not work well.

    • +
    • ‘R/summary.saem.mmkin.R’: List all initial parameter values in the summary, including random effects and error model parameters

    • +
    • ‘{data,R}/ds_mixed.rda’: Include the test data in the package instead of generating it in ‘tests/testthat/setup_script.R’. Refactor the generating code to make it consistent and update tests.

    • diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 0669ac9c..33252d6f 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -13,7 +13,7 @@ articles: dimethenamid_2018: web_only/dimethenamid_2018.html multistart: web_only/multistart.html saem_benchmarks: web_only/saem_benchmarks.html -last_built: 2022-11-24T06:50Z +last_built: 2022-12-02T06:58Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png index ca982688..8a77fc7f 100644 Binary files a/docs/dev/reference/Rplot001.png and b/docs/dev/reference/Rplot001.png differ diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png index de2d61aa..c1621707 100644 Binary files a/docs/dev/reference/Rplot002.png and b/docs/dev/reference/Rplot002.png differ diff --git a/docs/dev/reference/mhmkin-1.png b/docs/dev/reference/mhmkin-1.png new file mode 100644 index 00000000..2ecb6759 Binary files /dev/null and b/docs/dev/reference/mhmkin-1.png differ diff --git a/docs/dev/reference/mhmkin-2.png b/docs/dev/reference/mhmkin-2.png new file mode 100644 index 00000000..9bb43d35 Binary files /dev/null and b/docs/dev/reference/mhmkin-2.png differ diff --git a/docs/dev/reference/mhmkin.html b/docs/dev/reference/mhmkin.html index e72d17f9..1328aa48 100644 --- a/docs/dev/reference/mhmkin.html +++ b/docs/dev/reference/mhmkin.html @@ -113,7 +113,6 @@ mhmkin( backend = "saemix", algorithm = "saem", no_random_effect = NULL, - auto_ranef_threshold = 3, ..., cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL @@ -150,16 +149,14 @@ supported

      no_random_effect
      -

      Default is NULL and will be passed to saem. If -you specify "auto", random effects are only included if the number -of datasets in which the parameter passed the t-test is at least 'auto_ranef_threshold'. -Beware that while this may make for convenient model reduction or even -numerical stability of the algorithm, it will likely lead to -underparameterised models.

      - - -
      auto_ranef_threshold
      -

      See 'no_random_effect.

      +

      Default is NULL and will be passed to saem. If a +character vector is supplied, it will be passed to all calls to saem, +which will exclude random effects for all matching parameters. Alternatively, +a list of character vectors or an object of class illparms.mhmkin can be +specified. They have to have the same dimensions that the return object of +the current call will have, i.e. the number of rows must match the number +of degradation models in the mmkin object(s), and the number of columns must +match the number of error models used in the mmkin object(s).

      cores
      @@ -203,7 +200,7 @@ and the error model names for the second index (column index), with class attribute 'mhmkin'.

      -

      An object of class mhmkin.

      +

      An object inheriting from mhmkin.

    See also

    @@ -214,6 +211,88 @@ attribute 'mhmkin'.

    Johannes Ranke

    +
    +

    Examples

    +
    # \dontrun{
    +# We start with separate evaluations of all the first six datasets with two
    +# degradation models and two error models
    +f_sep_const <- mmkin(c("SFO", "FOMC"), ds_fomc[1:6], cores = 2, quiet = TRUE)
    +f_sep_tc <- update(f_sep_const, error_model = "tc")
    +# The mhmkin function sets up hierarchical degradation models aka
    +# nonlinear mixed-effects models for all four combinations, specifying
    +# uncorrelated random effects for all degradation parameters
    +f_saem_1 <- mhmkin(list(f_sep_const, f_sep_tc), cores = 2)
    +status(f_saem_1)
    +#>            error
    +#> degradation const tc
    +#>        SFO  OK    OK
    +#>        FOMC OK    OK
    +#> 
    +#> OK: Fit terminated successfully
    +# The 'illparms' function shows that in all hierarchical fits, at least
    +# one random effect is ill-defined (the confidence interval for the
    +# random effect expressed as standard deviation includes zero)
    +illparms(f_saem_1)
    +#>            error
    +#> degradation const        tc                        
    +#>        SFO  sd(parent_0) sd(parent_0)              
    +#>        FOMC sd(log_beta) sd(parent_0), sd(log_beta)
    +# Therefore we repeat the fits, excluding the ill-defined random effects
    +f_saem_2 <- update(f_saem_1, no_random_effect = illparms(f_saem_1))
    +status(f_saem_2)
    +#>            error
    +#> degradation const tc
    +#>        SFO  OK    OK
    +#>        FOMC OK    OK
    +#> 
    +#> OK: Fit terminated successfully
    +illparms(f_saem_2)
    +#>            error
    +#> degradation const tc
    +#>        SFO          
    +#>        FOMC         
    +# Model comparisons show that FOMC with two-component error is preferable,
    +# and confirms our reduction of the default parameter model
    +anova(f_saem_1)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     5 574.40 573.35 -282.20
    +#> SFO tc        6 543.72 542.47 -265.86
    +#> FOMC const    7 489.67 488.22 -237.84
    +#> FOMC tc       8 406.11 404.44 -195.05
    +anova(f_saem_2)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     4 572.22 571.39 -282.11
    +#> SFO tc        5 541.63 540.59 -265.81
    +#> FOMC const    6 487.38 486.13 -237.69
    +#> FOMC tc       6 402.12 400.88 -195.06
    +# The convergence plot for the selected model looks fine
    +saemix::plot(f_saem_2[["FOMC", "tc"]]$so, plot.type = "convergence")
    +
    +# The plot of predictions versus data shows that we have a pretty data-rich
    +# situation with homogeneous distribution of residuals, because we used the
    +# same degradation model, error model and parameter distribution model that
    +# was used in the data generation.
    +plot(f_saem_2[["FOMC", "tc"]])
    +
    +# We can specify the same parameter model reductions manually
    +no_ranef <- list("parent_0", "log_beta", "parent_0", c("parent_0", "log_beta"))
    +dim(no_ranef) <- c(2, 2)
    +f_saem_2m <- update(f_saem_1, no_random_effect = no_ranef)
    +anova(f_saem_2m)
    +#> Data: 95 observations of 1 variable(s) grouped in 6 datasets
    +#> 
    +#>            npar    AIC    BIC     Lik
    +#> SFO const     4 572.22 571.39 -282.11
    +#> SFO tc        5 541.63 540.59 -265.81
    +#> FOMC const    6 487.38 486.13 -237.69
    +#> FOMC tc       6 402.12 400.88 -195.06
    +# }
    +
    +