Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/smooth.over.time.R
This function uses a running mean (box kernel) smoother to smooth spectra over time, with potentially different smoothing parameters used for each scale of the spectra
1 | smooth.over.time(x, spec, M, fact = 1)
|
x |
A vector corrsponding to the sampling grid of a component of a series. |
spec |
A spectral object (matrix), with rows corrsponding to different scales. |
M |
The smoothing parameter (binwidth) or vector of smoothing parameters (one for each scale) for the smoothing method. |
fact |
If |
The function takes in a matrix and performs a kernel smoother on row i
of the matrix, using a bandwidth of M[i]
if length(M)==nrow(spec)
, and M * fact^{i-1}
if length(M)==1
. Thus if the scaling factor, fact, is chosen to be greater than one, a wider kernel is used for the smoothing for later scales.
smooth.spec |
A matrix of same dimension as spec, containing smoothed spectral values. |
Jean Hamilton
Hamilton, J., Nunes, M. A., Knight, M. I. and Fryzlewicz, P. (2018) Complex-valued wavelet lifting and applications. Technometrics, 60 (1), 48-60, DOI 10.1080/00401706.2017.1281846.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | x<-sort(runif(100))
y <-sin(2*pi*(1/25)*x) + sin(2*pi*(1/50)*x)
## Not run:
xy.dec<-cnlt.univ(x,y,P=300)
# compute the real part of the spectrum (real details^2) and smooth over scale, then over time
ReS <- smooth.over.scale(x, sapply(xy.dec$det1,Re), sapply(xy.dec$det1,Re), xy.dec$lre,
xy.dec$lreA, positive = TRUE)
ReS.smooth <- smooth.over.time(x,ReS$spec,5,1.05)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.