Page 1 of 1

Coherence critical values

Posted: Wed Dec 03, 2014 10:00 am
by Ulrich Fritsche
Dear all,

I tried to figure out the critical value of the coherence as calculated in CROSSPEC.SRC.
I found an old post who suggested: C_crit = sqrt(1-alpha^(1/(n-1))).

I have monthly data from 1960-2014 and the %EBW delivers 0.08590.

I added some lines to CROSSPEC.SRC as follows (after POLAR and befor the graphing instructions):

....polar 8 / 9 10

compute n = %ebw
*compute ninv = 1/(n-1)
compute c_crit = sqrt(1-(0.95^(1/(n-1))))
display c_crit
display %ebw


if graph....

However, I only get NA so far. Calculation by hand gives about 0.67 which makes sense. I also tried with %ebw instead of computing an extra scalar n.

Re: Coherence critical values

Posted: Wed Dec 03, 2014 10:10 am
by TomDoan
1/(n-1) will be an integer divide. Change it to 1.0/(n-1) or 1/(n-1.0) and you should be fine.

Re: Coherence critical values

Posted: Wed Dec 03, 2014 10:32 am
by Ulrich Fritsche
Thank you but I am still struggling with it. I added the files I am using. I found another version of getting critical values according to a table in Koopmans (1974). For this I need the %EDF function but this is fine. This would yield 0.533 for the coherence given %EDF = 20. A follow up question: Does CROSSPEC.SRC calculate the coherence or the squared coherence (which is unfortunately labelled coherence in some texts I found)?

Regards

Ulrich

Re: Coherence critical values

Posted: Wed Dec 03, 2014 11:28 am
by TomDoan
You can compute the critical value using:

disp sqrt(1.0/((n-1)/%invftest(.05,2.0,2*(n-1))+1))

rather than relying on the table.

It's the coherence, not the square.

Re: Coherence critical values

Posted: Thu Dec 04, 2014 1:49 pm
by Ulrich Fritsche
Thank you. I was offline for a day and just found your answer.

But I have to ask again.

n is %ebw, right? But still, it is NA what shows up in my output because %ebw gives such a small number and

comp n = %ebw
disp sqrt(1.0/((n-1)/%invftest(.05,2.0,2*(n-1))+1))

tries to find a square root of a negative number possibly.

Or should calculate degrees of freedoms out of the %nobs and %ebw?

Re: Coherence critical values

Posted: Thu Dec 04, 2014 2:14 pm
by TomDoan
No. In the formulas, n is %EDF/2.

Re: Coherence critical values

Posted: Fri Dec 05, 2014 5:35 am
by Ulrich Fritsche
Got it. Thank you!