multitaperTrend: Estimate Linear Trend using Multitaper Techniques

Description Usage Arguments Examples

View source: R/utility.R

Description

Estimate linear trend using inverse spectrum estimation, with the spectrum being computed via multitaper. This technique has improved spectral properties when compared to the least-squares approach. Returned values from this function include the intercept, slope, and centered time array.

Usage

1
multitaperTrend(xd, B, deltat, t.in)

Arguments

xd

Contiguous time series to be detrended.

B

Bandwidth to use in estimating trend in physical units; corresponds to NW via equation NW=BT, where N and W are the usual Slepian definitions, and T is the total time elapsed, i.e. T = N*deltat.

deltat

Time step for series xd, also used in computing T.

t.in

Time array, used in accurately estimating the slope.

Examples

1
2
3
4
5
x <- 1:101
y <- 1.0 + 0.5*(x) + rnorm(n=101,mean=0,sd=2)
vars <- multitaperTrend(xd=y, B=0.05, deltat=1.0, t.in=x)
plot(x,y,type="l")
lines(x,vars[[1]]+vars[[2]]*vars[[3]],type="l",col="red")

wesleyburr/multitaper documentation built on May 4, 2019, 5:21 a.m.