Page 1 of 1

CROSSCORR - Graphical display of cross-correlations

PostPosted: Wed Jun 29, 2011 1:04 pm
by TomDoan
This procedure computes and graphs cross correlations between two series. The graph is shown as a 2x2 matrix with autocorrelations for the series in the diagonal slots and the cross correlations in the off-diagonal with the leads in one corner and lags in the other.

crosscorr.src
Procedure file
(4.03 KiB) Downloaded 80 times


@CrossCorr( options ) series1 series2 start end

Parameters:
series1 series2 Pair of series to analyze
start end Range over which to compute correlations. By default, the common range of the two input series.

Options:
[GRAPH]/NOGRAPH Do High-resolution graphs?
SPIKE/[NOSPIKE]

NUMBER=number of autocorrelations to compute [depends upon data]
WINDOW=title for graph window
REPORT/[NOREPORT]
PRINT/[NOPRINT]

Example:

From Diebold's Elements of Forecasting. This uses BJIDENT to show the univariate autocorrelations and CROSSCORR to show the cross correlations.

Code: Select all
*
* Diebold, Elements of Forecasting, 3rd edition
* VAR example from pages 265-281, chapter 10, section 9.
*
open data house.dat
cal(m) 1968:1
data(format=prn,org=columns) 1968:1 1996:6
*
@bjident(number=24,report,qstats) starts 1968:1 1991:12
@bjident(number=24,report,qstats) completions 1968:1 1991:12
*
@crosscorr(number=24) starts completions 1968:1 1991:12