trend: Estimate trend component

View source: R/itsmr.R

trendR Documentation

Estimate trend component

Description

Estimate trend component

Usage

trend(x, p)

Arguments

x

Time series data

p

Polynomial order (1 linear, 2 quadratic, etc.)

Value

Returns a vector the same length as x. Subtract from x to obtain residuals. The returned vector is the least squares fit of a polynomial to the data.

See Also

season

Examples

y = trend(uspop,2)
plotc(uspop,y)

itsmr documentation built on Aug. 6, 2022, 9:08 a.m.