TLSWlacf {TrendLSW}R Documentation

Compute Localised Autocovariance Estimate of a TLSW Object

Description

Computes the local autocovariance and autocorrelation estimates, given an input of an object of class TLSW containing the estimated spectrum. Provides the same functionality as the function lacf from the locits package, but user provides an object of class TLSW as the main argument.

Usage

TLSWlacf(x.TLSW, lag.max = NULL)

Arguments

x.TLSW

a TLSW object.

lag.max

The maximum lag of acf required. If NULL then the same default as in the regular acf function is used.

Value

An object of class lacf which contains the following components:

References

McGonigle, E. T., Killick, R., and Nunes, M. (2022). Trend locally stationary wavelet processes. Journal of Time Series Analysis, 43(6), 895-917.

Nason, G. P. (2013). A test for second-order stationarity and approximate confidence intervals for localized autocovariances for locally stationary time series. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 75(5), 879–904.

Nason, G. P. (2016). locits: Tests of stationarity and localized autocovariance. R package version 1.7.3.

See Also

lacf

Examples


## ---- computes estimate of local autocovariance function


spec <- matrix(0, nrow = 9, ncol = 512)
spec[2, ] <- 1 + sin(seq(from = 0, to = 2 * pi, length = 512))^2

trend <- seq(from = 0, to = 10, length = 512)

set.seed(123)

x <- TLSWsim(trend = trend, spec = spec)

## ---- first estimate the spectrum:

x.TLSW <- TLSW(x)

#---- estimate the lacf:

lacf.est <- TLSWlacf(x.TLSW)

#---- plot the variance (lag 0 lacf) over time:

plot.ts(lacf.est$lacf[, 1], ylab = "Variance")

[Package TrendLSW version 1.0.2 Index]