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.
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,
...
)A list object containing the following fields:
Input data
Input wavelet parameters
Input parameters
A vector of length length(x) containing the trend estimate
Returned if T.CI = TRUE. The lower limit of the pointwise confidence interval
Returned if T.CI = TRUE. The upper limit of the pointwise confidence interval
Returned if T.CI = TRUE. The significance level of the pointwise confidence interval
The time series you want to estimate the trend function of.
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.
Selects the wavelet family to use. Recommended to only use the Daubechies compactly supported wavelets DaubExPhase and DaubLeAsymm.
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.
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.
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.
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.
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.
Used only if T.CI = TRUE; a positive integer
specifying the maximum lag to which the local autocovariance function is
estimated.
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.
Used only if T.CI = TRUE and transform.type = "dec" ; the number
of bootstrap replications used to compute the confidence interval.
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.
McGonigle, E. T., Killick, R., and Nunes, M. (2022). Trend locally stationary wavelet processes. Journal of Time Series Analysis, 43(6), 895-917.
TLSW