CROSSCORR - Graphical display of cross-correlations

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

CROSSCORR - Graphical display of cross-correlations

Postby TomDoan » Wed Jun 29, 2011 1:04 pm

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
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 2 guests