Coherence critical values
-
Ulrich Fritsche
- Posts: 6
- Joined: Wed Dec 03, 2014 4:33 am
Coherence critical values
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.
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
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.
-
Ulrich Fritsche
- Posts: 6
- Joined: Wed Dec 03, 2014 4:33 am
Re: Coherence critical values
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
Regards
Ulrich
- Attachments
-
- rats_tests.prg
- (1.04 KiB) Downloaded 1120 times
-
- input.xlsx
- (44.86 KiB) Downloaded 781 times
Re: Coherence critical values
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.
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.
-
Ulrich Fritsche
- Posts: 6
- Joined: Wed Dec 03, 2014 4:33 am
Re: Coherence critical values
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?
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
No. In the formulas, n is %EDF/2.
-
Ulrich Fritsche
- Posts: 6
- Joined: Wed Dec 03, 2014 4:33 am
Re: Coherence critical values
Got it. Thank you!