Class MultiCrossCorrelation
- All Implemented Interfaces:
Serializable,Cloneable
MultiCrossCorrelation estimates the multichannel cross-correlation
function of two mutually stationary multichannel time series. Define
the multichannel time series X by
$$X = (X_1, X_2, \dots, X_p)$$ where
$$X_j = {(X_{1j}, X_{2j}, \dots, X_{nj})}^T,
\;\;\;\;\; j = 1,2, \dots, p$$ with n = x.length
and p = x[0].length. Similarly, define the multichannel time
series Y by
$$Y = (Y_1, Y_2, \dots, Y_q)$$ where
$$Y_j = {(Y_{1j}, Y_{2j}, \dots, Y_{mj})}^T,
\;\;\;\;\; j = 1,2, \dots, q$$ with
m = y.length and q = y[0].length.
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 \(\hat \mu _X\) = xmean be the row
vector containing the means of the channels of X. In particular,
$$\hat \mu _X = (\hat\mu _{X_1}, \hat \mu
_{X_2}, \dots, \hat \mu _{X_p})$$ where for
j = 1, 2, ..., p
$$\hat \mu _{X_j} = \left\{
\begin{array}{ll}
\mu _{X_j} & {\rm for}\;\mu _{X_j}\; {\rm known} \\
\frac{1}{n}\sum\limits_{t=1}^n {X_{tj}} & {\rm for}\;\mu _{X_j}\;
{\rm unknown}
\end{array}
\right.$$
Let \(\hat \mu _Y\) = ymean be similarly
defined. The cross-covariance of lag k between channel i
of X and channel j of Y is estimated by
$$\hat \sigma _{X_iY_j}(k) = \left\{
\begin{array}{ll}
\frac{1}{N}\sum\limits_{t}(X_{ti} - {\hat \mu _{X_i}})(Y_{t+k,j} - {\hat\mu _{Y_j}}) &{k = 0,1, \dots,K} \\
\frac{1}{N}\sum\limits_{t}(X_{ti} - {\hat \mu _{X_i}})(Y_{t+k,j} - {\hat\mu _{Y_j}}) &{k = -1,-2, \dots,-K}
\end {array} \right.$$
where i = 1, ..., p, j = 1, ..., q, and K
= maximum_lag. The summation on t extends over all
possible cross-products with N equal to the number of
cross-products in the sum.
Let \(\hat \sigma _X(0)\) = xvar,
where xvar is the variance of X, be the row
vector consisting of estimated variances of the channels of X.
In particular, $$\hat \sigma _X(0) =
(\hat \sigma _{X_1}(0), \hat \sigma _{X_2}(0), \dots, \hat \sigma _{X_p}(0))
$$
where $$\hat \sigma _{X_j}(0) = \frac{1}{n}
\sum\limits_{t = 1}^{n} {\left( {X_{tj} - \hat \mu _{X_j}} \right)}^2
{, \mbox{\hspace{20pt}j=0,1,\dots,p}}$$
Let \(\hat \sigma _Y(0)\) = yvar,
where yvar is the variance of Y, be similarly
defined. The cross-correlation of lag k between channel i
of X and channel j of Y is estimated by
$$\hat \rho _{X_jY_j}(k) = \frac{\hat \sigma
_{{X_j}{Y_j}(k)}}{ {[ \hat\sigma _{X_i}(0)\hat\sigma _{X_j}(0)]}^{\frac{1}{2}}}
\;\;\;\;\;k =0,\pm1,\dots, \pm K$$
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe problem is ill-conditioned. -
Constructor Summary
ConstructorsConstructorDescriptionMultiCrossCorrelation(double[][] x, double[][] y, int maximum_lag) Constructor to compute the multichannel cross-correlation function of two mutually stationary multichannel time series. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][][]Returns the cross-correlations between the channels ofxandy.double[][][]Returns the cross-covariances between the channels ofxandy.double[]getMeanX()Returns the mean of each channel ofx.double[]getMeanY()Returns the mean of each channel ofy.double[]Returns the variances of the channels ofx.double[]Returns the variances of the channels ofy.voidsetMeanX(double[] mean) Estimate of the mean of each channel ofx.voidsetMeanY(double[] mean) Estimate of the mean of each channel ofy.
-
Constructor Details
-
MultiCrossCorrelation
public MultiCrossCorrelation(double[][] x, double[][] y, int maximum_lag) Constructor to compute the multichannel cross-correlation function of two mutually stationary multichannel time series.- Parameters:
x- A two-dimensionaldoublearray containing the first multichannel stationary time series. Each row ofxcorresponds to an observation of a multivariate time series and each column ofxcorresponds to a univariate time series.y- A two-dimensionaldoublearray containing the second multichannel stationary time series. Each row ofycorresponds to an observation of a multivariate time series and each column ofycorresponds to a univariate time series.maximum_lag- Anintcontaining the maximum lag of the cross-covariance and cross-correlations to be computed.maximum_lagmust be greater than or equal to 1 and less than the minimum number of observations ofxandy.
-
-
Method Details
-
setMeanX
public void setMeanX(double[] mean) Estimate of the mean of each channel ofx.- Parameters:
mean- A one-dimensionaldoublecontaining the estimate of the mean of each channel in time seriesx.
-
getMeanX
public double[] getMeanX()Returns the mean of each channel ofx.- Returns:
- A one-dimensional
doublecontaining the mean of each channel in the time seriesx.
-
setMeanY
public void setMeanY(double[] mean) Estimate of the mean of each channel ofy.- Parameters:
mean- A one-dimensionaldoublecontaining the estimate of the mean of each channel in the time seriesy.
-
getMeanY
public double[] getMeanY()Returns the mean of each channel ofy.- Returns:
- A one-dimensional
doublecontaining the estimate mean of each channel in the time seriesy.
-
getVarianceX
Returns the variances of the channels ofx.- Returns:
- A one-dimensional
doublecontaining the variances of each channel in the time seriesx. - Throws:
MultiCrossCorrelation.NonPosVariancesException
-
getVarianceY
Returns the variances of the channels ofy.- Returns:
- A one-dimensional
doublecontaining the variances of each channel in the time seriesy. - Throws:
MultiCrossCorrelation.NonPosVariancesException
-
getCrossCorrelation
Returns the cross-correlations between the channels ofxandy.- Returns:
- A
doublearray of size 2 *maximum_lag+1 byx[0].lengthbyy[0].lengthcontaining the cross-correlations between the time seriesxandy. The cross-correlation between channel i of thexseries and channel j of theyseries at lag k, where k = -maximum_lag, ..., 0, 1, ...,maximum_lag, corresponds to output array element with index [k][i][j] where k= 0,1,...,(2*maximum_lag), i = 1, ...,x[0].length, and j = 1, ...,y[0].length. - Throws:
MultiCrossCorrelation.NonPosVariancesException
-
getCrossCovariance
Returns the cross-covariances between the channels ofxandy.- Returns:
- A
doublearray of size 2 *maximum_lag+1 byx[0].lengthbyy[0].lengthcontaining the cross-covariances between the time seriesxandy. The cross-covariances between channel i of thexseries and channel j of theyseries at lag k where k = -maximum_lag, ..., 0, 1, ...,maximum_lag, corresponds to output array element with index [k][i][j] where k= 0,1,...,(2*maximum_lag), i = 1, ...,x[0].length, and j = 1, ...,y[0].length. - Throws:
MultiCrossCorrelation.NonPosVariancesException
-