From 6464d3999338d34c081f360694dbc0bc0abf68cb Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 9 Nov 2020 14:23:16 +0100 Subject: Add plot method for saem.mmkin objects --- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/Rplot001.png | Bin 1011 -> 27839 bytes docs/dev/reference/Rplot002.png | Bin 57363 -> 56909 bytes docs/dev/reference/index.html | 6 + docs/dev/reference/plot.nlme.mmkin.html | 10 +- docs/dev/reference/plot.saem.mmkin-1.png | Bin 0 -> 86076 bytes docs/dev/reference/plot.saem.mmkin-2.png | Bin 0 -> 164014 bytes docs/dev/reference/plot.saem.mmkin.html | 308 +++++++++++++++++++++++++++++++ docs/dev/sitemap.xml | 3 + 9 files changed, 320 insertions(+), 9 deletions(-) create mode 100644 docs/dev/reference/plot.saem.mmkin-1.png create mode 100644 docs/dev/reference/plot.saem.mmkin-2.png create mode 100644 docs/dev/reference/plot.saem.mmkin.html (limited to 'docs') diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index a8bb6144..e14af5e0 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -10,7 +10,7 @@ articles: web_only/NAFTA_examples: NAFTA_examples.html web_only/benchmarks: benchmarks.html web_only/compiled_models: compiled_models.html -last_built: 2020-11-09T08:23Z +last_built: 2020-11-09T13:23Z 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 17a35806..cfc5bc2b 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 8ada7133..cd2014eb 100644 Binary files a/docs/dev/reference/Rplot002.png and b/docs/dev/reference/Rplot002.png differ diff --git a/docs/dev/reference/index.html b/docs/dev/reference/index.html index 825c4d27..f5621402 100644 --- a/docs/dev/reference/index.html +++ b/docs/dev/reference/index.html @@ -348,6 +348,12 @@ of an mmkin object

Summary method for class "saem.mmkin"

+ +

plot(<saem.mmkin>)

+ +

Plot an saem fitted nonlinear mixed model obtained via an mmkin row object

+ +

nlme_function() mean_degparms() nlme_data()

diff --git a/docs/dev/reference/plot.nlme.mmkin.html b/docs/dev/reference/plot.nlme.mmkin.html index 267bef05..8f5f85f7 100644 --- a/docs/dev/reference/plot.nlme.mmkin.html +++ b/docs/dev/reference/plot.nlme.mmkin.html @@ -150,7 +150,7 @@
# S3 method for nlme.mmkin
 plot(
   x,
-  i = 1:ncol(x$mmkin_orig),
+  i = 1:ncol(x$mmkin),
   obs_vars = names(x$mkinmod$map),
   standardized = TRUE,
   xlab = "Time",
@@ -165,8 +165,7 @@
   pch_ds = 1:length(i),
   col_ds = pch_ds + 1,
   lty_ds = col_ds,
-  frame = TRUE,
-  ...
+  frame = TRUE
 )

Arguments

@@ -247,11 +246,6 @@ corresponding model prediction lines for the different datasets.

frame

Should a frame be drawn around the plots?

- - ... -

Further arguments passed to plot.mkinfit and -mkinresplot.

-

Value

diff --git a/docs/dev/reference/plot.saem.mmkin-1.png b/docs/dev/reference/plot.saem.mmkin-1.png new file mode 100644 index 00000000..5cb33214 Binary files /dev/null and b/docs/dev/reference/plot.saem.mmkin-1.png differ diff --git a/docs/dev/reference/plot.saem.mmkin-2.png b/docs/dev/reference/plot.saem.mmkin-2.png new file mode 100644 index 00000000..67058e6c Binary files /dev/null and b/docs/dev/reference/plot.saem.mmkin-2.png differ diff --git a/docs/dev/reference/plot.saem.mmkin.html b/docs/dev/reference/plot.saem.mmkin.html new file mode 100644 index 00000000..d0790a98 --- /dev/null +++ b/docs/dev/reference/plot.saem.mmkin.html @@ -0,0 +1,308 @@ + + + + + + + + +Plot an saem fitted nonlinear mixed model obtained via an mmkin row object — plot.saem.mmkin • mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

Plot an saem fitted nonlinear mixed model obtained via an mmkin row object

+
+ +
# S3 method for saem.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"),
+  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.03 + 0.08 * 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 saem.mmkin

i

A numeric index to select datasets for which to plot the saem fit, +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?

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.

+

Author

+ +

Johannes Ranke

+ +

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) +
+f_saem <- saem(f) +
#> Running main SAEM algorithm +#> [1] "Mon Nov 9 14:21:22 2020" +#> .... +#> Minimisation finished +#> [1] "Mon Nov 9 14:21:31 2020"
plot(f_saem) +
# } +
+
+ +
+ + +
+ + +
+

Site built with pkgdown 1.6.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/dev/sitemap.xml b/docs/dev/sitemap.xml index d9ef2228..d6f55550 100644 --- a/docs/dev/sitemap.xml +++ b/docs/dev/sitemap.xml @@ -159,6 +159,9 @@ https://pkgdown.jrwb.de/mkin/reference/plot.nlme.mmkin.html + + https://pkgdown.jrwb.de/mkin/reference/plot.saem.mmkin.html + https://pkgdown.jrwb.de/mkin/reference/print.mkinds.html -- cgit v1.2.1