iccf: Estimate an interpolated cross correlation between two time...

Description Usage Arguments Value Notes See Also Examples

Description

iccf returns the Interpolated Cross-Correlation Function estimates.

Usage

1
2
iccf(ts.1, ts.2, tau = NULL, local.est = FALSE, one.way = FALSE,
  zero.clip = NULL, cov = FALSE, chatter = 0)

Arguments

ts.1

(array or dataframe) data for time series 1 and 2.

ts.2

(array or dataframe) data for time series 1 and 2.

tau

(vector) list of lags at which to compute the CCF.

local.est

(logical) use 'local' (not 'global') means and variances?

one.way

(logical) (ICCF only) if TRUE then only interpolar time series 2.

zero.clip

(logical) remove pairs of points with exactly zero lag?

cov

(logical) if TRUE then compute covariance, not correlation coefficient.

chatter

(integer) set the level of feedback.

Value

A data frame containing columns:

tau

(array) lags (in time units)

ccf

(array) correlations coefficent in each lag bin

n

(array) A one dimensional array containing the number of pairs of points used at each lag.

Notes

In what follows we refer to the t, y values of time series 1 (ts.1) as t.1, y.1, and similarly for time series 2.

Given two time series y.1 and y.2, sampled at times t.1 and t.2, we estimate a cross correlation function (CCF) by interpolating (t.2, y.2). For a lag tau we estimate y.2 at each time t.1+tau by interpolating between the two nearest points of y.2. We then pair the values y.1 with the corresponding lagged values of y.2 and compute the linear correlation coefficient, ccf. The interpolation is handled by the approx function for linear interpolation.

See Also

cross_correlate, dcf, approx

Examples

1
2
3
4
## Example using NGC 5548 data
res <- iccf(cont, hbeta, tau = seq(-100, 100))
plot(res$tau, res$ccf, type = "l", col = "blue", lwd = 3, bty = "n")
grid()

svdataman/sour documentation built on May 30, 2019, 8:47 p.m.