wmf: Computes the wavelet mean field from a matrix of...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/wmf.R

Description

Computes the wavelet mean field from a matrix of spatiotemporal data. Also the creator function for the wmf class. The wmf class inherits from the tts class, which inherits from the list class.

Usage

1
wmf(dat, times, scale.min = 2, scale.max.input = NULL, sigma = 1.05, f0 = 1)

Arguments

dat

A locations (rows) x time (columns) matrix

times

A vector of time step values (e.g., years), spacing 1

scale.min

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

scale.max.input

The largest scale of fluctuation that will be examined. Note that if this is set too high relative to the length of the timeseries it will be truncated.

sigma

The ratio of each time scale examined relative to the next timescale. Greater than 1.

f0

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

Value

wmf returns an object of class wmf. Slots are:

values

A matrix of complex numbers containing the wavelet mean field, of dimensions length(times) by the number of timescales. Entries not considered reliable (longer timescales, near the edges of the time span) are set to NA.

times

The time steps specified (e.g., years)

timescales

The timescales (1/frequency) computed for the wavelet transforms

dat

The data matrix (locations by time) from which the wmf was computed

wtopt

The inputted wavelet transform options scale.min, scale.max.input, sigma, f0 in a list

Author(s)

Jonathan 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

wmf_methods, tts, wpmf, plotmag, browseVignettes("wsyn")

Examples

1
2
3
4
5
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
wmf<-wmf(dat,times)

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