aboutsummaryrefslogtreecommitdiff
path: root/man/one_box.Rd
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-01-18 19:58:13 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2017-01-18 19:58:13 +0100
commita1d9f93138c2cfed92a683e37e72c737d52b7ad7 (patch)
treeb05e26c2c35f62145ad86a34ce43b9aeb9faef91 /man/one_box.Rd
parent7900d5aa3b9e3036d0fd983a5611f71d3f3f64b2 (diff)
One box time series and twa values
- one_box() creates decline time series from mkinfit objects or simply from a half-life - sawtooth() generates sawtooth curves for arbitrary application patterns and decline models - twa() calculates moving window averages - max_twa() gives their maxima and - plot.one_box() can plot series generated by one_box() or sawtooth(), optionally adding a greay rectangle to illustrate the maximum moving window time weighted average
Diffstat (limited to 'man/one_box.Rd')
-rw-r--r--man/one_box.Rd45
1 files changed, 45 insertions, 0 deletions
diff --git a/man/one_box.Rd b/man/one_box.Rd
new file mode 100644
index 0000000..86440ce
--- /dev/null
+++ b/man/one_box.Rd
@@ -0,0 +1,45 @@
+% 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.mkinfit}
+\title{Create a time series of decline data}
+\usage{
+one_box(x, t_end = 100, res = 0.01, ...)
+
+\method{one_box}{numeric}(x, t_end = 100, res = 0.01, ...)
+
+\method{one_box}{mkinfit}(x, t_end = 100, res = 0.01, ...)
+}
+\arguments{
+\item{x}{When numeric, this is the half-life to be used for an exponential
+decline. If x is an mkinfit object, the decline is calculated from this object}
+
+\item{t_end}{End of the time series}
+
+\item{res}{Resolution of the time series}
+
+\item{...}{Further arguments passed to methods}
+}
+\description{
+The time series starts with the amount specified for the first application.
+This does not create objects of type \code{\link{ts}}.
+}
+\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)
+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)
+pred_2 <- one_box(fit_2)
+plot(pred_2)
+}

Contact - Imprint