getltrend: Returns linear trend in 'signal' time-serie

View source: R/functions.R

getltrendR Documentation

Returns linear trend in 'signal' time-serie

Description

This function detects a linear trend and returns it as a vector. The time can be recognised if the signal is a time-serie object. This function is a wrapper for gettrend().

Usage

getltrend(signal, time = NULL)

Arguments

signal

A vector or a time-serie object. Time-sorted values of signal containing trend.

time

A positive real number. Time span of the signal in base units.

Value

Returns an object of a class "trend" containing vector of values of the estimated trend.

The object also contains:

values

original values of the signal

detrended

the difference between the original values of the signal and the trend

time

vector of the time domain of the signal

model

model used to predct trend for purpose of estimating the trend on new data

See Also

gettrend(), plot.trend(), time.trend(), detrended(), orisignal(), predict.trend()

Examples

x <- sin(seq(0, 6, length.out=100)) + rnorm(100)
trend1 <- getltrend(x, time=1)
detrended(trend1)
predict(trend1, newtime=seq(1, 2, length.out=100))

data(austres)
trend2 <- getltrend(austres)
plot(trend2)

bartekkroczek/detrendeR documentation built on March 26, 2022, 10:40 p.m.