Compares a wavelet linear model with a nested model. Also the generator function for
the wlmtest
class.
wlmtest(wlmobj, drop, sigmethod, nrand = 1000)
A wlm
object
Either names or indices of variables in wlmobj$dat
that are being
dropped to form the simpler, nested model. The first variable in wlmobj$dat
,
which is the response, is not allowed here.
Method for significance testing. One of "fft
", "aaft
", "fast
". See details.
The number of randomizations to do for significance
wlmtest
returns an object of class wlmtest
. Slots are:
The input
The input
A list with information from the significance testing. Elements are
sigmethod
(the input), coher
and scoher
. See details.
A list with ranking information for signif
. NA
until
plotrank
or bandtest
is called.
A data frame containing results of computing significances across
timescale bands. Empty on an initial call to wlmtest
, filled in by the function
bandtest
. See details.
The slot signif
provides the core information on significance.
If sigmethod
is not "fast
", then signif$coher
is the same as
wlmobj$coher
, and signif$scoher
is a matrix of dimensions nrand
by
length(signif$coher)
with rows equal to coherences between refitted models and the
response-variable transforms, for datasets where the variables specified in drop
have
been replaced by surrogates. Normalization as specified in norm
is used. The type
of surrogate used (Fourier surrogates or amplitude adjusted Fourier surrogates, see
surrog
) is determined by sigmethod
("fft
" or "aaft
").
Synchrony-preserving surrogates are used. A variety of statements of significance (or lack
thereof) can be made by comparing signif$coher
with signif$scoher
(see the
plotmag
, plotrank
, and bandtest
methods
for the wlmtest
class). If sigmethod
is
"fast
", a fast algorithm of Lawrence Sheppard is used which is a generalization
to wavelet linear models of the fast algorithm for coherence described in Sheppard et al (2017).
In that case
signif$coher
can be compared to signif$scoher
to make significance
statements about the coherence in exactly the same way, but signif$coher
will no
longer precisely equal wlmobj$coher
, and wlmobj$coher
should not be compared
directly to signif$scoher
. Statements about significance of the coherence
should be made using signif$coher
and signif$scoher
, whereas wlmobj$coher
should be used whenever the actual value of the coherence is needed.
The slots ranks
and bandp
are empty on an initial call to wlmtest
.
They are made to compute and hold
aggregate significance results over any timescale band of choice. These are filled in
when needed by other methods, see plotrank
and bandtest
.
Sheppard, L.W., et al. (2016) Changes in large-scale climate alter spatial synchrony of aphid pests. Nature Climate Change. DOI: 10.1038/nclimate2881
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
Sheppard, LW et al. (2019) Synchrony is more than its top-down and climatic parts: interacting Moran effects on phytoplankton in British seas. Plos Computational Biology 15, e1006744. doi: 10.1371/journal.pcbi.1006744
wlm
, plotrank
, bandtest
, coh
,
wlmtest_methods
, browseVignettes("wsyn")
# NOT RUN {
times<-1:30
dat<-list(v1=matrix(rnorm(300),10,30),v2=matrix(rnorm(300),10,30),v3=matrix(rnorm(300),10,30),
v4=matrix(rnorm(300),10,30),v5=matrix(rnorm(300),10,30))
dat<-lapply(FUN=function(x){cleandat(x,times,1)$cdat},X=dat)
resp<-1
pred<-2:3
norm<-"powall"
wlmobj<-wlm(dat,times,resp,pred,norm)
drop<-3
sigmethod<-"fft"
res<-wlmtest(wlmobj,drop,sigmethod,nrand=10)
# }
Run the code above in your browser using DataLab