sequence_thresh: Threshold segment correlations

View source: R/sequence_thresh.R

sequence_threshR Documentation

Threshold segment correlations

Description

Thresholds correlation between all segments length n of a vector

Usage

sequence_thresh(sequ, threshold = 1, tolerance = sqrt(.Machine$double.eps))

Arguments

sequ

Output of sequence_cor()

threshold

Minimum correlation to accept. Defaults to 1, possible range -1 to 1 (but values much below 1 make no sense)

tolerance

Small positive number to allow for numerical imprecision

Details

Tests if correlations are >= than a given threshold (with tolerance for imprecision in correlations). Default threshold is 1 (perfect correlation). Might be useful to reduce this slightly, or equivalently increase tolerance to allow for cases where imprecision is high.

Examples

set.seed(42) 
x <- rnorm(10)
x <- c(x, x[1:4] + 2.03)
sequ <- sequence_cor(vec = x, n = 4)
sequence_thresh(sequ)    

Sorbus-torminalis/twopointzerothree documentation built on Aug. 18, 2022, 2:30 a.m.