aboutsummaryrefslogtreecommitdiff
path: root/man/plot.mkinfit.Rd
blob: b80928f7bab841d7c55f885b2f31950d3993aa98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
\name{plot.mkinfit}
\alias{plot.mkinfit}
\title{
  Plot the observed data and the fitted model of an mkinfit object
}
\description{
  Solves the differential equations with the optimised and fixed parameters
  from a previous successful call to \code{\link{mkinfit}} and plots 
  the observed data together with the solution of the fitted model.
}
\usage{
\method{plot}{mkinfit}(x, fit = x,
  obs_vars = names(fit$mkinmod$map),
  xlab = "Time", ylab = "Observed", 
  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, maxabs = "auto",
  sep_vars = FALSE, rel.height.middle = 0.9,
  lpos = "topright", inset = c(0.05, 0.05), \dots)
}
\arguments{
  \item{x}{
    Alias for fit introduced for compatibility with the generic S3 method.  
  }
  \item{fit}{
    An object of class \code{\link{mkinfit}}.
  }
  \item{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.
  }
  \item{xlab}{
    Label for the x axis.
  }
  \item{ylab}{
    Label for the y axis.
  }
  \item{xlim}{
    Plot range in x direction.
  }
  \item{ylim}{
    Plot range in y direction.
  }
  \item{col_obs}{
    Colors used for plotting the observed data and the corresponding model prediction lines.
  }
  \item{pch_obs}{
    Symbols to be used for plotting the data.
  }
  \item{lty_obs}{
    Line types to be used for the model predictions.
  }
  \item{add}{
    Should the plot be added to an existing plot?
  }
  \item{legend}{
    Should a legend be added to the plot?
  }
  \item{show_residuals}{
    Should residuals be shown in the lower third of the plot?
  }
  \item{maxabs}{
    Maximum absolute value of the residuals. This is used for the scaling of
    the y axis and defaults to "auto".
  }
  \item{sep_obs}{
    Should the observed variables be shown in separate subplots?
  }
  \item{rel.height.middle}{
    The relative height of the middle plot, if more than two rows of plots are shown.
  }
  \item{lpos}{
    Position(s) of the legend(s). Passed to \code{\link{legend}} as the first argument.
    If not length one, this should be of the same length as the obs_var argument.
  }
  \item{inset}{
    Passed to \code{\link{legend}} if applicable.
  }
  \item{\dots}{
    Further arguments passed to \code{\link{plot}}.
  }
}
\value{
  The function is called for its side effect.
}
\examples{
# One parent compound, one metabolite, both single first order, path from
# parent to sink included, use Levenberg-Marquardt for speed
SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"),
                   m1 = mkinsub("SFO", full = "Metabolite M1" ))
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, method.modFit = "Marq")
plot(fit)

# Show the observed variables separately
plot(fit, sep_obs = TRUE)

# Show the observed variables separately, with residuals
plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"))
}
\author{
  Johannes Ranke
}

Contact - Imprint