Learn R Programming

tiger (version 0.2.3.1)

lagtime: Lagtime between two time series

Description

This function calculates the lagtime between x and y, defined as the shift resulting in the maximum cross correlation.

Usage

lagtime(x, y)

Arguments

x
Time series
y
Time series

Value

The lagtime as scalar. Positive if x is shifted towards later times.

See Also

ccf,diagnostic_dawson

Examples

Run this code
   data(example.peaks,package="tiger")
   plot(reference.peak, type="l")
   lines(example.peaks[7,], lty=2)
   lagtime(reference.peak, example.peaks[7,])

Run the code above in your browser using DataLab