smooth_per {mvLSWimpute}R Documentation

Function to smooth the raw wavelet periodogram using the default mvLSW routine.

Description

This function smooths the raw wavelet periodogram, similar to the mvEWS function in the mvLSW package, except acting on the raw periodogram directly. See mvEWS for more details. Note: this function is not really intended to be used separately, but internally within the spec_estimation function.

Usage

smooth_per(RawPer, type = "all", kernel.name="daniell", optimize = FALSE, kernel.param =
                 NULL, smooth.Jset = NULL)

Arguments

RawPer

Raw wavelet periodogram that is to be smoothed, can be either a 4D array or a mvLSW object.

type

Determines the type of smoothing to be performed, if "all" then the same smoothing kernel is applied to all levels, if "by.level" then a different smoothing kernel is applied to each level.

kernel.name

Name of the smoothing kernel to be applied.

optimize

Should the smoothing be optimized. If FALSE then smoothing is carried out with kernel.name and kernel.param.

kernel.param

Value of the smoothing kernel parameter to be applied.

smooth.Jset

Vector indicating which levels should be used in the calculation of the optimal kernel parameter. By default all levels are used.

Value

Returns a mvLSW object containing the smoothed EWS of a multivariate locally stationary time series.

Author(s)

Rebecca Wilson

References

Taylor, S.A.C., Park, T.A. and Eckley, I. (2019) Multivariate locally stationary wavelet analysis with the mvLSW R package. _Journal of Statistical Software_ *90*(11) pp. 1-16, doi:10.18637/jss.v090.i11.

Park, T., Eckley, I. and Ombao, H.C. (2014) Estimating time-evolving partial coherence between signals via multivariate locally stationary wavelet processes. _IEEE Transactions on Signal Processing_ *62*(20) pp. 5240-5250.

See Also

mvEWS, spec_estimation

Examples

## Sample bivariate locally stationary time series

set.seed(1)
X <- matrix(rnorm(2 * 2^8), ncol = 2)
X[1:2^7, 2] <- 3 * (X[1:2^7, 2] + 0.95 * X[1:2^7, 1])
X[-(1:2^7), 2] <- X[-(1:2^7), 2] - 0.95 * X[-(1:2^7), 1]
X[-(1:2^7), 1] <- X[-(1:2^7), 1] * 4
X <- as.ts(X)

# form periodogram
tmp = apply(X, 2, function(x){haarWT(x)$D})
D = array(t(tmp), dim = c(2, 2^8, 8))

#sqrv <- function(d) return( d %*% t(d) )

#RawPer = array(apply(D, c(2, 3), sqrv), dim = c(2, 2, 2^8, 8))
RawPer = array(apply(D, c(2, 3), tcrossprod), dim = c(2, 2, 2^8, 8))
RawPer = aperm(RawPer, c(1, 2, 4, 3))

# now smooth

smoothper = smooth_per(RawPer)


[Package mvLSWimpute version 0.1.1 Index]