ccf_rs: Calculate regime-switching cross-correlation

View source: R/ccfs.R

ccf_rsR Documentation

Calculate regime-switching cross-correlation

Description

Calculate regime-switching cross-correlation

Usage

ccf_rs(x, y, label, lag_max)

Arguments

x, y

A univariate numeric time series.

label

A factor of regime labels.

lag_max

Maximum lag at which to calculate the ccf.

Value

Cross-correlations for each group in label.

Examples

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)

mcgf documentation built on June 29, 2024, 9:09 a.m.