*
* @CrossCorr( options ) series1 series2 start end
*
* 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.
*
* 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
* SPIKE/[NOSPIKE]
* GRAPH controls whether graphs are produced. SPIKE controls whether the
* graph (if done) is bar graph or "spikes".
*
* NUMBER=number of autocorrelations to compute [depends upon data]
* WINDOW=title for graph window
* REPORT/[NOREPORT]
* PRINT/[NOPRINT]
*
* Revision schedule:
* 03/2003 Written by Tom Doan, Estima
* 06/2005 REPORT option added
* 06/2011 Add SPIKE option
* 05/2014 Add default for WINDOW option
*
proc CrossCorr series1 series2 start end
type series series1 series2
type integer start end
*
option switch graph 1
option switch print 0
option switch report 0
option switch spike 0
option integer number
option string window
*
local integer nbeg nend nobs
local series corr1 corr2 ccorr ccorr1 ccorr2
local series upper lower
local integer numc
local string header qstring
local integer styleopt
local string lwindow
if .not.%defined(series1).or..not.%defined(series2) {
display "Syntax: @CrossCorr series1 series2 start end"
return
}
*
* Get the series range to be overridden by the start and end parameters if the
* user specifies them.
*
inquire(reglist) nbeg<