Skip to content

Commit 42fb161

Browse files
committed
fix wrong weight index in MTCoherenceAnalyzer.coherence()
When computing the PSD of series y, the function was using the index `i` to get weights: ``` syy = tsa.mtm_cross_spectrum(self.spectra[j], self.spectra[j], self.weights[i], sides='onesided') ``` while it should be using `self.weights[j]`.
1 parent fec33e4 commit 42fb161

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nitime/analysis/coherence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def coherence(self):
351351
self.weights[i],
352352
sides='onesided')
353353
syy = tsa.mtm_cross_spectrum(self.spectra[j], self.spectra[j],
354-
self.weights[i],
354+
self.weights[j],
355355
sides='onesided')
356356
psd_mat[0, i, j] = sxx
357357
psd_mat[1, i, j] = syy

0 commit comments

Comments
 (0)