powered by
Calculate regime-switching cross-correlation
ccf_rs(x, y, label, lag_max)
Cross-correlations for each group in label.
label
A univariate numeric time series.
A factor of regime labels.
Maximum lag at which to calculate the ccf.
set.seed(123) x <- rnorm(100) y <- rnorm(100) label <- sample(1:2, 100, replace = TRUE) ccf_rs(x, y, label = factor(label), lag_max = 3)
Run the code above in your browser using DataLab