astsa (version 1.10)

ccf2: Cross Correlation

Description

Produces a nice graphic of the sample CCF of two time series. The actual CCF values are returned invisibly.

Usage

ccf2(x, y, max.lag = NULL, main=NULL, ylab="CCF", na.action = na.pass, ... )

Arguments

x, y

univariate time series.

max.lag

maximum lag for which to calculate the CCF.

main

plot title - if NULL, uses x and y names.

ylab

vertical axis label; default is 'CCF'.

na.action

how to handle missing values; default is na.pass

...

additional arguments passed to acf

Details

This will produce a graphic of the sample corr[x(t+lag), y(t)] from -max.lag to max.lag. Also, the (rounded to 3 digits) values of the CCF are returned invisibly.

References

http://www.stat.pitt.edu/stoffer/tsa4/ and http://www.stat.pitt.edu/stoffer/tsda/

Examples

Run this code
# NOT RUN {
( ccf2(soi, rec) )   # now you see it
ccf2(soi, rec)       # now you don't
# }

Run the code above in your browser using DataCamp Workspace