bispec.mtm: Auto-bispectrum

Description Usage Arguments Value Examples

View source: R/bispec_mtm.R

Description

Compute auto-bispectrum with the multitaper method

Usage

1
bispec.mtm(x, 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.

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
t <- 1:256
f <- c( 1/20, 1/5, 1/4 )
x <- sin( 2 * pi * t %o% f )
s <- apply( x, 1, sum ) + rnorm( length( t ), sd = 0.5 )
b <- bispec.mtm( s, deltat = 1 )
image( b$freq1, b$freq2, t( b$coher ), useRaster = TRUE )

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