From: elsa on
Hi,

I am elsa and i have problem with my master thesis and i need your support!
I am working with time series analysis. I wanted to calculate the cross-correlation of time series and i used the crosscorr but i don't know how to calculate the p-values for each delay.Somebody told me to calculate p-values with corrcoeff but this gives me only the p-values for delay τ=0.

Please help me.......
From: EE Student on
"elsa " <elsa_siggiridou(a)hotmail.com> wrote in message <htc0g7$krm$1(a)fred.mathworks.com>...
> Hi,
>
> I am elsa and i have problem with my master thesis and i need your support!
> I am working with time series analysis. I wanted to calculate the cross-correlation of time series and i used the crosscorr but i don't know how to calculate the p-values for each delay.Somebody told me to calculate p-values with corrcoeff but this gives me only the p-values for delay &#964;=0.
>
> Please help me.......

So what have you tried and where are you stuck? Crosscorrelation seems rather elementry for a masters thesis, and if you are writing your thesis on a subject you ought have exhausted most of your resources and be an expert by now. If your are trying to calculate a normaized crosscorrelation such that the values returned are the correlation coefficients, you could implement a NCC that follows the J.P. Lewis approach presented in his paper found at

http://www.idiom.com/~zilla/Work/nvisionInterface/nip.html

Now in his paper he presents the formula in 2D since it is used for template matching, but it will also work in the 1D case assuming you program it correctly. You may also want to look up what the statistical cross-covaiance is as you may find it useful in your analysis.


From: Rogelio on
Hi elsa,
I think what you need is to check wether the crosscorrelation is significant or not at the corresponding lag. You can simply plot the crosscorrelation and you will see some blue lines indicating a 95% confidence inteval, it the red line is above or below the lines it means that it is statistical significant different from zero, and hence there is a correlation. This is based on the asymptotic distribution of the crosscorrelation, namely N(0,1/sqrt(N)) where either one of the process is white noise. Then if you really want pvales, you already now the null distribution so get p vales as 1-normcdf(.).
Hope this help

"EE Student " <np7(a)cec.wustl.edu> wrote in message <htc36i$e9e$1(a)fred.mathworks.com>...
> "elsa " <elsa_siggiridou(a)hotmail.com> wrote in message <htc0g7$krm$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I am elsa and i have problem with my master thesis and i need your support!
> > I am working with time series analysis. I wanted to calculate the cross-correlation of time series and i used the crosscorr but i don't know how to calculate the p-values for each delay.Somebody told me to calculate p-values with corrcoeff but this gives me only the p-values for delay &#964;=0.
> >
> > Please help me.......
>
> So what have you tried and where are you stuck? Crosscorrelation seems rather elementry for a masters thesis, and if you are writing your thesis on a subject you ought have exhausted most of your resources and be an expert by now. If your are trying to calculate a normaized crosscorrelation such that the values returned are the correlation coefficients, you could implement a NCC that follows the J.P. Lewis approach presented in his paper found at
>
> http://www.idiom.com/~zilla/Work/nvisionInterface/nip.html
>
> Now in his paper he presents the formula in 2D since it is used for template matching, but it will also work in the 1D case assuming you program it correctly. You may also want to look up what the statistical cross-covaiance is as you may find it useful in your analysis.
>
>
From: elsa on
thank you rogelio for your answer!
I want to do exactly this. I know that the cross correlation follows t-student distribution with n-2 degrees of freedom. I want to do a test- hypothesis if the cross correlation is 0 for each delay so my time series are uncorrelated. For &#964;=0 there is
[P B]=corrcoeff(A1,A2) where A1 and A2 is vector time serries,B is a matrix with correlation coefficients, and P is the p-value.And i try to calculate the p-values for the other delays with the crosscorr() but this doesn't calculate the p-values an i try to construct a function for this!
From: Rogelio on
ok, which book do you have? where did you read that the crosscorrelation follows a t student distribution?
you dont want to use corrcoeff function, that will compute the sample correlation between two variables. What you want is to compute the crosscorrelation between two variables taking into account the pass of time. Use crosscorr function, and just specify the first 3 inputs. Then let the value of the crosscorrelation be x_h, where h is the lag time, the pvalues that you want are obtained as 1 - tstudentcdf (x_h,n-2). But you need to be aware of what you are doing and how to interprete pvalues. As I mentioned before, by using crosscorr you will get the confidence intervals so you can reject or not the crosscorrelation hypothesis. However, the intervals in matlab, if im not mistaking, are based in a N(0,1/sqrt(N)), the asympthotic distribution of the crosscorrelation.


"elsa " <elsa_siggiridou(a)hotmail.com> wrote in message <htdaq2$biv$1(a)fred.mathworks.com>...
> thank you rogelio for your answer!
> I want to do exactly this. I know that the cross correlation follows t-student distribution with n-2 degrees of freedom. I want to do a test- hypothesis if the cross correlation is 0 for each delay so my time series are uncorrelated. For &#964;=0 there is
> [P B]=corrcoeff(A1,A2) where A1 and A2 is vector time serries,B is a matrix with correlation coefficients, and P is the p-value.And i try to calculate the p-values for the other delays with the crosscorr() but this doesn't calculate the p-values an i try to construct a function for this!