MCCF
Computes the multichannel cross‑correlation function of two mutually stationary multichannel time series.
Required Arguments
XNOBSX by NCHANX matrix containing the first time series. (Input)
Each row of X corresponds to an observation of a multivariate time series and each column of X corresponds to a univariate time series.
YNOBSY by NCHANY matrix containing the second time series. (Input)
Each row of Y corresponds to an observation of a multivariate time series and each column of Y corresponds to a univariate time series.
MAXLAG — Maximum lag of cross‑covariances and cross‑correlations to be computed. (Input)
MAXLAG must be greater than or equal to one and less than the minimum of NOBSX and NOBSY.
CC — Array of size NCHANX by NCHANY by 2 * MAXLAG + 1 containing the cross‑correlations between the channels of X and Y. (Output)
The cross‑correlation between channel i of the X series and channel j of the Y series at lag k corresponds to CC(i, j, k) where i = 1, …, NCHANX, j = 1, …, NCHANY, and k = ‑MAXLAG, …, 1, 0, 1, …, MAXLAG.
Optional Arguments
NOBSX — Number of observations in each channel of the first time series X. (Input)
NOBSX must be greater than or equal to two.
Default: NOBSX = size (X,1).
NCHANX — Number of channels in the first time series X. (Input)
NCHANX must be greater than or equal to one.
Default: NCHANX = size (X,2).
LDX — Leading dimension of X exactly as specified in the dimension statement of the calling program. (Input)
LDX must be greater than or equal to NOBSX.
Default: LDX = size (X,1).
NOBSY — Number of observations in each channel of the second time series Y. (Input)
NOBSY must be greater than or equal to two.
Default: NOBSY = size (Y,1).
NCHANY — Number of channels in the second time series Y. (Input)
NCHANY must be greater than or equal to one.
Default: NCHANY = size (Y,2).
LDY — Leading dimension of Y exactly as specified in the dimension statement of the calling program. (Input)
LDY must be greater than or equal to NOBSY.
Default: LDY = size (Y,1).
IPRINT — Printing option. (Input)
Default: IPRINT = 0.
IPRINT
Action
0
No printing is performed.
1
Prints the means and variances.
2
Prints the means, variances, and cross‑covariances.
3
Prints the means, variances, cross‑covariances, and cross‑correlations.
IMEAN — Option for computing the means. (Input)
Default: IMEAN = 1.
IMEAN
Action
0
XMEAN and YMEAN are user‑specified.
1
XMEAN and YMEAN are set to the arithmetic means of their respective channels.
XMEAN — Vector of length NCHANX containing the means of the channels of X. (Input, if IMEAN = 0; output, if IMEAN = 1)
YMEAN — Vector of length NCHANY containing the means of the channels of Y. (Input, if IMEAN = 0; output, if IMEAN = 1)
XVAR — Vector of length NCHANX containing the variances of the channels of X. (Output)
YVAR — Vector of length NCHANY containing the variances of the channels of Y. (Output)
CCV — Array of size NCHANX by NCHANY by 2 * MAXLAG + 1 containing the cross‑covariances between the channels of X and Y. (Output)
The cross‑covariance between channel i of the X series and channel j of the Y series at lag k corresponds to CCV(i, j, k) where i = 1, …, NCHANX, j = 1, …, NCHANY, and k = ‑MAXLAG, …, 1, 0, 1, …, MAXLAG.
LDCCV — Leading dimension of CCV exactly as specified in the dimension statement in the calling program. (Input)
LDCCV must be greater than or equal to NCHANX.
Default: LDCCV = size (CCV,1).
MDCCV — Middle dimension of CCV exactly as specified in the dimension statement in the calling program. (Input)
MDCCV must be greater than or equal to NCHANY.
Default: MDCCV = size (CCV,2).
LDCC — Leading dimension of CC exactly as specified in the dimension statement in the calling program. (Input)
LDCC must be greater than or equal to NCHANX.
Default: LDCCV = size (CC,1).
MDCC — Middle dimension of CC exactly as specified in the dimension statement in the calling program. (Input)
MDCC must be greater than or equal to NCHANY.
Default: MDCCV = size (CC,2).
FORTRAN 90 Interface
Generic: CALL MCCF (X, Y, MAXLAG, CC [])
Specific: The specific interface names are S_MCCF and D_MCCF.
FORTRAN 77 Interface
Single: CALL MCCF (NOBSX, NCHANX, X, LDX, NOBSY, NCHANY, Y, LDY, MAXLAG, IPRINT, IMEAN, XMEAN, YMEAN, XVAR, YVAR, CCV, LDCCV, MDCCV, CC, LDCC, MDCC)
Double: The double precision name is DMCCF.
Description
Routine MCCF estimates the multichannel cross‑correlation function of two mutually stationary multichannel time series. Define the multichannel time series X by
X = (X1, X2, , Xp)
where
Xj = (X1j, X2j, , Xnj)T,            j = 1, 2, , p
with n = NOBSX and p = NCHANX. Similarly, define the multichannel time series Y by
Y = (Y1, Y2, , Yq)
where
Yj = (Y1j, Y2j, , Ymj)T,                j = 1, 2, , q
with m = NOBSY and q = NCHANY. The columns of X and Y correspond to individual channels of multichannel time series and may be examined from a univariate perspective. The rows of X and Y correspond to observations of p‑variate and q‑variate time series, respectively, and may be examined from a multivariate perspective. Note that an alternative characterization of a multivariate time series X considers the columns to be observations of the multivariate time series while the rows contain univariate time series. For example, see Priestley (1981, page 692) and Fuller (1976, page 14).
Let
be the row vector containing the means of the channels of X. In particular,
 
where for j = 1, 2, …, p
Let
be similarly defined. The cross‑covariance of lag k between channel i of X and channel j of Y is estimated by
 
where i = 1, …, p, j = 1, …, q, and K = MAXLAG. The summation on t extends over all possible cross‑products with N equal to the number of cross‑products in the sum.
Let
be the row vector consisting of the estimated variances of the channels of X. In particular,
where
Let
be similarly defined. The cross‑correlation of lag k between channel i of X and channel j of Y is estimated by
Comments
1. For a given lag k, the multichannel cross‑covariance coefficient is defined as the array of dimension NCHANX by NCHANY whose components are the single‑channel cross‑covariance coefficients CCV(ij, k). A similar definition holds for the multichannel cross‑correlation coefficient.
2. Multichannel autocovariances and autocorrelations may be obtained by setting the first and second time series equal.
Example
Consider the Wolfer Sunspot Data (Y ) (Box and Jenkins 1976, page 530) along with data on northern light activity (X1) and earthquake activity (X2) (Robinson 1967, page 204) to be a three‑channel time series. Routine MCCF is used to computed the cross‑covariances and cross‑correlations between X1 and Y and between X2 and Y with lags from ‑MAXLAG = 10 through lag MAXLAG = 10:
 
USE GDATA_INT
USE MCCF_INT
 
IMPLICIT NONE
INTEGER IPRINT, LDCC, LDCCV, LDX, LDY, MAXLAG, MDCC, MDCCV, &
NCHANX, NCHANY, NOBSX, NOBSY
PARAMETER (IPRINT=3, MAXLAG=10, NCHANX=2, NCHANY=1, NOBSX=100, &
NOBSY=100, LDCC=NCHANX, LDCCV=NCHANX, LDX=NOBSX, &
LDY=NOBSY, MDCC=NCHANY, MDCCV=NCHANY)
!
INTEGER IMEAN, NCOL, NROW
REAL CC(LDCC,MDCC,-MAXLAG:MAXLAG), CCV(LDCCV,MDCCV,- &
MAXLAG:MAXLAG), RDATA(100,4), X(LDX,NCHANX), &
XMEAN(NCHANX), XVAR(NCHANX), Y(LDY,NCHANY), &
YMEAN(NCHANY), YVAR(NCHANY)
!
EQUIVALENCE (X(1,1), RDATA(1,3)), (X(1,2), RDATA(1,4))
EQUIVALENCE (Y(1,1), RDATA(1,2))
!
CALL GDATA (8, RDATA, NROW, NCOL)
! USE Default Option to estimate
! channel means
! Compute multichannel CCVF and CCF
CALL MCCF (X, Y, MAXLAG, CC, IPRINT=IPRINT)
!
END
Output
Channel means of X from MCCF
1 2
63.43 97.97
 
Channel variances of X
1 2
2643.7 1978.4
 
Channel means of Y from MCCF
46.94
 
Channel variances of Y
1383.8
 
Multichannel cross-covariance between X and Y from MCCF
 
Lag K = -10
1 -20.51
2 70.71
 
Lag K = -9
1 65.02
2 38.14
 
Lag K = -8
1 216.6
2 135.6
 
Lag K = -7
1 246.8
2 100.4
 
Lag K = -6
1 142.1
2 45.0
 
Lag K = -5
1 50.70
2 -11.81
 
Lag K = -4
1 72.68
2 32.69
 
Lag K = -3
1 217.9
2 -40.1
 
Lag K = -2
1 355.8
2 -152.6
 
Lag K = -1
1 579.7
2 -213.0
 
Lag K = 0
1 821.6
2 -104.8
 
Lag K = 1
1 810.1
2 55.2
 
Lag K = 2
1 628.4
2 84.8
 
Lag K = 3
1 438.3
2 76.0
 
Lag K = 4
1 238.8
2 200.4
 
Lag K = 5
1 143.6
2 283.0
 
Lag K = 6
1 253.0
2 234.4
 
Lag K = 7
1 479.5
2 223.0
 
Lag K = 8
1 724.9
2 124.5
 
Lag K = 9
1 925.0
2 -79.5
 
Lag K = 10
1 922.8
2 -279.3
 
Multichannel cross-correlation between X and Y from MCCF
 
Lag K = -10
1 -0.01072
2 0.04274
 
Lag K = -9
1 0.03400
2 0.02305
 
Lag K = -8
1 0.1133
2 0.0819
 
Lag K = -7
1 0.1290
2 0.0607
 
Lag K = -6
1 0.07431
2 0.02718
 
Lag K = -5
1 0.02651
2 -0.00714
 
Lag K = -4
1 0.03800
2 0.01976
 
Lag K = -3
1 0.1139
2 -0.0242
 
Lag K = -2
1 0.1860
2 -0.0923
 
Lag K = -1
1 0.3031
2 -0.1287
 
Lag K = 0
1 0.4296
2 -0.0633
 
Lag K = 1
1 0.4236
2 0.0333
 
Lag K = 2
1 0.3285
2 0.0512
 
Lag K = 3
1 0.2291
2 0.0459
 
Lag K = 4
1 0.1248
2 0.1211
 
Lag K = 5
1 0.0751
2 0.1710
 
Lag K = 6
1 0.1323
2 0.1417
 
Lag K = 7
1 0.2507
2 0.1348
 
Lag K = 8
1 0.3790
2 0.0752
 
Lag K = 9
1 0.4836
2 -0.0481
 
Lag K = 10
1 0.4825
2 -0.1688
Published date: 03/19/2020
Last modified date: 03/19/2020