blob: a19517100c8f47e7fd25b872047d60060b4183d2 (
plain)
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
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocess.R
\name{detrend}
\alias{detrend}
\title{Remove offsets and linear trends}
\usage{
detrend(x, type = c("constant", "linear")[1])
}
\arguments{
\item{x}{an object of class \code{idframe}}
\item{type}{trend type - "constant" or "linear". (Default: \code{"constant"})}
}
\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}
}
\description{
Removes the offsets or linear trends in each of the input and output matrices.
}
\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
}
\seealso{
\code{\link{predict.detrend}}, \code{\link[stats]{lm}}
}
|