pre.per: Functions to form periodogram objects with a common time and...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/pre.per.R

Description

The CNLT forms detail coefficients for each component of a bivariate series. Due to the two components having different sampling grids, the details (and associated scales) won't have a common association for both series. Hence the details are sampled and mapped to a common timescale and a common set of scales via binning and averaging. These functions compute spectral objects on these common times / scales

Usage

1
2
3
4
pre.per(x, det, lre, lreA, scale.range = NULL, time.range = NULL, Arange = NULL, 
Jstar = 20, Tstar = 50)
pre.per.comb(spec1, spec2)
pre.per.sample(spec1, spec2)

Arguments

x

A vector corrsponding to the sampling grid of a component of a series.

det

A list of (real or imaginary parts of) the detail coefficients from a CNLT decomposition, such as from the output of cnlt.biv.

lre

A list of scales (removed integral lengths) corresponding to det from a CNLT decomposition, such as from the output of cnlt.biv.

lreA

A list of asymmetry values from a CNLT decomposition, such as from the output of cnlt.biv.

scale.range

An optional two-vector specifying the range of scales to be considered in the resulting output spectrum.

time.range

An optional two-vector specifying the range of times to be considered in the resulting output spectrum.

Arange

An optional two-vector specifying whether the values used in forming the output spectrum should be limited to those from a specific range of asymmetry values, see Sanderson (2010), chapter 6.2.

Jstar

The number of artificial scales in the output spectrum.

Tstar

The number of artificial times in the output spectrum.

spec1

A periodogram corresponding to the first component of a bivariate series.

spec2

A periodogram corresponding to the second component of a bivariate series.

Details

For a bivariate series where the two components have different sampling grids, the co- /quadrature periodogram values are first formed using pre.per, using a vector of Tstar equal time intervals, specified by setting Tstar and optionally time.range; they are also binned into Jstar equal artificial levels by setting Jstar and optionally scale.range. The details are sampled using a common sampling vector with pre.per.sample, and then combined using pre.per.comb. The periodogram is then smoothed over time. See Hamilton et al (2018), section 2.3 for more details.

Value

For pre.per, a list with components:

spec

A matrix of dimension Jstar x Tstar corrsponding to a quadrature periodogram / co-periodogram of a bivariate series.

mscale

A vector of scales (of length Jstar) corresponding to the rows of the spectrum spec.

mtime

A vector of times (of length Tstar) corresponding to the columns of the spectrum spec.

For pre.per.sample, a list with components:

spec1

A matrix of dimension Jstar x Tstar corrsponding to a periodogram of the first component of a bivariate series.

spec2

A matrix of dimension Jstar x Tstar corrsponding to a periodogram of the second component of a bivariate series.

For pre.per.comb, a list with components:

spec

A matrix of dimension Jstar x Tstar corrsponding to a periodogram / quadrature periodogram / co-periodogram of a bivariate series.

Note

Note that these functions aren't intended to be used directly, but are called internally from the function cnlt.spec.DG.
Note also that the argument Tstar should be chosen small enough so that the range of the sampling grid x can be divided into equally spaced intervals, with *at least one* gridpoint in an interval.

Author(s)

Jean Hamilton, Matt Nunes

References

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.

See Also

cnlt.spec.DG, smooth.over.time

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# simulate data, e.g. two sinusoids
dat <- seq(from=1, to=3, by=0.1)
x1 <- cumsum(sample(dat, 200, TRUE))
x2 <- cumsum(sample(dat, 200, TRUE))

y1 <-sin(2*pi*(1/25)*x1) + sin(2*pi*(1/50)*x1)+ 1*sin(2*pi*(1/10)*x1)+ rnorm(length(x1), 0,0.2)
y3 <- sin(2*pi*(1/25)*x2[97:196]) + rnorm(length(x2), 0,0.1)

## Not run: 
y1y3.dec<-cnlt.biv(x1, f1=y1, f2=y3, P = 500)

# compute the co-periodogram for the first component...

C1 <- pre.per(x1, sapply(y1y3.dec$det1,Re), y1y3.dec$lre1, y1y3.dec$lreA1, Jstar = 10)

# .. and for the second component
C2 <- pre.per(x1, sapply(y1y3.dec$det2,Re), y1y3.dec$lre2, y1y3.dec$lreA2, Jstar = 10)

## End(Not run)

CNLTtsa documentation built on May 1, 2019, 9:39 p.m.