From e5d1df9a9b1f0951d7dfbaf24eee4294470b73e2 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 17 Nov 2022 14:54:20 +0100 Subject: Complete update of online docs for v1.2.0 --- docs/reference/AIC.mmkin.html | 85 ++-- docs/reference/CAKE_export.html | 73 ++- docs/reference/D24_2014.html | 40 +- docs/reference/DFOP.solution.html | 35 +- docs/reference/Extract.mmkin.html | 55 +- docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html | 18 +- docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html | 18 +- docs/reference/FOCUS_2006_HS_ref_A_to_F.html | 18 +- docs/reference/FOCUS_2006_SFO_ref_A_to_F.html | 18 +- docs/reference/FOCUS_2006_datasets.html | 28 +- docs/reference/FOMC.solution.html | 37 +- docs/reference/HS.solution.html | 35 +- docs/reference/IORE.solution.html | 55 +- docs/reference/NAFTA_SOP_2015.html | 24 +- docs/reference/NAFTA_SOP_Attachment.html | 22 +- docs/reference/Rplot001.png | Bin 1011 -> 14083 bytes docs/reference/Rplot002.png | Bin 17010 -> 13699 bytes docs/reference/Rplot003.png | Bin 49705 -> 49894 bytes docs/reference/Rplot004.png | Bin 58906 -> 59077 bytes docs/reference/Rplot005.png | Bin 22787 -> 19451 bytes docs/reference/Rplot006.png | Bin 24269 -> 24295 bytes docs/reference/SFO.solution.html | 31 +- docs/reference/SFORB.solution.html | 35 +- docs/reference/add_err.html | 139 ++--- docs/reference/anova.saem.mmkin.html | 168 +++++++ docs/reference/aw.html | 59 ++- docs/reference/confint.mkinfit.html | 261 +++++----- docs/reference/create_deg_func.html | 73 +-- docs/reference/dimethenamid_2018-1.png | Bin 248255 -> 251312 bytes docs/reference/dimethenamid_2018.html | 234 +++++---- docs/reference/endpoints.html | 60 ++- docs/reference/experimental_data_for_UBA-1.png | Bin 102928 -> 102904 bytes docs/reference/experimental_data_for_UBA.html | 90 ++-- docs/reference/f_time_norm_focus.html | 89 ++-- docs/reference/focus_soil_moisture.html | 18 +- docs/reference/get_deg_func.html | 20 +- docs/reference/illparms.html | 26 +- docs/reference/ilr.html | 69 +-- docs/reference/index.html | 68 ++- docs/reference/intervals.saem.mmkin.html | 29 +- docs/reference/llhist.html | 151 ++++++ docs/reference/loftest-3.png | Bin 76869 -> 76871 bytes docs/reference/loftest-5.png | Bin 73212 -> 73212 bytes docs/reference/loftest.html | 121 ++--- docs/reference/logLik.mkinfit.html | 51 +- docs/reference/logLik.saem.mmkin.html | 138 +++++ docs/reference/logistic.solution.html | 111 ++-- docs/reference/lrtest.mkinfit.html | 61 ++- docs/reference/max_twa_parent.html | 65 ++- docs/reference/mccall81_245T.html | 100 ++-- docs/reference/mean_degparms.html | 41 +- docs/reference/mhmkin.html | 43 +- docs/reference/mixed-1.png | Bin 217349 -> 215088 bytes docs/reference/mixed.html | 123 +++-- docs/reference/mkin_long_to_wide.html | 31 +- docs/reference/mkin_wide_to_long.html | 31 +- docs/reference/mkinds.html | 14 +- docs/reference/mkindsg.html | 14 +- docs/reference/mkinerrmin.html | 51 +- docs/reference/mkinerrplot-1.png | Bin 41276 -> 41273 bytes docs/reference/mkinerrplot.html | 83 ++- docs/reference/mkinfit.html | 39 +- docs/reference/mkinmod.html | 188 ++++--- docs/reference/mkinparplot-1.png | Bin 26003 -> 25998 bytes docs/reference/mkinparplot.html | 41 +- docs/reference/mkinplot.html | 23 +- docs/reference/mkinpredict.html | 283 ++++++----- docs/reference/mkinresplot.html | 83 ++- docs/reference/mmkin-1.png | Bin 111900 -> 111900 bytes docs/reference/mmkin-2.png | Bin 108732 -> 108747 bytes docs/reference/mmkin-3.png | Bin 96805 -> 96798 bytes docs/reference/mmkin-4.png | Bin 67450 -> 67454 bytes docs/reference/mmkin-5.png | Bin 65338 -> 65333 bytes docs/reference/mmkin.html | 171 ++++--- docs/reference/multistart-1.png | Bin 0 -> 61330 bytes docs/reference/multistart-2.png | Bin 0 -> 56780 bytes docs/reference/multistart.html | 243 +++++++++ docs/reference/nafta.html | 47 +- docs/reference/nlme-1.png | Bin 68895 -> 67988 bytes docs/reference/nlme-2.png | Bin 92521 -> 91395 bytes docs/reference/nlme.html | 137 ++--- docs/reference/nlme.mmkin.html | 259 ++++++---- docs/reference/nobs.mkinfit.html | 25 +- docs/reference/parms.html | 122 +++-- docs/reference/parplot.html | 175 +++++++ docs/reference/plot.mixed.mmkin-2.png | Bin 173316 -> 173322 bytes docs/reference/plot.mixed.mmkin-3.png | Bin 172514 -> 172513 bytes docs/reference/plot.mixed.mmkin-4.png | Bin 175535 -> 175586 bytes docs/reference/plot.mixed.mmkin.html | 176 ++++--- docs/reference/plot.mkinfit-2.png | Bin 73190 -> 73194 bytes docs/reference/plot.mkinfit-5.png | Bin 67142 -> 67141 bytes docs/reference/plot.mkinfit-7.png | Bin 74322 -> 74323 bytes docs/reference/plot.mkinfit.html | 205 +++++--- docs/reference/plot.mmkin-2.png | Bin 50031 -> 50033 bytes docs/reference/plot.mmkin-3.png | Bin 46363 -> 46365 bytes docs/reference/plot.mmkin-4.png | Bin 33400 -> 33401 bytes docs/reference/plot.mmkin-5.png | Bin 58200 -> 58203 bytes docs/reference/plot.mmkin.html | 113 +++-- docs/reference/plot.nafta.html | 29 +- docs/reference/read_spreadsheet.html | 179 +++++++ docs/reference/reexports.html | 14 +- docs/reference/residuals.mkinfit.html | 29 +- docs/reference/saem-1.png | Bin 46419 -> 53991 bytes docs/reference/saem-2.png | Bin 49282 -> 49254 bytes docs/reference/saem-3.png | Bin 128227 -> 127024 bytes docs/reference/saem-4.png | Bin 171244 -> 173266 bytes docs/reference/saem.html | 612 +++++++++++++---------- docs/reference/schaefer07_complex_case.html | 44 +- docs/reference/set_nd_nq.html | 261 ++++++++++ docs/reference/sigma_twocomp.html | 63 ++- docs/reference/status.html | 174 +++++++ docs/reference/summary.mkinfit.html | 31 +- docs/reference/summary.mmkin.html | 26 +- docs/reference/summary.nlme.mmkin.html | 255 ++++++---- docs/reference/summary.saem.mmkin.html | 494 +++++++++--------- docs/reference/synthetic_data_for_UBA_2014-1.png | Bin 67450 -> 67454 bytes docs/reference/synthetic_data_for_UBA_2014.html | 258 +++++----- docs/reference/test_data_from_UBA_2014.html | 75 +-- docs/reference/tex_listing.html | 143 ++++++ docs/reference/transform_odeparms.html | 169 ++++--- docs/reference/update.mkinfit.html | 41 +- 121 files changed, 5705 insertions(+), 2781 deletions(-) create mode 100644 docs/reference/anova.saem.mmkin.html create mode 100644 docs/reference/llhist.html create mode 100644 docs/reference/logLik.saem.mmkin.html create mode 100644 docs/reference/multistart-1.png create mode 100644 docs/reference/multistart-2.png create mode 100644 docs/reference/multistart.html create mode 100644 docs/reference/parplot.html create mode 100644 docs/reference/read_spreadsheet.html create mode 100644 docs/reference/set_nd_nq.html create mode 100644 docs/reference/status.html create mode 100644 docs/reference/tex_listing.html (limited to 'docs/reference') diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index c46824e6..48e3b7e2 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -18,7 +18,7 @@ same dataset."> + + +
+
+ + + +
+
+ + +
+

Generate an anova object. The method to calculate the BIC is that from the +saemix package. As in other prominent anova methods, models are sorted by +number of parameters, and the tests (if requested) are always relative to +the model on the previous line.

+
+ +
+
# S3 method for saem.mmkin
+anova(
+  object,
+  ...,
+  method = c("is", "lin", "gq"),
+  test = FALSE,
+  model.names = NULL
+)
+
+ +
+

Arguments

+
object
+

An saem.mmkin object

+ + +
...
+

further such objects

+ + +
method
+

Method for likelihood calculation: "is" (importance sampling), +"lin" (linear approximation), or "gq" (Gaussian quadrature). Passed +to saemix::logLik.SaemixObject

+ + +
test
+

Should a likelihood ratio test be performed? If TRUE, +the alternative models are tested against the first model. Should +only be done for nested models.

+ + +
model.names
+

Optional character vector of model names

+ +
+
+

Value

+ + +

an "anova" data frame; the traditional (S3) result of anova()

+
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.6.

+
+ +
+ + + + + + + + diff --git a/docs/reference/aw.html b/docs/reference/aw.html index 1694d5f7..c1e1b4ed 100644 --- a/docs/reference/aw.html +++ b/docs/reference/aw.html @@ -19,7 +19,7 @@ by Burnham and Anderson (2004)."> + + +
+
+ + + +
+
+ + +
+

Produces a histogram of log-likelihoods. In addition, the likelihood of the +original fit is shown as a red vertical line.

+
+ +
+
llhist(object, breaks = "Sturges", lpos = "topleft", main = "", ...)
+
+ +
+

Arguments

+
object
+

The multistart object

+ + +
breaks
+

Passed to hist

+ + +
lpos
+

Positioning of the legend.

+ + +
main
+

Title of the plot

+ + +
...
+

Passed to hist

+ +
+
+

See also

+ +
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.6.

+
+ +
+ + + + + + + + diff --git a/docs/reference/loftest-3.png b/docs/reference/loftest-3.png index a1a65a61..d897c363 100644 Binary files a/docs/reference/loftest-3.png and b/docs/reference/loftest-3.png differ diff --git a/docs/reference/loftest-5.png b/docs/reference/loftest-5.png index c441f2ed..0847bbec 100644 Binary files a/docs/reference/loftest-5.png and b/docs/reference/loftest-5.png differ diff --git a/docs/reference/loftest.html b/docs/reference/loftest.html index ee9b37e4..254b568f 100644 --- a/docs/reference/loftest.html +++ b/docs/reference/loftest.html @@ -20,7 +20,7 @@ lrtest.default from the lmtest package."> + + +
+
+ + + +
+
+ + +
+

logLik method for saem.mmkin objects

+
+ +
+
# S3 method for saem.mmkin
+logLik(object, ..., method = c("is", "lin", "gq"))
+
+ +
+

Arguments

+
object
+

The fitted saem.mmkin object

+ + +
...
+

Passed to saemix::logLik.SaemixObject

+ + +
method
+

Passed to saemix::logLik.SaemixObject

+ +
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.6.

+
+ +
+ + + + + + + + diff --git a/docs/reference/logistic.solution.html b/docs/reference/logistic.solution.html index b09d3a69..a63b1b1b 100644 --- a/docs/reference/logistic.solution.html +++ b/docs/reference/logistic.solution.html @@ -18,7 +18,7 @@ an increasing rate constant, supposedly caused by microbial growth"> mkin - 1.1.0 + 1.2.0 @@ -48,11 +48,14 @@ and can be expressed by fixing the parameters of the other.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ and can be expressed by fixing the parameters of the other.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -95,11 +101,11 @@ and can be expressed by fixing the parameters of the other.

    -
    # S3 method for mkinfit
    -lrtest(object, object_2 = NULL, ...)
    -
    -# S3 method for mmkin
    -lrtest(object, ...)
    +
    # S3 method for mkinfit
    +lrtest(object, object_2 = NULL, ...)
    +
    +# S3 method for mmkin
    +lrtest(object, ...)
    @@ -107,11 +113,16 @@ and can be expressed by fixing the parameters of the other.

    object

    An mkinfit object, or an mmkin column object containing two fits to the same data.

    + +
    object_2

    Optionally, another mkinfit object fitted to the same data.

    + +
    ...

    Argument to mkinfit, passed to update.mkinfit for creating the alternative fitted object.

    +

    Details

    @@ -125,11 +136,11 @@ lower number of fitted parameters (null hypothesis).

    Examples

    -
    # \dontrun{
    -test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    -sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    -dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    -lrtest(dfop_fit, sfo_fit)
    +    
    # \dontrun{
    +test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
    +sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
    +dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
    +lrtest(dfop_fit, sfo_fit)
     #> Likelihood ratio test
     #> 
     #> Model 1: DFOP with error model const
    @@ -139,7 +150,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 3 -63.954 -2 43.002 4.594e-10 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -lrtest(sfo_fit, dfop_fit) +lrtest(sfo_fit, dfop_fit) #> Likelihood ratio test #> #> Model 1: DFOP with error model const @@ -149,14 +160,14 @@ lower number of fitted parameters (null hypothesis).

    #> 2 3 -63.954 -2 43.002 4.594e-10 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - -# The following two examples are commented out as they fail during -# generation of the static help pages by pkgdown -#lrtest(dfop_fit, error_model = "tc") -#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) - -# However, this equivalent syntax also works for static help pages -lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) + +# The following two examples are commented out as they fail during +# generation of the static help pages by pkgdown +#lrtest(dfop_fit, error_model = "tc") +#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) + +# However, this equivalent syntax also works for static help pages +lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) #> Likelihood ratio test #> #> Model 1: DFOP with error model tc @@ -166,7 +177,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 5 -42.453 -1 15.731 7.302e-05 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) +lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) #> Likelihood ratio test #> #> Model 1: DFOP with error model const @@ -176,7 +187,7 @@ lower number of fitted parameters (null hypothesis).

    #> 2 4 -57.340 -1 29.776 4.851e-08 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -# } +# }
    @@ -191,7 +202,7 @@ lower number of fitted parameters (null hypothesis).

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/max_twa_parent.html b/docs/reference/max_twa_parent.html index 69da881b..3c8e1662 100644 --- a/docs/reference/max_twa_parent.html +++ b/docs/reference/max_twa_parent.html @@ -23,7 +23,7 @@ soil section of the FOCUS guidance."> + + +
    +
    + + + +
    +
    + + +
    +

    The purpose of this method is to check if a certain algorithm for fitting +nonlinear hierarchical models (also known as nonlinear mixed-effects models) +will reliably yield results that are sufficiently similar to each other, if +started with a certain range of reasonable starting parameters. It is +inspired by the article on practical identifiabiliy in the frame of nonlinear +mixed-effects models by Duchesne et al (2021).

    +
    + +
    +
    multistart(
    +  object,
    +  n = 50,
    +  cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
    +  cluster = NULL,
    +  ...
    +)
    +
    +# S3 method for saem.mmkin
    +multistart(object, n = 50, cores = 1, cluster = NULL, ...)
    +
    +# S3 method for multistart
    +print(x, ...)
    +
    +best(object, ...)
    +
    +# S3 method for default
    +best(object, ...)
    +
    +which.best(object, ...)
    +
    +# S3 method for default
    +which.best(object, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    The fit object to work with

    + + +
    n
    +

    How many different combinations of starting parameters should be +used?

    + + +
    cores
    +

    How many fits should be run in parallel (only on posix platforms)?

    + + +
    cluster
    +

    A cluster as returned by parallel::makeCluster to be used +for parallel execution.

    + + +
    ...
    +

    Passed to the update function.

    + + +
    x
    +

    The multistart object to print

    + +
    +
    +

    Value

    + + +

    A list of saem.mmkin objects, with class attributes +'multistart.saem.mmkin' and 'multistart'.

    + + +

    The object with the highest likelihood

    + + +

    The index of the object with the highest likelihood

    +
    +
    +

    References

    +

    Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical +identifiability in the frame of nonlinear mixed effects models: the example +of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478. +doi: 10.1186/s12859-021-04373-4.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    # \dontrun{
    +library(mkin)
    +dmta_ds <- lapply(1:7, function(i) {
    +  ds_i <- dimethenamid_2018$ds[[i]]$data
    +  ds_i[ds_i$name == "DMTAP", "name"] <-  "DMTA"
    +  ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
    +  ds_i
    +})
    +names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
    +dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
    +dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
    +
    +f_mmkin <- mmkin("DFOP", dmta_ds, error_model = "tc", cores = 7, quiet = TRUE)
    +f_saem_full <- saem(f_mmkin)
    +f_saem_full_multi <- multistart(f_saem_full, n = 16, cores = 16)
    +parplot(f_saem_full_multi, lpos = "topleft")
    +
    +illparms(f_saem_full)
    +#> [1] "sd(log_k2)"
    +
    +f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2")
    +illparms(f_saem_reduced)
    +# On Windows, we need to create a cluster first. When working with
    +# such a cluster, we need to export the mmkin object to the cluster
    +# nodes, as it is referred to when updating the saem object on the nodes.
    +library(parallel)
    +cl <- makePSOCKcluster(12)
    +f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl)
    +parplot(f_saem_reduced_multi, lpos = "topright")
    +
    +stopCluster(cl)
    +# }
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html index 1d22b617..5906db4c 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -21,7 +21,7 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP."> mkin - 1.1.0 + 1.2.0 @@ -48,11 +48,14 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -95,10 +101,10 @@ order of increasing model complexity, i.e. SFO, then IORE, and finally DFOP.

    -
    nafta(ds, title = NA, quiet = FALSE, ...)
    -
    -# S3 method for nafta
    -print(x, quiet = TRUE, digits = 3, ...)
    +
    nafta(ds, title = NA, quiet = FALSE, ...)
    +
    +# S3 method for nafta
    +print(x, quiet = TRUE, digits = 3, ...)
    @@ -120,22 +126,35 @@ Degradation time values specified by the time argument, one column called "name" with the grouping of the observed values, and finally one column of observed values called "value".

    + +
    title

    Optional title of the dataset

    + +
    quiet

    Should the evaluation text be shown?

    + +
    ...

    Further arguments passed to mmkin (not for the printing method).

    + +
    x

    An nafta object.

    + +
    digits

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

    +

    Value

    -

    An list of class nafta. The list element named "mmkin" is the + + +

    An list of class nafta. The list element named "mmkin" is the mmkin object containing the fits of the three models. The list element named "title" contains the title of the dataset used. The list element "data" contains the dataset used in the fits.

    @@ -147,13 +166,13 @@ list element "data" contains the dataset used in the fits.

    Examples

    -
    
    -  nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    +    
    
    +  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)
    +  print(nafta_evaluation)
     #> Sums of squares:
     #>       SFO      IORE      DFOP 
     #> 1378.6832  615.7730  517.8836 
    @@ -192,9 +211,9 @@ list element "data" contains the dataset used in the fits.

    #> #> Representative half-life: #> [1] 841.41 - plot(nafta_evaluation) + plot(nafta_evaluation) - +
    @@ -209,7 +228,7 @@ list element "data" contains the dataset used in the fits.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png index 0b6cb78d..f4d04e1d 100644 Binary files a/docs/reference/nlme-1.png and b/docs/reference/nlme-1.png differ diff --git a/docs/reference/nlme-2.png b/docs/reference/nlme-2.png index ef152270..d9512f41 100644 Binary files a/docs/reference/nlme-2.png and b/docs/reference/nlme-2.png differ diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index ff8de9f3..83576e56 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -20,7 +20,7 @@ datasets. They are used internally by the nlme.mmkin() method."> mkin - 1.1.0 + 1.2.0 @@ -47,11 +47,14 @@ datasets. They are used internally by the nlme.mmkin() method."> Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -59,7 +62,10 @@ datasets. They are used internally by the nlme.mmkin() method."> Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -93,20 +99,25 @@ datasets. They are used internally by the nlme.m
    -
    nlme_function(object)
    -
    -nlme_data(object)
    +
    nlme_function(object)
    +
    +nlme_data(object)

    Arguments

    object

    An mmkin row object containing several fits of the same model to different datasets

    +

    Value

    -

    A function that can be used with nlme -A groupedData object

    + + +

    A function that can be used with nlme

    + + +

    A groupedData object

    See also

    @@ -115,78 +126,78 @@ A

    Examples

    -
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    -m_SFO <- mkinmod(parent = mkinsub("SFO"))
    -d_SFO_1 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.1),
    -  c(parent = 98), sampling_times)
    -d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    -d_SFO_2 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.05),
    -  c(parent = 102), sampling_times)
    -d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    -d_SFO_3 <- mkinpredict(m_SFO,
    -  c(k_parent = 0.02),
    -  c(parent = 103), sampling_times)
    -d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    -
    -d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    -d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    -d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    -ds <- c(d1 = d1, d2 = d2, d3 = d3)
    -
    -f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    -mean_dp <- mean_degparms(f)
    -grouped_data <- nlme_data(f)
    -nlme_f <- nlme_function(f)
    -# These assignments are necessary for these objects to be
    -# visible to nlme and augPred when evaluation is done by
    -# pkgdown to generate the html docs.
    -assign("nlme_f", nlme_f, globalenv())
    -assign("grouped_data", grouped_data, globalenv())
    -
    -library(nlme)
    -m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    -  data = grouped_data,
    -  fixed = parent_0 + log_k_parent_sink ~ 1,
    -  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    -  start = mean_dp)
    -summary(m_nlme)
    +    
    sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
    +m_SFO <- mkinmod(parent = mkinsub("SFO"))
    +d_SFO_1 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.1),
    +  c(parent = 98), sampling_times)
    +d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
    +d_SFO_2 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.05),
    +  c(parent = 102), sampling_times)
    +d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
    +d_SFO_3 <- mkinpredict(m_SFO,
    +  c(k_parent = 0.02),
    +  c(parent = 103), sampling_times)
    +d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
    +
    +d1 <- add_err(d_SFO_1, function(value) 3, n = 1)
    +d2 <- add_err(d_SFO_2, function(value) 2, n = 1)
    +d3 <- add_err(d_SFO_3, function(value) 4, n = 1)
    +ds <- c(d1 = d1, d2 = d2, d3 = d3)
    +
    +f <- mmkin("SFO", ds, cores = 1, quiet = TRUE)
    +mean_dp <- mean_degparms(f)
    +grouped_data <- nlme_data(f)
    +nlme_f <- nlme_function(f)
    +# These assignments are necessary for these objects to be
    +# visible to nlme and augPred when evaluation is done by
    +# pkgdown to generate the html docs.
    +assign("nlme_f", nlme_f, globalenv())
    +assign("grouped_data", grouped_data, globalenv())
    +
    +library(nlme)
    +m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink),
    +  data = grouped_data,
    +  fixed = parent_0 + log_k_parent_sink ~ 1,
    +  random = pdDiag(parent_0 + log_k_parent_sink ~ 1),
    +  start = mean_dp)
    +summary(m_nlme)
     #> Nonlinear mixed-effects model fit by maximum likelihood
     #>   Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) 
     #>   Data: grouped_data 
     #>        AIC      BIC    logLik
    -#>   300.6824 310.2426 -145.3412
    +#>   266.6428 275.8935 -128.3214
     #> 
     #> Random effects:
     #>  Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1)
     #>  Level: ds
     #>  Structure: Diagonal
    -#>         parent_0 log_k_parent_sink Residual
    -#> StdDev: 1.697361         0.6801209 3.666073
    +#>            parent_0 log_k_parent_sink Residual
    +#> StdDev: 0.000368491         0.7058039 3.065183
     #> 
     #> Fixed effects:  parent_0 + log_k_parent_sink ~ 1 
    -#>                       Value Std.Error DF  t-value p-value
    -#> parent_0          100.99378 1.3890416 46 72.70753       0
    -#> log_k_parent_sink  -3.07521 0.4018589 46 -7.65246       0
    +#>                       Value Std.Error DF   t-value p-value
    +#> parent_0          101.18323 0.7900461 43 128.07257       0
    +#> log_k_parent_sink  -3.08708 0.4171755 43  -7.39995       0
     #>  Correlation: 
     #>                   prnt_0
    -#> log_k_parent_sink 0.027 
    +#> log_k_parent_sink 0.031 
     #> 
     #> Standardized Within-Group Residuals:
    -#>        Min         Q1        Med         Q3        Max 
    -#> -1.9942823 -0.5622565  0.1791579  0.7165038  2.0704781 
    +#>         Min          Q1         Med          Q3         Max 
    +#> -2.38427070 -0.52059848  0.03593021  0.39987268  2.73188969 
     #> 
    -#> Number of Observations: 50
    +#> Number of Observations: 47
     #> Number of Groups: 3 
    -plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
    +plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
     
    -# augPred does not work on fits with more than one state
    -# variable
    -#
    -# The procedure is greatly simplified by the nlme.mmkin function
    -f_nlme <- nlme(f)
    -plot(f_nlme)
    +# augPred does not work on fits with more than one state
    +# variable
    +#
    +# The procedure is greatly simplified by the nlme.mmkin function
    +f_nlme <- nlme(f)
    +plot(f_nlme)
     
     
    @@ -202,7 +213,7 @@ A -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/nlme.mmkin.html b/docs/reference/nlme.mmkin.html index c8bd28e9..1e294eaf 100644 --- a/docs/reference/nlme.mmkin.html +++ b/docs/reference/nlme.mmkin.html @@ -19,7 +19,7 @@ have been obtained by fitting the same model to a list of datasets.">Extract model parameters from mkinfit models — parms • mkinExtract model parameters — parms • mkin @@ -19,7 +19,7 @@ considering the error structure that was assumed for the fit.">< mkin - 1.1.0 + 1.2.0 @@ -46,11 +46,14 @@ considering the error structure that was assumed for the fit.">< Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ considering the error structure that was assumed for the fit.">< Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -79,69 +85,91 @@ considering the error structure that was assumed for the fit."><
    -

    This function always returns degradation model parameters as well as error -model parameters, in order to avoid working with a fitted model without -considering the error structure that was assumed for the fit.

    +

    This function returns degradation model parameters as well as error +model parameters per default, in order to avoid working with a fitted model +without considering the error structure that was assumed for the fit.

    -
    parms(object, ...)
    -
    -# S3 method for mkinfit
    -parms(object, transformed = FALSE, ...)
    -
    -# S3 method for mmkin
    -parms(object, transformed = FALSE, ...)
    +
    parms(object, ...)
    +
    +# S3 method for mkinfit
    +parms(object, transformed = FALSE, errparms = TRUE, ...)
    +
    +# S3 method for mmkin
    +parms(object, transformed = FALSE, errparms = TRUE, ...)
    +
    +# S3 method for multistart
    +parms(object, exclude_failed = TRUE, ...)

    Arguments

    object
    -

    A fitted model object. Methods are implemented for -mkinfit() objects and for mmkin() objects.

    +

    A fitted model object.

    + +
    ...

    Not used

    + +
    transformed
    -

    Should the parameters be returned -as used internally during the optimisation?

    +

    Should the parameters be returned as used internally +during the optimisation?

    + + +
    errparms
    +

    Should the error model parameters be returned +in addition to the degradation parameters?

    + + +
    exclude_failed
    +

    For multistart objects, should rows for failed fits +be removed from the returned parameter matrix?

    +

    Value

    -

    For mkinfit objects, a numeric vector of fitted model parameters. -For mmkin row objects, a matrix with the parameters with a -row for each dataset. If the mmkin object has more than one row, a list of -such matrices is returned.

    + + +

    Depending on the object, a numeric vector of fitted model parameters, +a matrix (e.g. for mmkin row objects), or a list of matrices (e.g. for +mmkin objects with more than one row).

    +
    +
    +

    See also

    +

    Examples

    -
    # mkinfit objects
    -fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
    -parms(fit)
    +    
    # mkinfit objects
    +fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
    +parms(fit)
     #>   parent_0   k_parent      sigma 
     #> 82.4921598  0.3060633  4.6730124 
    -parms(fit, transformed = TRUE)
    +parms(fit, transformed = TRUE)
     #>     parent_0 log_k_parent        sigma 
     #>    82.492160    -1.183963     4.673012 
    -
    -# mmkin objects
    -ds <- lapply(experimental_data_for_UBA_2019[6:10],
    - function(x) subset(x$data[c("name", "time", "value")]))
    -names(ds) <- paste("Dataset", 6:10)
    -# \dontrun{
    -fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1)
    -parms(fits["SFO", ])
    +
    +# mmkin objects
    +ds <- lapply(experimental_data_for_UBA_2019[6:10],
    + function(x) subset(x$data[c("name", "time", "value")]))
    +names(ds) <- paste("Dataset", 6:10)
    +# \dontrun{
    +fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1)
    +parms(fits["SFO", ])
     #>            Dataset 6    Dataset 7  Dataset 8  Dataset 9  Dataset 10
     #> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450
     #> k_parent  0.05794659  0.009647805  0.2102974  0.1232258  0.00720421
     #> sigma     5.15274487  7.040168584  3.6769645  6.4669234  6.50457673
    -parms(fits[, 2])
    +parms(fits[, 2])
     #> $SFO
     #>             Dataset 7
     #> parent_0 82.666781678
    @@ -157,13 +185,13 @@ such matrices is returned.

    #> #> $DFOP #> Dataset 7 -#> parent_0 91.058971599 +#> parent_0 91.058971589 #> k1 0.044946770 #> k2 0.002868336 -#> g 0.526942414 +#> g 0.526942415 #> sigma 2.221302196 #> -parms(fits) +parms(fits) #> $SFO #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 #> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450 @@ -179,13 +207,13 @@ such matrices is returned.

    #> #> $DFOP #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.55213663 91.058971599 90.34509493 98.14858821 94.311323732 +#> parent_0 96.55213663 91.058971589 90.34509493 98.14858820 94.311323734 #> k1 0.21954588 0.044946770 0.41232288 0.31697588 0.080663857 #> k2 0.02957934 0.002868336 0.07581766 0.03260384 0.003425417 -#> g 0.44845068 0.526942414 0.66091967 0.65322767 0.342652880 +#> g 0.44845068 0.526942415 0.66091967 0.65322767 0.342652880 #> sigma 1.35690468 2.221302196 1.34169076 2.87159846 1.942067831 #> -parms(fits, transformed = TRUE) +parms(fits, transformed = TRUE) #> $SFO #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 #> parent_0 88.522754 82.666782 86.854731 91.777931 82.148094 @@ -207,7 +235,7 @@ such matrices is returned.

    #> g_qlogis -0.2069326 0.1078741 0.6673953 0.6332573 -0.6514943 #> sigma 1.3569047 2.2213022 1.3416908 2.8715985 1.9420678 #> -# } +# }
    @@ -222,7 +250,7 @@ such matrices is returned.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/parplot.html b/docs/reference/parplot.html new file mode 100644 index 00000000..f4f3c811 --- /dev/null +++ b/docs/reference/parplot.html @@ -0,0 +1,175 @@ + +Plot parameter variability of multistart objects — parplot • mkin + + +
    +
    + + + +
    +
    + + +
    +

    Produces a boxplot with all parameters from the multiple runs, scaled +either by the parameters of the run with the highest likelihood, +or by their medians as proposed in the paper by Duchesne et al. (2021).

    +
    + +
    +
    parplot(object, ...)
    +
    +# S3 method for multistart.saem.mmkin
    +parplot(
    +  object,
    +  llmin = -Inf,
    +  scale = c("best", "median"),
    +  lpos = "bottomleft",
    +  main = "",
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    The multistart object

    + + +
    ...
    +

    Passed to boxplot

    + + +
    llmin
    +

    The minimum likelihood of objects to be shown

    + + +
    scale
    +

    By default, scale parameters using the best available fit. +If 'median', parameters are scaled using the median parameters from all fits.

    + + +
    lpos
    +

    Positioning of the legend.

    + + +
    main
    +

    Title of the plot

    + +
    +
    +

    References

    +

    Duchesne R, Guillemin A, Gandrillon O, Crauste F. Practical +identifiability in the frame of nonlinear mixed effects models: the example +of the in vitro erythropoiesis. BMC Bioinformatics. 2021 Oct 4;22(1):478. +doi: 10.1186/s12859-021-04373-4.

    +
    +
    +

    See also

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/plot.mixed.mmkin-2.png b/docs/reference/plot.mixed.mmkin-2.png index b35f28d6..8678c166 100644 Binary files a/docs/reference/plot.mixed.mmkin-2.png and b/docs/reference/plot.mixed.mmkin-2.png differ diff --git a/docs/reference/plot.mixed.mmkin-3.png b/docs/reference/plot.mixed.mmkin-3.png index c981538f..9bd01852 100644 Binary files a/docs/reference/plot.mixed.mmkin-3.png and b/docs/reference/plot.mixed.mmkin-3.png differ diff --git a/docs/reference/plot.mixed.mmkin-4.png b/docs/reference/plot.mixed.mmkin-4.png index ccbe5861..a849aaee 100644 Binary files a/docs/reference/plot.mixed.mmkin-4.png and b/docs/reference/plot.mixed.mmkin-4.png differ diff --git a/docs/reference/plot.mixed.mmkin.html b/docs/reference/plot.mixed.mmkin.html index 2af2328d..b1083204 100644 --- a/docs/reference/plot.mixed.mmkin.html +++ b/docs/reference/plot.mixed.mmkin.html @@ -17,7 +17,7 @@ mkin - 1.1.0 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -87,94 +93,146 @@
    -
    # S3 method for mixed.mmkin
    -plot(
    -  x,
    -  i = 1:ncol(x$mmkin),
    -  obs_vars = names(x$mkinmod$map),
    -  standardized = TRUE,
    -  xlab = "Time",
    -  xlim = range(x$data$time),
    -  resplot = c("predicted", "time"),
    -  pred_over = NULL,
    -  test_log_parms = FALSE,
    -  conf.level = 0.6,
    -  default_log_parms = NA,
    -  ymax = "auto",
    -  maxabs = "auto",
    -  ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
    -  nrow.legend = ceiling((length(i) + 1)/ncol.legend),
    -  rel.height.legend = 0.02 + 0.07 * nrow.legend,
    -  rel.height.bottom = 1.1,
    -  pch_ds = 1:length(i),
    -  col_ds = pch_ds + 1,
    -  lty_ds = col_ds,
    -  frame = TRUE,
    -  ...
    -)
    +
    # S3 method for mixed.mmkin
    +plot(
    +  x,
    +  i = 1:ncol(x$mmkin),
    +  obs_vars = names(x$mkinmod$map),
    +  standardized = TRUE,
    +  xlab = "Time",
    +  xlim = range(x$data$time),
    +  resplot = c("predicted", "time"),
    +  pop_curve = "auto",
    +  pred_over = NULL,
    +  test_log_parms = FALSE,
    +  conf.level = 0.6,
    +  default_log_parms = NA,
    +  ymax = "auto",
    +  maxabs = "auto",
    +  ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
    +  nrow.legend = ceiling((length(i) + 1)/ncol.legend),
    +  rel.height.legend = 0.02 + 0.07 * nrow.legend,
    +  rel.height.bottom = 1.1,
    +  pch_ds = 1:length(i),
    +  col_ds = pch_ds + 1,
    +  lty_ds = col_ds,
    +  frame = TRUE,
    +  ...
    +)

    Arguments

    x

    An object of class mixed.mmkin, saem.mmkin or nlme.mmkin

    + +
    i

    A numeric index to select datasets for which to plot the individual predictions, in case plots get too large

    + +
    obs_vars

    A character vector of names of the observed variables for which the data and the model should be plotted. Defauls to all observed variables in the model.

    + +
    standardized

    Should the residuals be standardized? Only takes effect if resplot = "time".

    + +
    xlab

    Label for the x axis.

    + +
    xlim

    Plot range in x direction.

    + +
    resplot

    Should the residuals plotted against time or against predicted values?

    + + +
    pop_curve
    +

    Per default, a population curve is drawn in case +population parameters are fitted by the model, e.g. for saem objects. +In case there is a covariate model, no population curve is currently shown.

    + +
    pred_over

    Named list of alternative predictions as obtained from mkinpredict with a compatible mkinmod.

    + +
    test_log_parms

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    conf.level

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    default_log_parms

    Passed to mean_degparms in the case of an mixed.mmkin object

    + +
    ymax

    Vector of maximum y axis values

    + +
    maxabs

    Maximum absolute value of the residuals. This is used for the scaling of the y axis and defaults to "auto".

    + +
    ncol.legend

    Number of columns to use in the legend

    + +
    nrow.legend

    Number of rows to use in the legend

    + +
    rel.height.legend

    The relative height of the legend shown on top

    + +
    rel.height.bottom

    The relative height of the bottom plot row

    + +
    pch_ds

    Symbols to be used for plotting the data.

    + +
    col_ds

    Colors used for plotting the observed data and the corresponding model prediction lines for the different datasets.

    + +
    lty_ds

    Line types to be used for the model predictions.

    + +
    frame

    Should a frame be drawn around the plots?

    + +
    ...

    Further arguments passed to plot.

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Author

    @@ -183,41 +241,41 @@ corresponding model prediction lines for the different datasets.

    Examples

    -
    ds <- lapply(experimental_data_for_UBA_2019[6:10],
    - function(x) x$data[c("name", "time", "value")])
    -names(ds) <- paste0("ds ", 6:10)
    -dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
    -  A1 = mkinsub("SFO"), quiet = TRUE)
    -# \dontrun{
    -f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE)
    -plot(f[, 3:4], standardized = TRUE)
    +    
    ds <- lapply(experimental_data_for_UBA_2019[6:10],
    + function(x) x$data[c("name", "time", "value")])
    +names(ds) <- paste0("ds ", 6:10)
    +dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
    +  A1 = mkinsub("SFO"), quiet = TRUE)
    +# \dontrun{
    +f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE)
    +plot(f[, 3:4], standardized = TRUE)
     
    -
    -# For this fit we need to increase pnlsMaxiter, and we increase the
    -# tolerance in order to speed up the fit for this example evaluation
    -# It still takes 20 seconds to run
    -f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3))
    -plot(f_nlme)
    +
    +# For this fit we need to increase pnlsMaxiter, and we increase the
    +# tolerance in order to speed up the fit for this example evaluation
    +# It still takes 20 seconds to run
    +f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3))
    +plot(f_nlme)
     
    -
    -f_saem <- saem(f, transformations = "saemix")
    -plot(f_saem)
    +
    +f_saem <- saem(f, transformations = "saemix")
    +plot(f_saem)
     
    -
    -f_obs <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE, error_model = "obs")
    -f_nlmix <- nlmix(f_obs)
    +
    +f_obs <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE, error_model = "obs")
    +f_nlmix <- nlmix(f_obs)
     #> Error in nlmix(f_obs): could not find function "nlmix"
    -plot(f_nlmix)
    +plot(f_nlmix)
     #> Error in plot(f_nlmix): object 'f_nlmix' not found
    -
    -# We can overlay the two variants if we generate predictions
    -pred_nlme <- mkinpredict(dfop_sfo,
    -  f_nlme$bparms.optim[-1],
    -  c(parent = f_nlme$bparms.optim[[1]], A1 = 0),
    -  seq(0, 180, by = 0.2))
    -plot(f_saem, pred_over = list(nlme = pred_nlme))
    +
    +# We can overlay the two variants if we generate predictions
    +pred_nlme <- mkinpredict(dfop_sfo,
    +  f_nlme$bparms.optim[-1],
    +  c(parent = f_nlme$bparms.optim[[1]], A1 = 0),
    +  seq(0, 180, by = 0.2))
    +plot(f_saem, pred_over = list(nlme = pred_nlme))
     
    -# }
    +# }
     
    @@ -232,7 +290,7 @@ corresponding model prediction lines for the different datasets.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.mkinfit-2.png b/docs/reference/plot.mkinfit-2.png index 39098648..cef94cb8 100644 Binary files a/docs/reference/plot.mkinfit-2.png and b/docs/reference/plot.mkinfit-2.png differ diff --git a/docs/reference/plot.mkinfit-5.png b/docs/reference/plot.mkinfit-5.png index 3545b8d8..f90b3f54 100644 Binary files a/docs/reference/plot.mkinfit-5.png and b/docs/reference/plot.mkinfit-5.png differ diff --git a/docs/reference/plot.mkinfit-7.png b/docs/reference/plot.mkinfit-7.png index daf43033..3e5d828e 100644 Binary files a/docs/reference/plot.mkinfit-7.png and b/docs/reference/plot.mkinfit-7.png differ diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index 23cf27b5..cf96990e 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -19,7 +19,7 @@ observed data together with the solution of the fitted model.">< mkin - 1.1.0 + 1.2.0 @@ -46,11 +46,14 @@ observed data together with the solution of the fitted model.">< Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -58,7 +61,10 @@ observed data together with the solution of the fitted model.">< Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -91,50 +97,50 @@ observed data together with the solution of the fitted model.

    -
    # S3 method for mkinfit
    -plot(
    -  x,
    -  fit = x,
    -  obs_vars = names(fit$mkinmod$map),
    -  xlab = "Time",
    -  ylab = "Residue",
    -  xlim = range(fit$data$time),
    -  ylim = "default",
    -  col_obs = 1:length(obs_vars),
    -  pch_obs = col_obs,
    -  lty_obs = rep(1, length(obs_vars)),
    -  add = FALSE,
    -  legend = !add,
    -  show_residuals = FALSE,
    -  show_errplot = FALSE,
    -  maxabs = "auto",
    -  sep_obs = FALSE,
    -  rel.height.middle = 0.9,
    -  row_layout = FALSE,
    -  lpos = "topright",
    -  inset = c(0.05, 0.05),
    -  show_errmin = FALSE,
    -  errmin_digits = 3,
    -  frame = TRUE,
    -  ...
    -)
    -
    -plot_sep(
    -  fit,
    -  show_errmin = TRUE,
    -  show_residuals = ifelse(identical(fit$err_mod, "const"), TRUE, "standardized"),
    -  ...
    -)
    -
    -plot_res(
    -  fit,
    -  sep_obs = FALSE,
    -  show_errmin = sep_obs,
    -  standardized = ifelse(identical(fit$err_mod, "const"), FALSE, TRUE),
    -  ...
    -)
    -
    -plot_err(fit, sep_obs = FALSE, show_errmin = sep_obs, ...)
    +
    # S3 method for mkinfit
    +plot(
    +  x,
    +  fit = x,
    +  obs_vars = names(fit$mkinmod$map),
    +  xlab = "Time",
    +  ylab = "Residue",
    +  xlim = range(fit$data$time),
    +  ylim = "default",
    +  col_obs = 1:length(obs_vars),
    +  pch_obs = col_obs,
    +  lty_obs = rep(1, length(obs_vars)),
    +  add = FALSE,
    +  legend = !add,
    +  show_residuals = FALSE,
    +  show_errplot = FALSE,
    +  maxabs = "auto",
    +  sep_obs = FALSE,
    +  rel.height.middle = 0.9,
    +  row_layout = FALSE,
    +  lpos = "topright",
    +  inset = c(0.05, 0.05),
    +  show_errmin = FALSE,
    +  errmin_digits = 3,
    +  frame = TRUE,
    +  ...
    +)
    +
    +plot_sep(
    +  fit,
    +  show_errmin = TRUE,
    +  show_residuals = ifelse(identical(fit$err_mod, "const"), TRUE, "standardized"),
    +  ...
    +)
    +
    +plot_res(
    +  fit,
    +  sep_obs = FALSE,
    +  show_errmin = sep_obs,
    +  standardized = ifelse(identical(fit$err_mod, "const"), FALSE, TRUE),
    +  ...
    +)
    +
    +plot_err(fit, sep_obs = FALSE, show_errmin = sep_obs, ...)
    @@ -142,32 +148,56 @@ observed data together with the solution of the fitted model.

    x

    Alias for fit introduced for compatibility with the generic S3 method.

    + +
    fit

    An object of class mkinfit.

    + +
    obs_vars

    A character vector of names of the observed variables for which the data and the model should be plotted. Defauls to all observed variables in the model.

    + +
    xlab

    Label for the x axis.

    + +
    ylab

    Label for the y axis.

    + +
    xlim

    Plot range in x direction.

    + +
    ylim

    Plot range in y direction. If given as a list, plot ranges for the different plot rows can be given for row layout.

    + +
    col_obs

    Colors used for plotting the observed data and the corresponding model prediction lines.

    + +
    pch_obs

    Symbols to be used for plotting the data.

    + +
    lty_obs

    Line types to be used for the model predictions.

    + +
    add

    Should the plot be added to an existing plot?

    + +
    legend

    Should a legend be added to the plot?

    + +
    show_residuals

    Should residuals be shown? If only one plot of the fits is shown, the residual plot is in the lower third of the plot. @@ -175,47 +205,74 @@ Otherwise, i.e. if "sep_obs" is given, the residual plots will be located to the right of the plots of the fitted curves. If this is set to 'standardized', a plot of the residuals divided by the standard deviation given by the fitted error model will be shown.

    + +
    show_errplot

    Should squared residuals and the error model be shown? If only one plot of the fits is shown, this plot is in the lower third of the plot. Otherwise, i.e. if "sep_obs" is given, the residual plots will be located to the right of the plots of the fitted curves.

    + +
    maxabs

    Maximum absolute value of the residuals. This is used for the scaling of the y axis and defaults to "auto".

    + +
    sep_obs

    Should the observed variables be shown in separate subplots? If yes, residual plots requested by "show_residuals" will be shown next to, not below the plot of the fits.

    + +
    rel.height.middle

    The relative height of the middle plot, if more than two rows of plots are shown.

    + +
    row_layout

    Should we use a row layout where the residual plot or the error model plot is shown to the right?

    + +
    lpos

    Position(s) of the legend(s). Passed to legend as the first argument. If not length one, this should be of the same length as the obs_var argument.

    + +
    inset

    Passed to legend if applicable.

    + +
    show_errmin

    Should the FOCUS chi2 error value be shown in the upper margin of the plot?

    + +
    errmin_digits

    The number of significant digits for rounding the FOCUS chi2 error percentage.

    + +
    frame

    Should a frame be drawn around the plots?

    + +
    ...

    Further arguments passed to plot.

    + +
    standardized

    When calling 'plot_res', should the residuals be standardized in the residual plot?

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Details

    @@ -230,41 +287,41 @@ latex is being used for the formatting of the chi2 error level, if

    Examples

    -
    
    -# One parent compound, one metabolite, both single first order, path from
    -# parent to sink included
    -# \dontrun{
    -SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"),
    -                   m1 = mkinsub("SFO", full = "Metabolite M1" ))
    +    
    
    +# One parent compound, one metabolite, both single first order, path from
    +# parent to sink included
    +# \dontrun{
    +SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"),
    +                   m1 = mkinsub("SFO", full = "Metabolite M1" ))
     #> Temporary DLL for differentials generated and loaded
    -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
    +fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
     #> Warning: Observations with value of zero were removed from the data
    -fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, error_model = "tc")
    +fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, error_model = "tc")
     #> Warning: Observations with value of zero were removed from the data
    -plot(fit)
    +plot(fit)
     
    -plot_res(fit)
    +plot_res(fit)
     
    -plot_res(fit, standardized = FALSE)
    +plot_res(fit, standardized = FALSE)
     
    -plot_err(fit)
    +plot_err(fit)
     
    -
    -# Show the observed variables separately, with residuals
    -plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"),
    -     show_errmin = TRUE)
    +
    +# Show the observed variables separately, with residuals
    +plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"),
    +     show_errmin = TRUE)
     
    -
    -# The same can be obtained with less typing, using the convenience function plot_sep
    -plot_sep(fit, lpos = c("topright", "bottomright"))
    +
    +# The same can be obtained with less typing, using the convenience function plot_sep
    +plot_sep(fit, lpos = c("topright", "bottomright"))
     
    -
    -# Show the observed variables separately, with the error model
    -plot(fit, sep_obs = TRUE, show_errplot = TRUE, lpos = c("topright", "bottomright"),
    -     show_errmin = TRUE)
    +
    +# Show the observed variables separately, with the error model
    +plot(fit, sep_obs = TRUE, show_errplot = TRUE, lpos = c("topright", "bottomright"),
    +     show_errmin = TRUE)
     
    -# }
    -
    +# }
    +
     
    @@ -279,7 +336,7 @@ latex is being used for the formatting of the chi2 error level, if
    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.mmkin-2.png b/docs/reference/plot.mmkin-2.png index f5768c40..7af84edf 100644 Binary files a/docs/reference/plot.mmkin-2.png and b/docs/reference/plot.mmkin-2.png differ diff --git a/docs/reference/plot.mmkin-3.png b/docs/reference/plot.mmkin-3.png index c3f77d3d..56bfac50 100644 Binary files a/docs/reference/plot.mmkin-3.png and b/docs/reference/plot.mmkin-3.png differ diff --git a/docs/reference/plot.mmkin-4.png b/docs/reference/plot.mmkin-4.png index 29439156..5da05f40 100644 Binary files a/docs/reference/plot.mmkin-4.png and b/docs/reference/plot.mmkin-4.png differ diff --git a/docs/reference/plot.mmkin-5.png b/docs/reference/plot.mmkin-5.png index 89a111b0..3ec224f4 100644 Binary files a/docs/reference/plot.mmkin-5.png and b/docs/reference/plot.mmkin-5.png differ diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index 3dd0203b..30d0406e 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -21,7 +21,7 @@ the fit of at least one model to the same dataset is shown."> mkin - 1.1.0 + 1.2.0 @@ -48,11 +48,14 @@ the fit of at least one model to the same dataset is shown.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -60,7 +63,10 @@ the fit of at least one model to the same dataset is shown.">Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -94,22 +100,22 @@ the fit of at least one model to the same dataset is shown.

    -
    # S3 method for mmkin
    -plot(
    -  x,
    -  main = "auto",
    -  legends = 1,
    -  resplot = c("time", "errmod"),
    -  ylab = "Residue",
    -  standardized = FALSE,
    -  show_errmin = TRUE,
    -  errmin_var = "All data",
    -  errmin_digits = 3,
    -  cex = 0.7,
    -  rel.height.middle = 0.9,
    -  ymax = "auto",
    -  ...
    -)
    +
    # S3 method for mmkin
    +plot(
    +  x,
    +  main = "auto",
    +  legends = 1,
    +  resplot = c("time", "errmod"),
    +  ylab = "Residue",
    +  standardized = FALSE,
    +  show_errmin = TRUE,
    +  errmin_var = "All data",
    +  errmin_digits = 3,
    +  cex = 0.7,
    +  rel.height.middle = 0.9,
    +  ymax = "auto",
    +  ...
    +)
    @@ -117,43 +123,70 @@ the fit of at least one model to the same dataset is shown.

    x

    An object of class mmkin, with either one row or one column.

    + +
    main

    The main title placed on the outer margin of the plot.

    + +
    legends

    An index for the fits for which legends should be shown.

    + +
    resplot

    Should the residuals plotted against time, using mkinresplot, or as squared residuals against predicted values, with the error model, using mkinerrplot.

    + +
    ylab

    Label for the y axis.

    + +
    standardized

    Should the residuals be standardized? This option is passed to mkinresplot, it only takes effect if resplot = "time".

    + +
    show_errmin

    Should the chi2 error level be shown on top of the plots to the left?

    + +
    errmin_var

    The variable for which the FOCUS chi2 error value should be shown.

    + +
    errmin_digits

    The number of significant digits for rounding the FOCUS chi2 error percentage.

    + +
    cex

    Passed to the plot functions and mtext.

    + +
    rel.height.middle

    The relative height of the middle plot, if more than two rows of plots are shown.

    + +
    ymax

    Maximum y axis value for plot.mkinfit.

    + +
    ...

    Further arguments passed to plot.mkinfit and mkinresplot.

    +

    Value

    -

    The function is called for its side effect.

    + + +

    The function is called for its side effect.

    Details

    @@ -167,32 +200,32 @@ latex is being used for the formatting of the chi2 error level.

    Examples

    -
    
    -  # \dontrun{
    -  # Only use one core not to offend CRAN checks
    -  fits <- mmkin(c("FOMC", "HS"),
    -                list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles
    -                cores = 1, quiet = TRUE, error_model = "tc")
    +    
    
    +  # \dontrun{
    +  # Only use one core not to offend CRAN checks
    +  fits <- mmkin(c("FOMC", "HS"),
    +                list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), # named list for titles
    +                cores = 1, quiet = TRUE, error_model = "tc")
     #> Warning: Optimisation did not converge:
     #> iteration limit reached without convergence (10)
    -  plot(fits[, "FOCUS C"])
    +  plot(fits[, "FOCUS C"])
     
    -  plot(fits["FOMC", ])
    +  plot(fits["FOMC", ])
     
    -  plot(fits["FOMC", ], show_errmin = FALSE)
    +  plot(fits["FOMC", ], show_errmin = FALSE)
     
    -
    -  # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot
    -  # height should be smaller than the plot width (this is not possible for the html pages
    -  # generated by pkgdown, as far as I know).
    -  plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
    +
    +  # We can also plot a single fit, if we like the way plot.mmkin works, but then the plot
    +  # height should be smaller than the plot width (this is not possible for the html pages
    +  # generated by pkgdown, as far as I know).
    +  plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
     
    -
    -  # Show the error models
    -  plot(fits["FOMC", ], resplot = "errmod")
    +
    +  # Show the error models
    +  plot(fits["FOMC", ], resplot = "errmod")
     
    -  # }
    -
    +  # }
    +
     
    @@ -207,7 +240,7 @@ latex is being used for the formatting of the chi2 error level.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index af65d8eb..a7939f90 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -18,7 +18,7 @@ function (SFO, then IORE, then DFOP)."> + + +
    +
    + + + +
    +
    + + +
    +

    This function imports one dataset from each sheet of a spreadsheet file. +These sheets are selected based on the contents of a sheet 'Datasets', with +a column called 'Dataset Number', containing numbers identifying the dataset +sheets to be read in. In the second column there must be a grouping +variable, which will often be named 'Soil'. Optionally, time normalization +factors can be given in columns named 'Temperature' and 'Moisture'.

    +
    + +
    +
    read_spreadsheet(
    +  path,
    +  valid_datasets = "all",
    +  parent_only = FALSE,
    +  normalize = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    path
    +

    Absolute or relative path to the spreadsheet file

    + + +
    valid_datasets
    +

    Optional numeric index of the valid datasets, default is +to use all datasets

    + + +
    parent_only
    +

    Should only the parent data be used?

    + + +
    normalize
    +

    Should the time scale be normalized using temperature +and moisture normalisation factors in the sheet 'Datasets'?

    + +
    +
    +

    Details

    +

    There must be a sheet 'Compounds', with columns 'Name' and 'Acronym'. +The first row read after the header read in from this sheet is assumed +to contain name and acronym of the parent compound.

    +

    The dataset sheets should be named using the dataset numbers read in from +the 'Datasets' sheet, i.e. '1', '2', ... . In each dataset sheet, name +of the observed variable (e.g. the acronym of the parent compound or +one of its transformation products) should be in the first column, +the time values should be in the second colum, and the observed value +in the third column.

    +

    In case relevant covariate data are available, they should be given +in a sheet 'Covariates', containing one line for each value of the grouping +variable specified in 'Datasets'. These values should be in the first +column and the column must have the same name as the second column in +'Datasets'. Covariates will be read in from columns four and higher. +Their names should preferably not contain special characters like spaces, +so they can be easily used for specifying covariate models.

    +

    An similar data structure is defined as the R6 class mkindsg, but +is probably more complicated to use.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 4da7092a..24b9771e 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -28,7 +28,7 @@ intervals, nlme mkin - 1.1.0 + 1.2.0 @@ -55,11 +55,14 @@ intervals, nlme Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -67,7 +70,10 @@ intervals, nlme Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -120,7 +126,7 @@ below to see their documentation.

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/residuals.mkinfit.html b/docs/reference/residuals.mkinfit.html index 7d9e50de..07395436 100644 --- a/docs/reference/residuals.mkinfit.html +++ b/docs/reference/residuals.mkinfit.html @@ -17,7 +17,7 @@ mkin - 1.1.0 + 1.2.0 @@ -44,11 +44,14 @@ Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -56,7 +59,10 @@ Example evaluation of NAFTA SOP Attachment examples
  • - Some benchmark timings + Benchmark timings for mkin +
  • +
  • + Benchmark timings for saem.mmkin
  • @@ -87,28 +93,33 @@
    -
    # S3 method for mkinfit
    -residuals(object, standardized = FALSE, ...)
    +
    # S3 method for mkinfit
    +residuals(object, standardized = FALSE, ...)

    Arguments

    object

    A mkinfit object

    + +
    standardized

    Should the residuals be standardized by dividing by the standard deviation obtained from the fitted error model?

    + +
    ...

    Not used

    +

    Examples

    -
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
    -residuals(f)
    +    
    f <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
    +residuals(f)
     #> [1]  0.09726374 -0.13912142 -0.15351210  0.73388322 -0.08657004 -0.93204702
     #> [7] -0.03269080  1.45347823 -0.88423697
    -residuals(f, standardized = TRUE)
    +residuals(f, standardized = TRUE)
     #> [1]  0.13969917 -0.19981904 -0.22048826  1.05407091 -0.12433989 -1.33869208
     #> [7] -0.04695355  2.08761977 -1.27002287
     
    @@ -125,7 +136,7 @@ standard deviation obtained from the fitted error model?

    -

    Site built with pkgdown 2.0.3.

    +

    Site built with pkgdown 2.0.6.

    diff --git a/docs/reference/saem-1.png b/docs/reference/saem-1.png index 08939d4f..9e310252 100644 Binary files a/docs/reference/saem-1.png and b/docs/reference/saem-1.png differ diff --git a/docs/reference/saem-2.png b/docs/reference/saem-2.png index b737db03..de1bcf57 100644 Binary files a/docs/reference/saem-2.png and b/docs/reference/saem-2.png differ diff --git a/docs/reference/saem-3.png b/docs/reference/saem-3.png index 08e0f544..de569ce0 100644 Binary files a/docs/reference/saem-3.png and b/docs/reference/saem-3.png differ diff --git a/docs/reference/saem-4.png b/docs/reference/saem-4.png index bb775c25..0f2ee3e7 100644 Binary files a/docs/reference/saem-4.png and b/docs/reference/saem-4.png differ diff --git a/docs/reference/saem.html b/docs/reference/saem.html index 1bc6308e..5e7e0861 100644 --- a/docs/reference/saem.html +++ b/docs/reference/saem.html @@ -19,7 +19,7 @@ Expectation Maximisation algorithm (SAEM)."> + + +
    +
    + + + +
    +
    + + +
    +

    This function automates replacing unquantified values in residue time and +depth series. For time series, the function performs part of the residue +processing proposed in the FOCUS kinetics guidance for parent compounds +and metabolites. For two-dimensional residue series over time and depth, +it automates the proposal of Boesten et al (2015).

    +
    + +
    +
    set_nd_nq(res_raw, lod, loq = NA, time_zero_presence = FALSE)
    +
    +set_nd_nq_focus(
    +  res_raw,
    +  lod,
    +  loq = NA,
    +  set_first_sample_nd = TRUE,
    +  first_sample_nd_value = 0,
    +  ignore_below_loq_after_first_nd = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    res_raw
    +

    Character vector of a residue time series, or matrix of +residue values with rows representing depth profiles for a specific sampling +time, and columns representing time series of residues at the same depth. +Values below the limit of detection (lod) have to be coded as "nd", values +between the limit of detection and the limit of quantification, if any, have +to be coded as "nq". Samples not analysed have to be coded as "na". All +values that are not "na", "nd" or "nq" have to be coercible to numeric

    + + +
    lod
    +

    Limit of detection (numeric)

    + + +
    loq
    +

    Limit of quantification(numeric). Must be specified if the FOCUS rule to +stop after the first non-detection is to be applied

    + + +
    time_zero_presence
    +

    Do we assume that residues occur at time zero? +This only affects samples from the first sampling time that have been +reported as "nd" (not detected).

    + + +
    set_first_sample_nd
    +

    Should the first sample be set to "first_sample_nd_value" +in case it is a non-detection?

    + + +
    first_sample_nd_value
    +

    Value to be used for the first sample if it is a non-detection

    + + +
    ignore_below_loq_after_first_nd
    +

    Should we ignore values below the LOQ after the first +non-detection that occurs after the quantified values?

    + +
    +
    +

    Value

    + + +

    A numeric vector, if a vector was supplied, or a numeric matrix otherwise

    +
    +
    +

    Functions

    + +
    • set_nd_nq_focus(): Set non-detects in residue time series according to FOCUS rules

    • +
    +
    +

    References

    +

    Boesten, J. J. T. I., van der Linden, A. M. A., Beltman, W. H. +J. and Pol, J. W. (2015). Leaching of plant protection products and their +transformation products; Proposals for improving the assessment of leaching +to groundwater in the Netherlands — Version 2. Alterra report 2630, Alterra +Wageningen UR (University & Research centre)

    +

    FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation +Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, +18 December 2014, p. 251

    +
    + +
    +

    Examples

    +
    # FOCUS (2014) p. 75/76 and 131/132
    +parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd")
    +set_nd_nq(parent_1, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_2 <- c(.12, .09, .05, .03, "nd", "nd", .03, "nd", "nd", "nd")
    +set_nd_nq(parent_2, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.03 0.01   NA   NA
    +set_nd_nq_focus(parent_2, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_3 <- c(.12, .09, .05, .03, "nd", "nd", .06, "nd", "nd", "nd")
    +set_nd_nq(parent_3, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +set_nd_nq_focus(parent_3, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +metabolite <- c("nd", "nd", "nd", 0.03, 0.06, 0.10, 0.11, 0.10, 0.09, 0.05, 0.03, "nd", "nd")
    +set_nd_nq(metabolite, 0.02)
    +#>  [1]   NA   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +set_nd_nq_focus(metabolite, 0.02, 0.05)
    +#>  [1] 0.00   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +#
    +# Boesten et al. (2015), p. 57/58
    +table_8 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nq", 2), rep("nd", 2),
    +    10, 10, 10, "nq", "nd", "nd",
    +    "nq", 10, "nq", rep("nd", 3),
    +    "nd", "nq", "nq", rep("nd", 3),
    +    rep("nd", 6), rep("nd", 6)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_8, 0.5, 1.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25 0.25   NA   NA
    +#> [2,] 10.00 10.00  1.00 1.00 0.25   NA
    +#> [3,] 10.00 10.00 10.00 1.00 0.25   NA
    +#> [4,]  1.00 10.00  1.00 0.25   NA   NA
    +#> [5,]  0.25  1.00  1.00 0.25   NA   NA
    +#> [6,]    NA  0.25  0.25   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +table_10 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nd", 4),
    +    10, 10, 10, rep("nd", 3),
    +    "nd", 10, rep("nd", 4),
    +    rep("nd", 18)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_10, 0.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25   NA   NA   NA
    +#> [2,] 10.00 10.00  0.25   NA   NA   NA
    +#> [3,] 10.00 10.00 10.00 0.25   NA   NA
    +#> [4,]  0.25 10.00  0.25   NA   NA   NA
    +#> [5,]    NA  0.25    NA   NA   NA   NA
    +#> [6,]    NA    NA    NA   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/sigma_twocomp.html b/docs/reference/sigma_twocomp.html index 23102f17..c1db0d30 100644 --- a/docs/reference/sigma_twocomp.html +++ b/docs/reference/sigma_twocomp.html @@ -18,7 +18,7 @@ dependence of the measured value \(y\):"> + + +
    +
    + + + +
    +
    + + +
    +

    Method to get status information for fit array objects

    +
    + +
    +
    status(object, ...)
    +
    +# S3 method for mmkin
    +status(object, ...)
    +
    +# S3 method for status.mmkin
    +print(x, ...)
    +
    +# S3 method for mhmkin
    +status(object, ...)
    +
    +# S3 method for status.mhmkin
    +print(x, ...)
    +
    + +
    +

    Arguments

    +
    object
    +

    The object to investigate

    + + +
    ...
    +

    For potential future extensions

    + + +
    x
    +

    The object to be printed

    + +
    +
    +

    Value

    + + +

    An object with the same dimensions as the fit array +suitable printing method.

    +
    + +
    +

    Examples

    +
    # \dontrun{
    +fits <- mmkin(
    +  c("SFO", "FOMC"),
    +  list("FOCUS A" = FOCUS_2006_A,
    +       "FOCUS B" = FOCUS_2006_C),
    +  quiet = TRUE)
    +status(fits)
    +#>       dataset
    +#> model  FOCUS A FOCUS B
    +#>   SFO  OK      OK     
    +#>   FOMC OK      OK     
    +#> 
    +#> OK: No warnings
    +# }
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 17ecdfe4..0bb7f424 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -21,7 +21,7 @@ values.">Summary method for class "mmkin" — summary.mmkin • mkinWrap the output of a summary function in tex listing environment — tex_listing • mkin + + +
    +
    + + + +
    +
    + + +
    +

    This function can be used in a R markdown code chunk with the chunk +option results = "asis".

    +
    + +
    +
    tex_listing(object, caption = NULL, label = NULL, clearpage = TRUE)
    +
    + +
    +

    Arguments

    +
    object
    +

    The object for which the summary is to be listed

    + + +
    caption
    +

    An optional caption

    + + +
    label
    +

    An optional label

    + + +
    clearpage
    +

    Should a new page be started after the listing?

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 2da09efe..66e94941 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -22,7 +22,7 @@ the ilr transformation is used.">