View source: R/wav.diff.trend.est.R
wav.diff.trend.est | R Documentation |
Internal function to compute the wavelet thresholding trend estimate for a time series that may be second-order nonstationary. The function calculates the wavelet transform of the time series, thresholds the coefficients based on an estimate of their variance, and inverts to give the trend estimate. This function is not intended for general use by regular users of the package.
wav.diff.trend.est(
x,
spec.est,
filter.number = 4,
family = "DaubExPhase",
thresh.type = "hard",
normal = TRUE,
transform.type = "nondec",
max.scale = floor(0.7 * log2(length(x))),
boundary.handle = FALSE,
T.CI = FALSE,
reps = 199,
sig.lvl = 0.05,
confint.type = "normal",
...
)
x |
The time series you want to estimate the trend function of. |
spec.est |
You must supply the estimate of the evolutionary wavelet
spectrum of the time series. This is the output of the |
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. |
thresh.type |
The type of thresholding function used. Currently only
|
normal |
If TRUE, uses a threshold assuming the data are normally distributed. If FALSE, uses a larger threshold to reflect non-normality. |
transform.type |
String giving the type of wavelet transform used.
Can be |
max.scale |
Selects the number of scales of the wavelet transform to
apply thresholding to. Should be a value from 1 (finest) to J-1 (coarsest),
where |
boundary.handle |
Logical variable, decides if boundary handling should be applied to the time series before estimation. |
T.CI |
Logical variable. If |
reps |
Used only if |
sig.lvl |
Used only if |
confint.type |
Used only if |
... |
Further arguments to be passed to the |
Estimates the trend function of a locally stationary time series, by incorporating the evolutionary wavelet spectrum estimate in a wavelet thresholding procedure. To use this function, first compute the spectral estimate of the time series, using the function ewspec.diff.
The function works as follows:
1. The wavelet transform of the time series is calculated.
2. The wavelet coefficients at scale j
and location k
are individually thresholded using the universal
threshold \hat{\sigma}_{j,k}\sqrt{2 \log n}
, where \hat{\sigma}_{j,k}^2
is an estimate of their variance. The variance
estimate is calculated using the spectral estimate, supplied by the user in
the spec
argument.
3. The inverse wavelet transform is applied to obtain the final estimate.
A list
object containing the following fields:
x |
Input data |
filter.number , family |
Input wavelet parameters |
transform.type , max.scale , boundary.handle , thresh.type , normal , T.CI |
Input parameters |
T |
A vector of length |
lower.CI |
Returned if |
upper.CI |
Returned if |
reps |
Returned if |
sig.lvl |
Returned if |
McGonigle, E. T., Killick, R., and Nunes, M. (2022). Modelling time-varying first and second-order structure of time series via wavelets and differencing. Electronic Journal of Statistics, 6(2), 4398-4448.
TLSW
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.