Questions about imaginary coherence

831 views
Skip to first unread message

Mike X Cohen

unread,
Jan 27, 2017, 7:23:48 AM1/27/17
to analyzingneura...@googlegroups.com
Hi Yalda. See below...

On Thu, Jan 26, 2017 at 10:57 PM, Yalda Shahriari <ya.s...@gmail.com> wrote:
Hi Mike,

Thank you for the clarification. I think you might have not been considering the square based on G. Nolte, et al, 2004, that introduced the imaginary coherency without square.


Yes, that could be it. People variously square or not square coherence. I'm not sure why, although squaring does have the advantage of making small effects much smaller, which in turn increases the relative effect sizes. As long as you apply it (or not) consistently, it should be OK.

 
I am actually trying to calculate the coherency using both wavelet and Hilbert transform to calculate the analytic form of my signals and then calculate the cross spectral density and auto spectral density, and therefore, calculate the imaginary coherency based on them. However, I have several doubts.

1- My data is 17 second rest data. When I am segmenting it into say 3 sec and then calculate the Coherency, and then get average over segments, I am getting different results in comparison with the condition that get coherency over all the segment (i.e. 17sec). As you also know the more segments we have the more frequency resolution we can get. On the other hand SNR might decrease due to the non-stationary property of long segments as you mentioned. However, as I know, coherency does not assume necessarily the segment is stationary. Which one do you think is more trustable?



The main assumption of stationarity in coherence analysis is that the phase difference remains constant. Let's imagine two oscillators that are highly synchronous, but the phase offset between them is pi/2 for one second, then -pi/2 for the next second. The coherence within each second will be strong, but the coherence over the two-second period will be close to zero. This may seem like a physiologically implausible situation, but synchronization in the brain is often transient and bursty. 

In fact, something like this can happen when the two oscillators are not perfectly frequency-matched. Imagine one oscillator at 10 Hz and the other oscillator at 11 Hz. A constant time lag between them will produce a phase lag that varies over time (at 1 Hz). As the phase angle difference distribution spins around, imaginary coherence will drop to 0 at 0pi and pi. In fact, I believe you can see this in your data in the plots you sent me (off-list). Notice how the coherence "bounces" off zero. If you would inspect the phase angle distributions around those times, I think you would see that the amount of clustering is fairly similar but the phase angle changes. I also predict that if you looked at the frequency distribution of the two electrodes, you would find that they have similar but non-overlapping spectral power, with one electrode being slightly faster than the other. You can read more about this phenomenon in this paper: https://www.ncbi.nlm.nih.gov/pubmed/25234308


 
2- Using the Hilbert transform with freq=[1:1:200] with bandwidth of 1, (e.g. [0.5Hz  1.5Hz], [1.5 Hz 2.5Hz]. etc.), I am getting very smooth coherency. However, using Wavelet it is much less smooth and even a bit different characteristics. Which one you think is more appropriate in such case?



I suspect that the apparent difference is really about the bandwidth. A bandwidth of 1 Hz is quite narrow. I guess if you would inspect the power spectrum of your wavelets, they are much broader, perhaps in the range of 5-10 Hz FWHM. Broader filters allow for more temporal dynamics, hence sharper results. 

So the question then becomes: What are the appropriate parameters? Given that you have a long time series without phasic events, I'm inclined to say that narrow filters are better, because they will smooth out the temporal fluctuations, which very well might be real neural dynamics but can be difficult to interpret because you don't necessarily know why they are happening. 


 
3- How about square root in calculation of imaginary coherency? Should we say abs (imag(Coherency.^2)) or abs (imag(Coherency)).^2 if we want to keep all squared? I think although I keep both coherency and imaginary coherency the same format in my code, the interpretation of my results change a bit.


You would square the results after taking the imaginary part of coherence. If you square the complex coherence, you're effectively rotating the values in the complex plane (de Moivre's theorem) and then taking their magnitudes. Consider the following code:

z=complex(randn,randn);
plot([0 real(z)],[0 imag(z)],'k','linew',2), hold on, axis([-2 2 -2 2])
plot([0 real(z^2)],[0 imag(z^2)],'r','linew',2), grid

 
I have attached a sample of my results for your information to this email. I would appreciate it if you can tell me your idea. 
I also have to mention that I didn't do any square coherency for now. So both coherency are without square.

Thank you.
Best,
Yalda


--
Mike X Cohen, PhD
mikexcohen.com

Yalda Shahriari

unread,
Jan 27, 2017, 2:08:11 PM1/27/17
to AnalyzingNeuralTimeSeriesData
Hi Mike,

Thank you for your complete response. Just for clarification, I am not sure what do you mean exactly by "time" in my plots. I am assuming that we really don't have any time information in those plots as I am averaging the Coh:coherence/imaginary_coherency over all the time samples. The x-axis in my plots correspond to the frequency in Hz, so I think based on these information we can not recognize the times that my coherency "bounced" off zero unless I plot the coherency over time.  As you know my data is 17 sec length. If I divide it by 3 sec epochs, then I will have almost 5 epochs. So, I will have 5 Coh values that I am getting average over all of them. For the other case which was all 17 sec epoch I basically have 1 Coh value. Moreover, I don't have any specific task and the subjects were at rest. So, I am not sure if having any temporal (time domain) plot would be useful in that sense. What do you think?

Also, thank you for mentioning about the wavelet bandwidth, yes I think that was the issue.

Also I completely agree with the use of square in the coherency that you mentioned.

Thank you Mike!

Best,
Yalda

Mike X Cohen

unread,
Jan 28, 2017, 2:30:04 AM1/28/17
to analyzingneura...@googlegroups.com
Oh yes, sorry, indeed the x-axis was frequency not time. I was too excited about the bounces, I guess ;)  

Mike



--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.

Yalda Shahriari

unread,
Jan 28, 2017, 11:27:50 AM1/28/17
to AnalyzingNeuralTimeSeriesData

 

Hi Mike,

You have a great sense of humor while being an expert in neural signal processing, a good combination ;)!

Back to our original discussion, regarding the Bonces, as I don't have any stimulation/task in my data and all the subject are at rest, do we still expect to have informative plots showing the temporal dynamic of the coherency imaginary values? Indeed, this will be a 3-D plot similar to Figures 6,7 of your paper " Effects of time lag and frequency..."?

Also, I am using Hilbert transform for my analysis. I am wondering if there is any particular reason that you are mostly using Wavelet for such analysis of yours. My data are deep structure recording (ECoG and LFP), so as far as I have proper filtering specifications (e.g. bandwidth (1 Hz), order (2*minimum Freq/srate, fir1 filter, zero phase filfilt), the Hilbert transform is giving me pretty much what I expect.

Thank you.
Best,
Yalda



On Friday, January 27, 2017 at 7:23:48 AM UTC-5, Mike X Cohen wrote:

Mike X Cohen

unread,
Jan 28, 2017, 11:51:51 AM1/28/17
to analyzingneura...@googlegroups.com
Hi...

On Sat, Jan 28, 2017 at 5:27 PM, Yalda Shahriari <ya.s...@gmail.com> wrote:

 

Hi Mike,

You have a great sense of humor while being an expert in neural signal processing, a good combination ;)!

Back to our original discussion, regarding the Bonces, as I don't have any stimulation/task in my data and all the subject are at rest, do we still expect to have informative plots showing the temporal dynamic of the coherency imaginary values? Indeed, this will be a 3-D plot similar to Figures 6,7 of your paper " Effects of time lag and frequency..."?



Probably not. I'm sure you will see lots of temporal dynamics in the results, but without knowing what was happening at the time, it will be difficult to know which features of the dynamics are real neural dynamics and which are noise.


 
Also, I am using Hilbert transform for my analysis. I am wondering if there is any particular reason that you are mostly using Wavelet for such analysis of yours. My data are deep structure recording (ECoG and LFP), so as far as I have proper filtering specifications (e.g. bandwidth (1 Hz), order (2*minimum Freq/srate, fir1 filter, zero phase filfilt), the Hilbert transform is giving me pretty much what I expect.



There are a few reasons why I prefer Morlet wavelet convolution, perhaps the main one is that because the power spectrum of the wavelet is Gaussian, you never need to worry about a potentially poorly constructed narrowband filter that create edge artifacts (time-domain ripples). FIR/IIR filter kernels should be inspected because of the danger of poor filter construction design. That's not to suggest that most FIR filters are suboptimal, just that they have more parameters that affect the quality of the results. Wavelets are harder to screw up. A few other reasons include ease of programming, computation speed, and just personal preference.

But don't let that dissuade you from using narrowband filters. Given the right parameter choices, either approach will give you the same results. That said, I would recommend inspecting a few of your filter kernels in the time and frequency domains. 2*minfreq is a bit on the low side for the filter order. You'll get more specificity with a higher order.

Mike


 
--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.

Yalda

unread,
Jan 28, 2017, 12:22:47 PM1/28/17
to analyzingneura...@googlegroups.com
Thank you Mike for your suggestions!

Best,
Yalda

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.

YShah

unread,
Mar 6, 2017, 9:18:47 AM3/6/17
to AnalyzingNeuralTimeSeriesData

Hi Mike,

 

The technical differences and assumptions between how Imaginary coherency overcomes the volume conduction effect and how PLI does is not that clear to me.

 

 In the PLI it assumes any common source and volume conduction produces a normal distribution, and thus the "sign" would be zero. So, the more skewed distribution we have the higher PLI we have.

 

In the Imaginary Coh, it assumes any volume condition has an effect on the real part of coherency but not imaginary. I can not understand the idea behind it that why volume conduction does not have an effect on the imaginary. Nolte et al., pointed out to the Maxwell equations in their original paper, and over there they said that volume conduction does not cause a phase shift. Assuming based on Maxwell equations that volume conduction does not cause any phase shift, how it is related to the imaginary part but not real part?!  Phase is the Atan (Img/Real), if we have any changes in the Real we would have change in the Atan, and therefore, the phase. 

 

Also, I am assuming PLI is a more comprehensive measure of phase analysis than the Imaginary Coh, do you have any idea?

 

Thank you.

Best,

Yalda

Mike X Cohen

unread,
Mar 6, 2017, 11:49:37 AM3/6/17
to analyzingneura...@googlegroups.com
Hi Yalda. I'm not a physicist, but I will try to provide my (admittedly pedestrian) understanding of this concept. First, keep in mind that we are not interested in phase angles per se, but rather phase angle differences between electrodes. The key assumption is that electrical fields propagate from brain to electrodes instantaneously, i.e., with zero phase lag (or pi phase lag if on opposite sides of the dipole). This assumption holds for frequencies we generally consider and within measurement sampling rates. 

A phase lag of zero means that the phase angle difference is on the horizontal axis in the complex plane, which means the imaginary component is zero. Therefore it doesn't matter what the real part is, because imag/real will always be zero when imag=0. That's for instantaneous phase synchronization. Noise will have both positive and negative lags, and so will average out to zero or will be statistically indistinguishable from zero. The only feature of the data that will have a significant imaginary component of the phase angle difference is lagged phases. And lagged phases cannot arise from volume conduction (again, at frequencies and measurement capabilities that we use). The caveats to this are that (1) there are true zero-phase lag differences in the brain and (2) real connectivity patterns with small phase lags can be statistically indistinguishable from zero. In other words, imaginary coherence will generally not produce Type-I errors but they do produce Type-II errors.

There are several algorithms for non-zero-phase-lag connectivity, including imaginary coherence, PLI, dPLI, and so on. They are all based on the same core assumption described above, and differ in relatively minor ways. In my experience, these variants all produce more-or-less the same results, with some differences in smoothing or effect sizes. For example, imaginary coherence is sensitive to power and dPLI is sensitive to the magnitude of the phase lag (larger phase lags give larger effect sizes, even if the true strength of coupling is the same). You can create simulations that differentiate these methods, but I think you'll find in real data that these methods all give basically the same results.

So I guess that's my advice for you -- don't pick one method a priori, but try a few different methods and trust the results that are robust to minor algorithm variants.

Hope that helps,
Mike


Yalda Shahriari

unread,
Mar 6, 2017, 7:53:13 PM3/6/17
to analyzingneura...@googlegroups.com
Hi Mike,

Thank you for the explanations. I do understand the mechanisms of how PLV, PLI, dPLI, Imag Coh are measuring the phase differences between two locations across time points or trials. However, I am not sure what you mean by : "The only feature of the data that will have a significant imaginary component of the phase angle difference is lagged phases". Basically, my concern is phase shift or phase lagged difference does not necessarily mean the Imag part differences. To be on the same boat together, let's say the phase difference is Atan(Imag1/Real1)-Atan(Imag2/Real2). We can have differences in the Real part and still have phase lag. So, as the volume conduction does not produce any phase lag (based on Maxwell), it does not necessarily mean it does not produce a lag in the Imaginary part. In fact it does not have effect on neither of Imag nor Real part. OR it can even produce zero lag when the ratio of Imag/Real is the same.

Also, for this sentence of you: "First, keep in mind that we are not interested in phase angles per se, but rather phase angle differences between electrodes", based on my knowledge we get the phase differences between two electrodes and then get the average of the phase differences over trials or time points. I am assuming you have the same meaning, if not please let me know.

As you know, noises can generate random phase differences which can result in a normal distribution with mean=0. The PLI for such distribution in fact is zero where the PLV can be very high (i.e. close to 1). However, for the Imaginary Coh, as you also mentioned it can produce Type-II errors. As I know neither of Type-I nor Type-II errors can happen using PLI and this makes this measure of analysis a more powerful and comprehensive one than the Imag Coh. I am still not convinced with the advantages of Imag Coh over PLI!

Thank you.
Best,
Yalda

Best Regards,
Yalda Shahriari, Ph.D.


Assistant Professor of Biomedical Engineering
Department of Electrical, Computer & Biomedical Engineering, University of Rhode Island
Affiliate Member of University of California, San Francisco

Ryan Research Assistant Professor of Neuroscience
Affiliate Member of Ryan Institute for Neuroscience
Office: A-102, Kelley Annex, 4 East Alumni Ave, Kingston, RI 02881
Phone: 401 874 5368

Web: http://egr.uri.edu/ele/meet/yalda-shahriari/

 


Mike X Cohen

unread,
Mar 7, 2017, 3:44:44 AM3/7/17
to analyzingneura...@googlegroups.com
Hi Yalda. I often find that simulations give me better intuition than equations. Perhaps you should try to simulate instantaneous and lagged synchronization to inspect the distributions on the imaginary axis.

About the Type-II errors: true connectivity with zero (or near-zero) phase lag will be missed by PLI (this is also discussed in the original PLI papers from Cees Stam). That's not necessarily such a bad thing -- one must weigh potential false positives against potential false negatives.

Mike


Yalda Shahriari

unread,
Mar 7, 2017, 12:31:30 PM3/7/17
to analyzingneura...@googlegroups.com
Hi Mike,

Yes, that's a good suggestion. I will do it based on the simulated data to see their differences over each other. I will also take a closer look at Stam's paper for the Type-II error.

Thank you.
Best,
Yalda
Reply all
Reply to author
Forward
0 new messages