addwpmfs: Adds wavelet phasor mean field information to a 'clust'...

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

View source: R/addwpmfs.R

Description

When a clust object is created, the wpmfs slot is NA. This function fills it in, or adds to it.

Usage

1
2
3
4
5
6
addwpmfs(
  obj,
  level = 1:length(obj$clusters),
  sigmethod = "quick",
  nrand = 1000
)

Arguments

obj

An object of class clust

level

The clustering level(s) to use. 1 corresponds to no clustering. The default is all levels of clustering.

sigmethod

Method for significance testing the wpmf, one of quick, fft, aaft (see details of the wpmf function)

nrand

The number of randomizations to be used for significance testing

Details

This function uses the values of scale.min, scale.max.input, sigma and f0 stored in obj$methodspecs. It is possible to create a clust object with bad values for these slots. This function throws an error in that case. You can use a correlation-based method for calculating the synchrony matrix and still pass values of scale.min, scale.max.input, sigma and f0 to clust (in fact, this happens by default) - they won't be used by clust, but they will be there for later use by addwmfs and addwpmfs.

Value

addwpmfs returns another clust object with wpmfs slot now included, or more filled in than it was previously. With values of sigmethod other than "quick", this function can be slow, particularly with large nrand. So in that case the user may want to set level equal only to one clustering level of interest. Unlike wmf, old values in obj$wpmfs are overwritten.

Author(s)

Daniel Reuman, reuman@ku.edu

See Also

clust, addwmfs, browseVignettes("wsyn")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
sig<-matrix(.8,5,5)
diag(sig)<-1
lents<-50
if (requireNamespace("mvtnorm",quietly=TRUE))
{
  dat1<-t(mvtnorm::rmvnorm(lents,mean=rep(0,5),sigma=sig))
  dat2<-t(mvtnorm::rmvnorm(lents,mean=rep(0,5),sigma=sig))
}else
{
  dat1<-t(matrix(rep(rnorm(lents),times=5),lents,5))
  dat2<-t(matrix(rep(rnorm(lents),times=5),lents,5))
}
dat<-rbind(dat1,dat2)
times<-1:lents
dat<-cleandat(dat,times,clev=1)$cdat
coords<-data.frame(Y=rep(0,10),X=1:10)
method<-"coh.sig.fast"
clustobj<-clust(dat,times,coords,method,nsurrogs = 100)
res<-addwpmfs(clustobj)

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