| wccCalcBatch | R Documentation |
Computes the Windowed Cross Correlation grid for a list of series pairs in one call, reusing per-series prefix sums across pairs. Real dyads and surrogate pairings drawn from the same series pool can therefore be evaluated together cheaply.
wccCalcBatch(seriesArray1, seriesArray2, pairs=NULL,
wMax=50, tMax=50, wInc=1, tInc=1, method=c("cumc"))
seriesArray1 |
A |
seriesArray2 |
A |
pairs |
A |
wMax |
Window size in samples (default=50). Must be at least 5. |
tMax |
Maximum lag in samples (default=50). |
wInc |
Window increment in samples (default=1). |
tInc |
Lag increment in samples (default=1). |
method |
Backend for the batched computation. Currently only |
Missing data is not supported: any NA in seriesArray1 or seriesArray2 raises an error.
The C backend computes per-series prefix sums once and reuses them across all pairs, so the batched call scales with the number of unique series rather than the number of pairs. This makes the function particularly efficient when many surrogate pairings are drawn from a small pool of series, as in wccSurrogateDyads and wccFindDyadParam.
An nRow x nCol x P numeric array. Slab [,,p] equals wccCalc(seriesArray1[pairs[p,1],], seriesArray2[pairs[p,2],], wMax=wMax, tMax=tMax, wInc=wInc, tInc=tInc, method="cumc").
wccCalc for the single-dyad interface and the definition of the returned grid.
D <- 3
n <- 500
arr1 <- t(sapply(1:D, function(i) sin(c(1:n)/10) + rnorm(n, sd=.5)))
arr2 <- t(sapply(1:D, function(i) sin(c(1:n)/12) + rnorm(n, sd=.5)))
grids <- wccCalcBatch(arr1, arr2, wMax=50, tMax=50)
dim(grids)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.