bandtest {wsyn} | R Documentation |
Aggregate significance across a timescale band
Description
Computes the aggregate significance of coherence (coh
) or of a wavelet linear model test object
(wlmtest
) across a timescale band, accounting for non-independence of timescales. Also gets the
average phase across the band, in the case of coherence.
Usage
bandtest(object, ...)
## Default S3 method:
bandtest(object, ...)
## S3 method for class 'coh'
bandtest(object, band, ...)
## S3 method for class 'wlmtest'
bandtest(object, band, ...)
Arguments
object |
An object of class |
... |
Passed from the generic to specific methods. Not currently used. |
band |
A length-two numeric vector indicating a timescale band |
Value
bandtest
returns an object of the same class as its first input but with a
bandp
slot added. Or if there was already a bandp
slot, the output has a
bandp
slot with an additional row. For a coh
object, the bandp
slot
is a data frame with four columns, the first two indicating the timescale band and the third
an associated p-value for the test of coherence over that band. The fourth column is the
average phase over the band. For a wlmtest
object, the result is only the first three
of the above columns.
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
coh
, wlm
, wlmtest
, browseVignettes("wsyn")
Examples
#Example for a coh object
times<-(-3:100)
ts1<-sin(2*pi*times/10)
ts2<-5*sin(2*pi*times/3)
artsig_x<-matrix(NA,11,length(times)) #the driver
for (counter in 1:11)
{
artsig_x[counter,]=ts1+ts2+rnorm(length(times),mean=0,sd=1.5)
}
times<-0:100
artsig_y<-matrix(NA,11,length(times)) #the driven
for (counter1 in 1:11)
{
for (counter2 in 1:101)
{
artsig_y[counter1,counter2]<-mean(artsig_x[counter1,counter2:(counter2+2)])
}
}
artsig_y<-artsig_y+matrix(rnorm(length(times)*11,mean=0,sd=3),11,length(times))
artsig_x<-artsig_x[,4:104]
artsig_x<-cleandat(artsig_x,times,1)$cdat
artsig_y<-cleandat(artsig_y,times,1)$cdat
cohobj<-coh(dat1=artsig_x,dat2=artsig_y,times=times,norm="powall",sigmethod="fast",nrand=1000,
f0=0.5,scale.max.input=28)
cohobj<-bandtest(cohobj,c(2,4))
#Example for a wlmtest object - see vignette