runCorr: Running Correlations

View source: R/runCorr.R

runCorrR Documentation

Running Correlations

Description

Extracts the running correlations by sliding a window comprised of wsize time points, and in each window, the correlation of each pair of variables is computed. Each time the window is slid, the oldest time point is discarded and the latest time point is added.

Usage

runCorr(data, wsize = 25)

Arguments

data

N x v dataframe where N is the no. of time points and v the no. of variables

wsize

window size

Value

Running correlations time series

Examples

data(MentalLoad)
RS<-runCorr(data=MentalLoad,wsize=25)
ts.plot(RS, gpars=list(xlab="Window", ylab="Correlations", col=1:3,lwd=2))

kcpRS documentation built on Oct. 25, 2023, 5:07 p.m.