However, these signals have been computed with the assumption that events are happening simultaneously and also in similar lengths which is covered in the next section. Time lagged cross correlations and windowed time lagged cross correlations are a great way to visualize the fine-grained dynamic interaction between two signals such as the leader-follower relationship and how they shift over time. Rolling window time lagged cross correlation for continuous windows The following code loads are sample data (in the same folder), computes the Pearson correlation using Pandas and Scipy and plots the median filtered data. If you have null or missing values in your data, correlation function in Pandas will drop those rows before computing whereas you need to manually remove those data if using Numpy or Scipy’s implementations. The Pearson correlation is implemented in multiple packages including Numpy, Scipy, and Pandas. Therefore it does not provide information about directionality between the two signals such as which signal leads and which follows. Generally, the correlation is a snapshot measure of global synchrony. Two things to be cautious when using Pearson correlation is that 1) outliers can skew the results of the correlation estimation and 2) it assumes the data are homoscedastic such that the variance of your data is homogenous across the data range. It is intuitive, easy to understand, and easy to interpret. The Pearson correlation measures how two continuous signals co-vary over time and indicate the linear relationship as a number between -1 (negatively correlated) to 0 (not correlated) to 1 (perfectly correlated). Time Lagged Cross Correlation (TLCC) & Windowed TLCC.To follow along, feel free to download the sample extracted face data and the Jupyter notebook containing all the example codes. To illustrate, the metrics are calculated using sample data in which smiling facial expressions were extracted from a video footage of two participants engaging in a 3 minute conversation (screenshot below). In this article, I survey the pros and cons of some of the most common synchrony metrics and measurement techniques including the Pearson correlation, time lagged cross correlation (TLCC) and windowed TLCC, dynamic time warping, and instantaneous phase synchrony. However, the term synchrony can take on many meanings as there are various ways to quantify synchrony between two signals. Synchrony between individuals has been observed in numerous domains including bodily movement ( Ramseyer & Tschacher, 2011), facial expressions ( Riehle, Kempkensteffen, & Lincoln, 2017), pupil dilations ( Kang & Wheatley, 2015), and neural signals ( Stephens, Silbert, & Hasson, 2010). In psychology, synchrony between individuals can be an important signal that provides information about the social dynamics and potential outcomes of social interactions. Airplanes flying in synchrony, photo by Gabriel Gusmao on Unsplash
0 Comments
Leave a Reply. |