View source: R/xi_rolling_ccf.R
| run_rolling_xi_ccf | R Documentation |
Performs a rolling window analysis using Chatterjee's Xi cross-correlation to assess the time-varying non-linear lead-lag relationship between two time series.
run_rolling_xi_ccf(
x,
y,
time_index = NULL,
window_size,
step_size = 1,
max_lag = 20,
n_surr = 100,
bidirectional = TRUE,
sig_level = 0.95,
n_cores = NULL,
save_dir = NULL
)
x |
A numeric vector representing the first time series (predictor/lead candidate). |
y |
A numeric vector representing the second time series (response/lag candidate). |
time_index |
Optional vector of timestamps (e.g., Date, POSIXct) corresponding to x and y. |
window_size |
An integer specifying the size of the rolling window. |
step_size |
An integer specifying the step size by which the window is shifted. Default is 1. |
max_lag |
An integer specifying the maximum positive lag to compute. |
n_surr |
An integer specifying the number of MIAAFT surrogate datasets for the null hypothesis test. |
bidirectional |
Logical. If TRUE (default), computes both "X leads Y" and "Y leads X". |
sig_level |
A numeric value specifying the significance level for the confidence intervals. Default is 0.95. |
n_cores |
An integer specifying the number of cores for parallel execution. If |
save_dir |
A character string specifying the directory path to save intermediate window results as RDS files. If |
A data.frame containing the rolling window results in a tidy long-format.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.