| wccHeatmap | R Documentation |
This function plots a heatmap of a chosen aggregate statistic from the results of wccFindDyadParam
wccHeatmap(xparam=NA, yparam=NA, aggstat=NA, xlabel=NA, ylabel=NA, pdffile=NA)
xparam |
One of the parameter columns from the dataframe returned by |
yparam |
One of the parameter columns from the dataframe returned by |
aggstat |
One of the aggregate statistics columns from the dataframe returned by wccFindDyadParam. |
xlabel |
A character string that will be used as the label for the x axis. |
ylabel |
A character string that will be used as the label for the y axis. |
pdffile |
A character string with the filename of a pdf file to create. If pdffile= |
This function produces a heat map plot of selected aggregated statistics returned by wccFindDyadParam for combinations of selected parameter values. First run wccFindDyadParam using two or more parameter vectors for a grid search. Next select two colums of parameters and one aggregated statistic to plot and send it to wccHeatmap. If the optional parameter pdffile exists, then a publication quality pdf file will be saved. Otherwise the heatmap will be displayed on the default device.
Returns nothing.
Boker, S. M., Rotondo, J. L., Xu, M., & King, K. (2002). Windowed cross-correlation and peak picking for the analysis of variability in the association between behavioral time series. Psychological methods, 7(3), 338.
wccFindDyadParam for the definition of the dataframe columns used by wccHeatmap.
# Create two arrays of timeseries with dyadic dependence
array1 <- matrix(NA, nrow=10, ncol=500)
array2 <- matrix(NA, nrow=10, ncol=500)
for(i in 1:10) {
array1[i,] <- sin(c(1:500)/runif(1, min=5, max=20)) + rnorm(500, mean=0, sd=.5)
array2[i,] <- array1[i,] + rnorm(500, mean=0, sd=.5)
}
# Select parameters to explore
wMaxVec <- c(50,100)
tMaxVec <- c(25,50)
wccFDPout <- wccFindDyadParam(inArray1=array1, inArray2=array2, wMaxvector=wMaxVec,
tMaxvector=tMaxVec, nSurrogates=30, samplespersecond=1, method="r")
# Plot the heatmap
wccHeatmap(xparam=wccFDPout$wMax, yparam=wccFDPout$tMax, aggstat=wccFDPout$maxMean,
xlabel="Window Max", ylabel="Max Lag")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.