get_ccf4 {cmpsR}R Documentation

Function to calculate the cross-correlation between two sequences

Description

This function is used for CMPS algorithm.

Usage

get_ccf4(x, y, min.overlap = round(0.1 * max(length(x), length(y))))

Arguments

x

numeric sequence of values

y

numeric sequence of values

min.overlap

integer, minimal number of values in the overlap between sequences x and y to calculate a correlation value. Set to 10 percent of the maximum length of either sequence (HH: this might be problematic for CMPS)

Value

list consisting of the lag where the maximum correlation is achieved, and the maximum correlation value.

Examples

data("bullets")
land2_3 <- bullets$sigs[bullets$bulletland == "2-3"][[1]]
land1_2 <- bullets$sigs[bullets$bulletland == "1-2"][[1]]
x <- land2_3$sig
y <- land1_2$sig

segments <- get_segs(x, len = 50)

ccr <- get_ccf4(y, segments$segs[[7]], 
                min.overlap = length(segments$segs[[7]]))

[Package cmpsR version 0.1.2 Index]