wav.trend.est: Linear Wavelet Thresholding Trend Estimation of Time Series

View source: R/wav.trend.est.R

wav.trend.estR Documentation

Linear Wavelet Thresholding Trend Estimation of Time Series

Description

Internal function to compute the linear wavelet thresholding trend estimate for a time series that may be second-order nonstationary. The function calculates the wavelet transform of the time series, sets to zero the non-boundary coefficients, then inverts the transform to obtain the estimate. This function is not intended for general use by regular users of the package.

Usage

wav.trend.est(
  x,
  filter.number = 4,
  family = "DaubLeAsymm",
  max.scale = floor(log2(length(x)) * 0.7),
  transform.type = "nondec",
  boundary.handle = FALSE,
  T.CI = FALSE,
  sig.lvl = 0.05,
  lag.max = floor(10 * (log10(length(x)))),
  confint.type = "normal",
  reps = 199,
  spec.est = NULL,
  ...
)

Arguments

x

The time series you want to estimate the trend function of.

filter.number

Selects the index of the wavelet used in the estimation procedure. For Daubechies compactly supported wavelets the filter number is the number of vanishing moments.

family

Selects the wavelet family to use. Recommended to only use the Daubechies compactly supported wavelets DaubExPhase and DaubLeAsymm.

max.scale

Selects the coarsest scale of the wavelet transform to analyse to. Should be a value from 1 (finest) to J-1 (coarsest), where n=2^J is the length of the time series.

transform.type

The type of wavelet transform used. Can be "dec" which is the standard discrete wavelet transform or "nondec" (default), a non-decimated wavelet transform, but a confidence interval cannot be calculated in this case.

boundary.handle

Logical variable. If TRUE, the time series is boundary corrected, to get a less variable trend estimate at the boundaries of the times series. If FALSE, no boundary correction is applied.

T.CI

Logical variable, only to be used if transform.type = TRUE. If TRUE, a (1-sig.lvl) pointwise confidence interval is computed for the trend estimate.

sig.lvl

Used only if T.CI = TRUE; a numeric value (0 <= sig.lvl <= 1) with which a (1-sig.lvl) pointwise confidence interval for the trend estimate is generated.

lag.max

Used only if T.CI = TRUE; a positive integer specifying the maximum lag to which the local autocovariance function is estimated.

confint.type

Used only if T.CI = TRUE; the type of confidence interval computed. Can be "percentile", in which case empirical percentiles are used, or "normal" (default), in which case the normal approximation is used.

reps

Used only if T.CI = TRUE and transform.type = "dec" ; the number of bootstrap replications used to compute the confidence interval.

spec.est

Used only if T.CI = TRUE; the spectrum estimate of the time series, used to calculate the confidence interval for the trend estimate.

...

Further arguments to be passed to the ewspec.trend call.

Value

A list object containing the following fields:

x

Input data

filter.number, family

Input wavelet parameters

transform.type, max.scale, boundary.handle, T.CI

Input parameters

T

A vector of length length(x) containing the trend estimate

lower.CI

Returned if T.CI = TRUE. The lower limit of the pointwise confidence interval

upper.CI

Returned if T.CI = TRUE. The upper limit of the pointwise confidence interval

sig.lvl

Returned if T.CI = TRUE. The significance level of the pointwise confidence interval

References

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

See Also

TLSW


TrendLSW documentation built on May 29, 2024, 6:06 a.m.