From e09f726134ee273b6b191c1ec6465e6f701b082b Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 21 Oct 2019 18:52:24 +0200 Subject: Improve some plotting routines, more tests Static documentation rebuilt by pkgdown --- docs/reference/index.html | 2 +- docs/reference/mkinresplot.html | 19 ++++++++++++-- docs/reference/plot.mkinfit-2.png | Bin 52842 -> 57593 bytes docs/reference/plot.mkinfit-3.png | Bin 51545 -> 61280 bytes docs/reference/plot.mkinfit-5.png | Bin 59560 -> 59080 bytes docs/reference/plot.mkinfit.html | 12 +++++++-- docs/reference/synthetic_data_for_UBA_2014-1.png | Bin 62975 -> 62550 bytes docs/reference/synthetic_data_for_UBA_2014.html | 32 +++++++++++------------ 8 files changed, 44 insertions(+), 21 deletions(-) (limited to 'docs') diff --git a/docs/reference/index.html b/docs/reference/index.html index 08ad3d1a..e74a8ad5 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -175,7 +175,7 @@ -

plot(<mkinfit>) plot_sep()

+

plot(<mkinfit>) plot_sep() plot_res() plot_err()

Plot the observed data and the fitted model of an mkinfit object

diff --git a/docs/reference/mkinresplot.html b/docs/reference/mkinresplot.html index d841909f..eea5b218 100644 --- a/docs/reference/mkinresplot.html +++ b/docs/reference/mkinresplot.html @@ -146,7 +146,10 @@ obs_vars = names(object$mkinmod$map), xlim = c(0, 1.1 * max(object$data$time)), xlab = "Time", ylab = "Residual", - maxabs = "auto", legend = TRUE, lpos = "topright", ...) + maxabs = "auto", legend = TRUE, lpos = "topright", + col_obs = "auto", pch_obs = "auto", + frame = TRUE, + ...)

Arguments

@@ -184,7 +187,19 @@ + legend.

+ + + + + + + + + + + + diff --git a/docs/reference/plot.mkinfit-2.png b/docs/reference/plot.mkinfit-2.png index 84bec348..6910ae47 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-3.png b/docs/reference/plot.mkinfit-3.png index 557046da..8d399598 100644 Binary files a/docs/reference/plot.mkinfit-3.png and b/docs/reference/plot.mkinfit-3.png differ diff --git a/docs/reference/plot.mkinfit-5.png b/docs/reference/plot.mkinfit-5.png index 36fcff6a..20f30221 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.html b/docs/reference/plot.mkinfit.html index 795262f8..df01a00b 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -159,9 +159,12 @@ If the current plot device is a tikz device, 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, sep_obs=TRUE, show_residuals=TRUE, show_errmin=TRUE, ...) +plot_sep(fit, show_errmin=TRUE, ...) +plot_res(fit, sep_obs=FALSE, show_errmin=sep_obs, ...) +plot_err(fit, sep_obs=FALSE, show_errmin=sep_obs, ...)

Arguments

lpos

Where should the legend be placed? Default is "topright". Will be passed on to - legend.

col_obs

Colors for the observed variables.

pch_obs

Symbols to be used for the observed variables.

frame

Should a frame be drawn around the plots?

...
@@ -244,6 +247,11 @@ If the current plot device is a tikz device, + + + +
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. @@ -281,7 +289,7 @@ If the current plot device is a tikz device, # parent to sink included # \dontrun{ SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"), - m1 = mkinsub("SFO", full = "Metabolite M1" ))

#> Successfully compiled differential equation model from auto-generated C code.
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, show_residuals = TRUE)
plot(fit, show_errplot = TRUE)
+ m1 = mkinsub("SFO", full = "Metabolite M1" ))
#> Successfully compiled differential equation model from auto-generated C code.
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_res(fit)
plot_err(fit)
# Show the observed variables separately plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))
# Show the observed variables separately, with residuals diff --git a/docs/reference/synthetic_data_for_UBA_2014-1.png b/docs/reference/synthetic_data_for_UBA_2014-1.png index 9d8c0931..201ef0fd 100644 Binary files a/docs/reference/synthetic_data_for_UBA_2014-1.png and b/docs/reference/synthetic_data_for_UBA_2014-1.png differ diff --git a/docs/reference/synthetic_data_for_UBA_2014.html b/docs/reference/synthetic_data_for_UBA_2014.html index a639151b..ddc88c21 100644 --- a/docs/reference/synthetic_data_for_UBA_2014.html +++ b/docs/reference/synthetic_data_for_UBA_2014.html @@ -278,12 +278,13 @@ Compare also the code in the example section to see the degradation models." /> # This is just one example of an evaluation using the kinetic model used for # the generation of the data -fit <- mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data, - quiet = TRUE) -plot_sep(fit)
summary(fit)
#> mkin version used for fitting: 0.9.49.6 +# \dontrun{ + fit <- mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data, + quiet = TRUE) + plot_sep(fit)
summary(fit)
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.1 -#> Date of fit: Thu Sep 19 12:48:50 2019 -#> Date of summary: Thu Sep 19 12:48:50 2019 +#> Date of fit: Mon Oct 21 18:52:20 2019 +#> Date of summary: Mon Oct 21 18:52:20 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -292,21 +293,20 @@ Compare also the code in the example section to see the degradation models." /> #> #> Model predictions using solution type deSolve #> -#> Fitted using 847 model solutions performed in 2.49 s +#> Fitted using 847 model solutions performed in 2.42 s #> #> Error model: Constant variance #> #> Error model algorithm: OLS #> #> Starting values for parameters to be optimised: -#> value type -#> parent_0 101.350000 state -#> k_parent 0.100000 deparm -#> k_M1 0.100100 deparm -#> k_M2 0.100200 deparm -#> f_parent_to_M1 0.500000 deparm -#> f_M1_to_M2 0.500000 deparm -#> sigma 2.273126 error +#> value type +#> parent_0 101.3500 state +#> k_parent 0.1000 deparm +#> k_M1 0.1001 deparm +#> k_M2 0.1002 deparm +#> f_parent_to_M1 0.5000 deparm +#> f_M1_to_M2 0.5000 deparm #> #> Starting values for the transformed parameters actually optimised: #> value lower upper @@ -316,7 +316,6 @@ Compare also the code in the example section to see the degradation models." /> #> log_k_M2 -2.300587 -Inf Inf #> f_parent_ilr_1 0.000000 -Inf Inf #> f_M1_ilr_1 0.000000 -Inf Inf -#> sigma 2.273126 0 Inf #> #> Fixed parameter values: #> value type @@ -424,7 +423,8 @@ Compare also the code in the example section to see the degradation models." /> #> 90 M2 10.6 1.013e+01 0.47130 #> 90 M2 10.8 1.013e+01 0.67130 #> 120 M2 9.8 5.521e+00 4.27893 -#> 120 M2 3.3 5.521e+00 -2.22107
+#> 120 M2 3.3 5.521e+00 -2.22107
# } +