Description Usage Arguments Details Value Examples
Computes running correlation between two sequences in a fixed width window, whose length corresponds to the length of the shorter sequence. Uses convolution via Fast Fourier Transform.
1 | RunningCor(x, y, circular = FALSE)
|
x |
A numeric vector. |
y |
A numeric vector, of equal or shorter length than |
circular |
logical; whether running correlation is computed assuming
circular nature of |
Computes running correlation between two sequences in a fixed width window.
The length of a window is equal to the shorter of the two sequences (y
), and window
"runs" over the length of longer sequence (x
).
The length of output vector equals the length of x
vector.
Parameter circular
determines whether x
sequence is assumed to have a circular nature. Assume l_x is the length of sequence x
, l_y is the length of shorter sequence y
.
If circular
equals TRUE
then
first element of the output sequence corresponds to sample correlation between x[1:l_y]
and y
,
last element of the output sequence corresponds to sample correlation between c(x[l_x], x[1:(l_y - 1)])
and y
.
If circular
equals FALSE
then
first element of the output sequence corresponds to sample correlation between x[1:l_y]
and y
,
the l_x - W + 1-th element of the output sequence corresponds to sample correlation between x[(l_x - l_y + 1):l_x]
,
last W-1
elements of the output sequence are filled with NA
.
A numeric vector.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.