From c6079a807e2b400fe0c772603392aeacd887da2f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 8 May 2019 20:57:48 +0200 Subject: Add functionality to plot the error model by plotting squared residuals against predicted values, and showing the variance function used in the fitted error model. Rebuild docs --- docs/reference/plot.mkinfit.html | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'docs/reference/plot.mkinfit.html') diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index 525200ff..7bfc17f6 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -36,7 +36,7 @@ from a previous successful call to mkinfit and plots the observed data together with the solution of the fitted model. If the current plot device is a tikz device, - then latex is being used for the formatting of the chi2 error level, + then latex is being used for the formatting of the chi2 error level, if show_errmin = TRUE." /> @@ -137,7 +137,7 @@ If the current plot device is a tikz device, from a previous successful call to mkinfit and plots the observed data together with the solution of the fitted model.

If the current plot device is a tikz device, - then latex is being used for the formatting of the chi2 error level, + then latex is being used for the formatting of the chi2 error level, if show_errmin = TRUE.

@@ -151,7 +151,9 @@ plot(x, fit = x, col_obs = 1:length(obs_vars), pch_obs = col_obs, lty_obs = rep(1, length(obs_vars)), add = FALSE, legend = !add, - show_residuals = FALSE, maxabs = "auto", + show_residuals = FALSE, + show_errplot = FALSE, + maxabs = "auto", sep_obs = FALSE, rel.height.middle = 0.9, lpos = "topright", inset = c(0.05, 0.05), show_errmin = FALSE, errmin_digits = 3, …) @@ -213,10 +215,17 @@ plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, … 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? Otherwise, i.e. if + residual 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.

+ + 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 @@ -263,14 +272,18 @@ plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, …

# One parent compound, one metabolite, both single first order, path from # parent to sink included 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)
#> Warning: Observations with value of zero were removed from the data
plot(fit)
plot(fit, show_residuals = 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(fit, show_residuals = TRUE)
plot(fit, show_errplot = TRUE)
# Show the observed variables separately -plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))
+plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))
# Show the observed variables separately, with residuals plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"), - show_errmin = TRUE)
+ show_errmin = TRUE)
# The same can be obtained with less typing, using the convenience function plot_sep -plot_sep(fit, lpos = c("topright", "bottomright"))
+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)