calculate_lagged_correlation.Rd
calculate_lagged_correlation
calculate_lagged_correlation(
x,
y,
time1,
time2,
time_tol = 1,
step = 1/60,
min_matched_sample = 10,
progressbar = TRUE,
all_idx = NULL,
threads = 10,
cor_method = c("spearman", "pearson")
)
Time-series data 1. A numeric vector.
Time-series data 2. A numeric vector.
Time-series data 1. A time vector (POSIXct).
Time-series data 2. A time vector (POSIXct).
Time tolerance to match time-series 1 and time-series data 2. Unit is hour.
Step to calculate lagged correlation.
Minimum matched sample numner for one lagged correlation.
progressbar
all_idx
threads number
spearman or pearson.
A lagged_cor class object.
if (FALSE) {
data("heart_data", package = "laggedcor")
data("step_data", package = "laggedcor")
dim(heart_data)
dim(step_data)
x = step_data$step
time1 = step_data$time
y = heart_data$heart
time2 = heart_data$time
object =
calculate_lagged_correlation(
x = x,
y = y,
time1 = time1,
time2 = time2,
time_tol = 0.1,
step = 1 / 60,
min_matched_sample = 10,
progressbar = TRUE,
threads = 5,
cor_method = "spearman"
)
object
}