xbispec.mtm: Cross-bispectrum

Description Usage Arguments Value Examples

View source: R/xbispec_mtm.R

Description

Compute cross-bispectrum with the multitaper method

Usage

1
xbispec.mtm(x, y, deltat = 1, nw = 4, k = 7, nPoly = 3)

Arguments

x

regularly sampled univariate time series. Can be passed as a ts object, a data.frame or simple vector of values. In the case of the latter, deltat must be specified. If passed as a data.frame, the first column must provide timing, the second the data itself.

y

regularly sampled univariate time series. Can be passed as a ts object, a data.frame or simple vector of values. In the case of the latter, deltat must be specified. If passed as a data.frame, the first column must provide timing, the second the data itself. Must share sample times with x.

deltat

time interval between samples, used only if x is passed as a vector. Defaults to 1.

nw

multitaper frequency bandwidth parameter, defaults to 4.

k

number of tapers, typically 2 * nw - 1, defaults to 7.

nPoly

order of the polynomial used for DC/trend removal, defaults to 3.

Value

list containing frequency, bispectrum, bispectral power, and bicoherence.

"freq1"

f1 frequencies (0 to Nyquist)

"freq2"

f12 frequencies (-Nyquist to Nyquist / 2)

"bispec"

Complex bispectrum [f1, f2]

"coher"

bicoherence [f1, f2]

"bpspec"

bispectral power [f1,f2]

Examples

1
2
3
4
5
6
7
t <- 1:256
f <- c( 1/20, 1/5 )
s <- sin( 2 * pi * t %o% f )
x <- apply( s, 1, sum ) + rnorm( length( t ), sd = 0.25 )
y <- sin( 2 * pi * t / 4 ) + rnorm( length( t ), sd = 0.25 )
b <- xbispec.mtm( x = x, y = y, deltat = 1 )
image( b$freq1, b$freq2, t( b$coher ), useRaster = TRUE )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.