summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-03-22 17:42:14 +0530
committerSuraj Yerramilli2016-03-22 17:42:14 +0530
commitfe9d9be1ce419bb7f91091e44f91cf63209425b1 (patch)
tree4759c9e2ba8fbe13171b3abbe6c63b27a72e2651 /man
parentffe6d80840e46dcbef0b1e830de1d1500b276855 (diff)
downloadSysID-R-code-fe9d9be1ce419bb7f91091e44f91cf63209425b1.tar.gz
SysID-R-code-fe9d9be1ce419bb7f91091e44f91cf63209425b1.tar.bz2
SysID-R-code-fe9d9be1ce419bb7f91091e44f91cf63209425b1.zip
updating documentation
Diffstat (limited to 'man')
-rw-r--r--man/detrend.Rd34
-rw-r--r--man/predict.detrend.Rd30
2 files changed, 19 insertions, 45 deletions
diff --git a/man/detrend.Rd b/man/detrend.Rd
index a195171..62b71ab 100644
--- a/man/detrend.Rd
+++ b/man/detrend.Rd
@@ -4,34 +4,38 @@
\alias{detrend}
\title{Remove offsets and linear trends}
\usage{
-detrend(x, type = c("constant", "linear")[1])
+detrend(x, type = 0)
}
\arguments{
\item{x}{an object of class \code{idframe}}
-\item{type}{trend type - "constant" or "linear". (Default: \code{"constant"})}
+\item{type}{argument indicating the type of trend to be removed (Default=\code{0})
+\itemize{
+ \item type=\code{0}: Subtracts mean value from each signal
+ \item type=\code{1}: Subtracts a linear trend (least-squres fit)
+ \item type=\code{trInfo} object: Subtracts a trend specified by the object
+}}
}
\value{
-A list containing the following elements
-\item{fitted.values}{\code{idframe} object with detrended variables}
-\item{output_trend}{\code{list} containing trend fits for each output
- variable}
-\item{input_trend}{\code{list} containing trend fits for each input
- variable}
+A list containing two objects: the detrended data and the trend information
}
\description{
-Removes the offsets or linear trends in each of the input and output matrices.
+Removes offsets or trends from data
+}
+\details{
+\code{R} by default doesn't allow return of multiple objects. The \code{\%=\%}
+operator and \code{g} function in this package facillitate this behaviour. See
+the examples section for more information.
}
\examples{
data(cstr)
-fit <- detrend(cstr,type="linear") # remove linear trends
-Zdetrend <- predict(fit) # get the detrended data
-
-demean <- detrend(cstr) # remove offsets
-Zcent <- predict(demean) # get the centered data
+datatrain <- dataSlice(cstr,end=4500)
+datatest <- dataSlice(cstr,4501)
+g(Ztrain,tr) \%=\% detrend(datatrain) # Remove means
+g(Ztest) \%=\% detrend(datatest,tr)
}
\seealso{
-\code{\link{predict.detrend}}, \code{\link[stats]{lm}}
+\code{\link[stats]{lm}}
}
diff --git a/man/predict.detrend.Rd b/man/predict.detrend.Rd
deleted file mode 100644
index e91fb7e..0000000
--- a/man/predict.detrend.Rd
+++ /dev/null
@@ -1,30 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/preprocess.R
-\name{predict.detrend}
-\alias{predict.detrend}
-\title{Detrend data based on linear trend fits}
-\usage{
-\method{predict}{detrend}(model, newdata = NULL, ...)
-}
-\arguments{
-\item{model}{an object of class \code{detrend}}
-
-\item{newdata}{An optional idframe object in which to look for variables with
-which to predict. If ommited, the original detrended idframe object is used}
-}
-\value{
-an \code{idframe} object
-}
-\description{
-Returns detrended \code{idframe} object based on linear trend fit
-}
-\examples{
-data(cstr)
-train <- dataSlice(cstr,end=5000)
-test <- dataSlice(cstr,start=6001)
-fit <- detrend(train)
-Ztrain <- predict(fit)
-Ztest <- predict(fit,test)
-
-}
-