fastcohtest: Fast algorithm for significance testing coherence using...

Description Usage Arguments Value Note Author(s) References

View source: R/fastcohtest.R

Description

This is the algorithm of Sheppard et al. (2017) (see references).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fastcohtest(
  dat1,
  dat2,
  scale.min,
  scale.max.input,
  sigma,
  f0,
  nrand,
  randnums,
  randbits,
  norm
)

Arguments

dat1

A locations (rows) x time (columns) matrix (for spatial coherence), or a single time series

dat2

Same format as dat1, same locations and times

scale.min

The smallest scale of fluctuation that will be examined. At least 2.

scale.max.input

The largest scale of fluctuation guaranteed to be examined

sigma

The ratio of each time scale examined relative to the next timescale. Should be greater than 1.

f0

The ratio of the period of fluctuation to the width of the envelope

nrand

Number of surrogate randomizations to use for significance testing

randnums

A bunch of independent random numbers uniformly distributed on (0,1). There must be nrand*floor((dim(dat1)[2]-1)/2) of these.

randbits

A bunch of random bits (0 or 1). There must be nrand of these if time series are of odd length and 2*nrand if even length. You may pass more than this, so, in particular, you may pass 2*nrand for even or odd length.

norm

The normalization of wavelet transforms to use. Controls the version of the coherence that is performed. One of "none", "powall", "powind". See details in the documentation of coh.

Value

fastcohtest returns a list with these elements:

timescales

The timescales used

coher

The magnitude of this is the fast-algorithm version of the coherence between the two datasets, for comparison with scoher

scoher

A matrix with nrand rows, the magnitude of each one is the fast-algorithm version of the coherence for a surrogate

Note

Internal function, minimal error checking.

Author(s)

Lawrence Sheppard, lwsheppard@ku.edu; Daniel Reuman, reuman@ku.edu

References

Sheppard, L.W., et al. (2017) Rapid surrogate testing of wavelet coherences. European Physical Journal, Nonlinear and Biomedical Physics, 5, 1. DOI: 10.1051/epjnbp/2017000


wsyn documentation built on Jan. 15, 2021, 3:37 p.m.