detrend: Detrend a time series with a low-order polynomial.

Description Usage Arguments Value Examples

View source: R/detrend.R

Description

Remove low-order polynomial "trend" from a time series.

Usage

1
detrend(x, n = 1)

Arguments

x

time series or vector of data values

n

polynomial order

Value

ts object with low-order LS polynomial removed.

Examples

1
2
3
4
5
n <- 100
x <- arimaSim( n, ar = 0.9, int = 1 ) + 1:n / 20
plot( x )
d <- detrend( x, 1 )
plot( d )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.