This is the algorithm of Sheppard et al. (2017) (see references).
fastcohtest(
dat1,
dat2,
scale.min,
scale.max.input,
sigma,
f0,
nrand,
randnums,
randbits,
norm
)
A locations (rows) x time (columns) matrix (for spatial coherence), or a single time series
Same format as dat1
, same locations and times
The smallest scale of fluctuation that will be examined. At least 2.
The largest scale of fluctuation guaranteed to be examined
The ratio of each time scale examined relative to the next timescale. Should be greater than 1.
The ratio of the period of fluctuation to the width of the envelope
Number of surrogate randomizations to use for significance testing
A bunch of independent random numbers uniformly distributed on (0,1).
There must be nrand*floor((dim(dat1)[2]-1)/2)
of these.
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.
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
.
fastcohtest
returns a list with these elements:
The timescales used
The magnitude of this is the fast-algorithm version of the coherence between
the two datasets, for comparison with scoher
A matrix with nrand
rows, the magnitude of each one is the
fast-algorithm version of the coherence for a surrogate
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