5.6.2 Cross Correlation (CCF)

Summary

This CCF (Cross Correlation function) tool is supported in the Time Series Analysis App. It is used to compute and plot the cross correlations between two series.

Tutorial

This tutorial uses App’s built-in sample project. To open this sample OPJU file:

  1. Right click the Time Series Analysis App icon Time Series Analysis icon.png in the Apps Gallery and choose Show Samples Folder.
  2. A folder will open. Drag-and-drop the project file TSA Sample.opju into Origin.

CCF

  1. Expand Project Explorer docked on the left. Select folder Statistics and Test . The Book5 contains data about marketing spending and income .
    CCF 01.png
  2. Highlight Column B and C, and then click the Time Series Analysis App icon Time Series Analysis icon.png in the Apps Gallery.
  3. In the dialog, select Statistics and Test and CCF tool.
    CCF 02.png
  4. Set Number of Lags to 10. Then click the OK button.
    CCF 03.png
  5. Then you will get the report with CCF graph.
    CCF 04.png

Algorithm

Cross correlation calculates the correlation between two time series with different lags. It can be used to identify lags of one time series so that it can be the predictor of the other time series.

This app calls nag_tsa_cross_corr (g13bcc) function [1] to calculate.

Given two time series xi, yi, i = 1, 2, ..., n, the cross correlations between xt and yt with lags can be calculated as:

\begin{equation}r_k = \frac{\displaystyle\sum_{t=1}^{n-k} (x_t - \bar{x})(y_{t+k}-\bar{y})}{n s_x s_y}, \;k = 0,\, 1,\, ...,\, n_k \tag{1}\end{equation}

where \bar{x} and \bar{y} are means of time series xi and yi, sx and sy are standard deviations of time series xi and yi,

s_x^2 = \frac{(x_t - \bar{x})^2}{n}

and similarly for sy.

For lag k<0, it can be calculated by exchange time series xi and yi in Equation (1).

  • Default Number of Lags
n_k = \begin{cases}n - 1 \;&\text{if } n \leq 14\\10 + \sqrt{n} \;&\text{otherwise}\end{cases}
  • Standard Error of Cross Correlation
s_k = \frac{1}{\sqrt{n - |k|}}
  • Confidence Limits

Lower confidence limit at lag k:

LCL_k = -2 s_k

Upper confidence limit at lag k:

UCL_k = 2 s_k

Reference

1. nag_tsa_cross_corr (g13bcc)