Rolling cross-correlation at given lags. Can be useful to show how the relationship between two time series changes over time, including out-by-one timing errors.
rollccf(
DATA = data.frame(Q = , P = ),
width = list(365, 90),
by = 28,
lags = base.lag + c(0, 1, -1),
base.lag = estimateDelay(DATA, rises = rises, plot = FALSE),
rises = FALSE,
na.action = na.contiguous,
na.max.fraction = 1/3
)
# S3 method for rollccf
xyplot(
x,
data = NULL,
...,
with.data = TRUE,
type = list(c("h", "b")),
type.data = "l",
par.settings = simpleTheme(pch = ".", cex = 2),
layout = c(1, length(x$rolls) + with.data * 2),
strip = strip.default,
ylim = c(0, 1),
xlab = NULL,
as.table = TRUE
)
ccfForLags(DATA, lags = 0, na.action = na.contiguous, na.max.fraction = 1/3)
a named list, data frame, time series or zoo object containing the two data series.
a list or number specifying the width of window(s), in time steps, in which to calculate cross correlations.
temporal resolution: cross correlation is calculated in windows
spaced every by
time steps.
lags
for which to calculate the cross
correlation. By default these are based on the overall maximum cross
correlation, base.lag
.
if TRUE
, compute the cross correlation with rises
in streamflow. In this case the streamflow series must be named "Q"
.
function to handle missing data in each window (not the
whole series). This is only applied when the number of missing values is
less than na.max.fraction
.
Could be na.exclude
.
if the proportion of missing values in the moving
window exceeds this value, the corresponding result will be NA
.
x
is an object produced by the rollccf
function.
data
is ignored.
if TRUE
, include the original data series in the
plot.
drawing styles for the cross correlation series and
input data series. See panel.xyplot
.
passed to
xyplot
.
rollccf
returns a list of class "rollccf"
, with
components:
a list of time series of cross correlations. One
element for each value of width
.
time series input data.
values of arguments used.