rolling_correlation() is a generic S3 function that preserves
the input class: double vector in, double vector out.
Handling of -values
Leading NAs are always produced for the initial lookback period
where insufficient data is available. If the input itself contains
NAs they are passed through to the underlying C routine, which
can cause the entire output to be filled with NAs. Set
na.ignore = TRUE to strip NAs before calculation and
re-insert them at their original positions in the output.
Arguments
- x, y
((double), (double)). A pair of double vectors of equal length.
- n
(integer). Lookback period (window size). A positive integer of length 1.
- na.ignore
(logical). A logical of length 1. FALSE by default. If TRUE,
NAs in the input are stripped before calculation and re-inserted at their original positions in the output.
See also
Other Rolling Statistic:
rolling_beta(),
rolling_max(),
rolling_min(),
rolling_standard_deviation(),
rolling_sum(),
rolling_variance()
