wpmf {wsyn} | R Documentation |
Wavelet phasor mean field
Description
Computes the wavelet phasor mean field from a matrix of spatiotemporal data. Also the
creator function for the wpmf
class. The wpmf
class inherits from the
tts
class, which inherits from the list
class.
Usage
wpmf(
dat,
times,
scale.min = 2,
scale.max.input = NULL,
sigma = 1.05,
f0 = 1,
sigmethod = "none",
nrand = 1000
)
Arguments
dat |
A locations (rows) x time (columns) matrix |
times |
A vector of time step values, spacing 1 |
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 envelop |
sigmethod |
Method for significance testing the wmpf, one of |
nrand |
The number of randomizations to be used for significance testing |
Details
For sigmethod
equal to quick
, the empirical wpmf is compared to a distribution of
magnitudes of sums of random phasors, using the same number of phasors as there are time series. The signif
output is a list with first element "quick
" and second element a vector of nrand
magnitudes of sums
of random phasors. For sigmethod
equal to fft
, the empirical wpmf is compared to wmpfs of
Fourier surrogate datasets. The signif
output is a list with first element "fft
", second element
equal to nrand
, and third element the fraction of surrogate-based wpmf magnitudes that the empirical wpmf
magnitude is greater than (times by timescales matrix). For sigmethod
equal to aaft
, aaft
surrogates are used instead. Output has similar format to the fft
case. Values other than quick
,
fft
, and aaft
for sigmethod
result in no significance testing.
Value
wpmf
returns an object of class wpmf
. Slots are:
values |
A matrix of complex numbers containing the wavelet phasor mean field, of dimensions |
times |
The times associated with the data and the |
timescales |
The timescales associated with the |
signif |
A list with information from the significance testing. Format depends on |
dat |
The data matrix (locations by time) from which the |
wtopt |
The inputted wavelet transform options scale.min, scale.max.input, sigma, f0 in a list |
Author(s)
Thomas Anderson, anderstl@gmail.com, Jon Walter, jaw3es@virginia.edu; Lawrence Sheppard, lwsheppard@ku.edu; Daniel Reuman, reuman@ku.edu
References
Sheppard, L.W., et al. (2016) Changes in large-scale climate alter spatial synchrony of aphid pests. Nature Climate Change. DOI: 10.1038/nclimate2881
See Also
wpmf_methods
, wmf
, tts
, plotmag
,
browseVignettes("wsyn")
Examples
times<-1:30 #generate time steps
#generate fake count data for 20 locations
dat<-matrix(rpois(20*length(times),20),nrow=20,ncol=length(times))
dat<-cleandat(dat=dat,times=times,clev=2)$cdat #detrend and demean
res<-wpmf(dat,times)