| smooth_per | R Documentation |
mvLSW routine.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.
smooth_per(RawPer, type = "all", kernel.name="daniell", optimize = FALSE, kernel.param =
NULL, smooth.Jset = NULL)
RawPer |
Raw wavelet periodogram that is to be smoothed, can be either a 4D array or a |
type |
Determines the type of smoothing to be performed, if |
kernel.name |
Name of the smoothing kernel to be applied. |
optimize |
Should the smoothing be optimized. If |
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. |
Returns a mvLSW object containing the smoothed EWS of a multivariate locally stationary time series.
Rebecca Wilson
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.
mvEWS, spec_estimation
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.