From: Mateusz Sikora on
Hi all,
I crosscorr use the crosscorr(x, y) function and it creates me a very nice chart for the first 20 values. It creates the two sides, the values on the axis OX> 0 and value <0.

How to interpret this chart?

Is the value of> 0 on the X axis is the x values are delayed terms y, and for <0 is the other way around?

please help and answer
greet
Matthew
From: sscnekro on
> How to interpret this chart?
> Is the value of> 0 on the X axis is the x values are delayed terms y, and for <0 is the other way around?
> please help and answer

Hi there, I don't know much on this, but cross-correlation is something I should learn too. Looking on this: http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/correlate/
I fancy that crosscorr() considers the first specified series as "x" and the second as "y", with the "y" being lagged backwards and forwards wrt "x"... Eventually, verify this by direct computation...
From: Wayne King on
"Mateusz Sikora" <matteusz86(a)poczta.onet.pl> wrote in message <i36hsc$jp8$1(a)fred.mathworks.com>...
> Hi all,
> I crosscorr use the crosscorr(x, y) function and it creates me a very nice chart for the first 20 values. It creates the two sides, the values on the axis OX> 0 and value <0.
>
> How to interpret this chart?
>
> Is the value of> 0 on the X axis is the x values are delayed terms y, and for <0 is the other way around?
>
> please help and answer
> greet
> Matthew

Hi Matthew, in crosscorr() in the Econometrics Toolbox, you can actually think of either one being lagged with respect to the other because crosscorr() is designed for real-valued time series. In general, the cross correlation sequence is conjugate symmetric in the lag variable meaning that

Cxy(k)=(Cyx(-k))*

where the asterisk is the complex conjugate. If you compute the cross correlation sequence using xcorr() in the Signal Processing Toolbox, you can see this:

A = [1+1j 2-1j 3+1j];
B = [1 2 3];
[C,lags] = xcorr(A,B,'biased');
% compare to
[C1,lags] = xcorr(B,A,'biased');
% compare C and C1

But note that there is no difference using crosscorr

[xcf,lags,~] = crosscorr(A,B);

[xcf1,lags,~] = crosscorr(B,A);
% compare xcf and xcf1

I think it's safe to say this is because there is no use case in econometrics for complex-valued data (At least none in mind for crosscorr). So therefore, this implementation of the cross correlation sequence is symmetric in the lag variable (an even function of the lag variable).

You can think of the positive lags as the y-series delayed with respect to the x series, and the negative lags as the y-series advanced with respect to the x-series. However, note that for real-valued series, the latter statement is equivalent to the x-series being delayed with respect to the y-series.

Hope that helps,
Wayne
From: Mateusz Sikora on
> Hi Matthew, in crosscorr() in the Econometrics Toolbox, you can actually think of either one being lagged with respect to the other because crosscorr() is designed for real-valued time series. In general, the cross correlation sequence is conjugate symmetric in the lag variable meaning that
>
> Cxy(k)=(Cyx(-k))*
>
> where the asterisk is the complex conjugate. If you compute the cross correlation sequence using xcorr() in the Signal Processing Toolbox, you can see this:
>
> A = [1+1j 2-1j 3+1j];
> B = [1 2 3];
> [C,lags] = xcorr(A,B,'biased');
> % compare to
> [C1,lags] = xcorr(B,A,'biased');
> % compare C and C1
>
> But note that there is no difference using crosscorr
>
> [xcf,lags,~] = crosscorr(A,B);
>
> [xcf1,lags,~] = crosscorr(B,A);
> % compare xcf and xcf1
>
> I think it's safe to say this is because there is no use case in econometrics for complex-valued data (At least none in mind for crosscorr). So therefore, this implementation of the cross correlation sequence is symmetric in the lag variable (an even function of the lag variable).
>
> You can think of the positive lags as the y-series delayed with respect to the x series, and the negative lags as the y-series advanced with respect to the x-series. However, note that for real-valued series, the latter statement is equivalent to the x-series being delayed with respect to the y-series.
>
> Hope that helps,
> Wayne


I need to calculate cross-correlations for a series of temporary currency pairs. Two series of logarithmic returns of different currency pairs have produced a chart that changes when I turn it placecs in crosscorr() function. So there must be some delay,
From: Wayne King on
"Mateusz Sikora" <matteusz86(a)poczta.onet.pl> wrote in message <i376a6$5b$1(a)fred.mathworks.com>...
> > Hi Matthew, in crosscorr() in the Econometrics Toolbox, you can actually think of either one being lagged with respect to the other because crosscorr() is designed for real-valued time series. In general, the cross correlation sequence is conjugate symmetric in the lag variable meaning that
> >
> > Cxy(k)=(Cyx(-k))*
> >
> > where the asterisk is the complex conjugate. If you compute the cross correlation sequence using xcorr() in the Signal Processing Toolbox, you can see this:
> >
> > A = [1+1j 2-1j 3+1j];
> > B = [1 2 3];
> > [C,lags] = xcorr(A,B,'biased');
> > % compare to
> > [C1,lags] = xcorr(B,A,'biased');
> > % compare C and C1
> >
> > But note that there is no difference using crosscorr
> >
> > [xcf,lags,~] = crosscorr(A,B);
> >
> > [xcf1,lags,~] = crosscorr(B,A);
> > % compare xcf and xcf1
> >
> > I think it's safe to say this is because there is no use case in econometrics for complex-valued data (At least none in mind for crosscorr). So therefore, this implementation of the cross correlation sequence is symmetric in the lag variable (an even function of the lag variable).
> >
> > You can think of the positive lags as the y-series delayed with respect to the x series, and the negative lags as the y-series advanced with respect to the x-series. However, note that for real-valued series, the latter statement is equivalent to the x-series being delayed with respect to the y-series.
> >
> > Hope that helps,
> > Wayne
>
>
> I need to calculate cross-correlations for a series of temporary currency pairs. Two series of logarithmic returns of different currency pairs have produced a chart that changes when I turn it placecs in crosscorr() function. So there must be some delay,

Hi, I'm not sure that I understand your post. Assuming that your time series are sufficiently long, crosscorr() by default outputs the cross correlation sequence estimate for 41 lags [-20,20], so that you are getting the cross correlation between the series y2 advanced and delayed with respect to the series y1.

Wayne
 |  Next  |  Last
Pages: 1 2
Prev: filter fft data
Next: removing noise from signal