aboutsummaryrefslogtreecommitdiff
path: root/man/one_box.Rd
blob: 134b206d71f22f0c5514ad8e9eb08925d0d43329 (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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/twa.R
\name{one_box}
\alias{one_box}
\alias{one_box.numeric}
\alias{one_box.character}
\alias{one_box.mkinfit}
\title{Create a time series of decline data}
\usage{
one_box(x, ini, ..., t_end = 100, res = 0.01)

\method{one_box}{numeric}(x, ini = 1, ..., t_end = 100, res = 0.01)

\method{one_box}{character}(x, ini = 1, parms, ..., t_end = 100,
  res = 0.01)

\method{one_box}{mkinfit}(x, ini = "model", ..., t_end = 100, res = 0.01)
}
\arguments{
\item{x}{When numeric, this is the half-life to be used for an exponential
decline. When a character string specifying a parent decline model is given
e.g. \code{FOMC}, \code{parms} must contain the corresponding paramters.
If x is an \code{\link{mkinfit}} object, the decline is calculated from this
object.}

\item{ini}{The initial amount for the parent compound. If x is an 
\code{\link{mkinfit}} object, and ini is 'model', the fitted initial
concentrations are used. Otherwise, ini must be numeric. If it has
length one, it is used for the parent and initial values of metabolites
are zero, otherwise, it must give values for all observed variables.}

\item{...}{Further arguments passed to methods}

\item{t_end}{End of the time series}

\item{res}{Resolution of the time series}

\item{parms}{A named numeric vector containing the model parameters}
}
\value{
An object of class \code{one_box}, inheriting from \code{\link{ts}}.
}
\description{
Create a time series of decline data
}
\examples{
# Only use a half-life
pred_0 <- one_box(10)
plot(pred_0)

# Use a fitted mkinfit model
require(mkin)
fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE)
pred_1 <- one_box(fit)
plot(pred_1)

# Use a model with more than one observed variable
m_2 <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
fit_2 <- mkinfit(m_2, FOCUS_2006_D, quiet = TRUE)
pred_2 <- one_box(fit_2, ini = "model")
plot(pred_2)
}

Contact - Imprint