How to measure the time dependent correlation of two signals

In summary, you are trying to detect the peaks in the blue and red curves and then use a correlation between the two peaks to determine if they are correlated.
  • #1
vibe3
46
1
I have two signals (time series) shown in the plot below. Just by looking at the figure, we can see that the two main peaks of both signals are very closely aligned (correlated), however the red signal has additional features elsewhere which don't match the blue curve.

I am looking for some function which can tell me how correlated these two signals are at a given time. IE: at t = -18 and t = +10 where the peaks are located, the correlation should be very close to -1, while at t = -40, the correlation is probably close to 0.

Specifically, I want a robust way to tell that if I see a peak in the blue curve, then there is a corresponding (negative) peak in the red curve.

I've looked into cross correlation (https://en.wikipedia.org/wiki/Cross-correlation), however this seems suitable for time series which simply have a constant time lag with respect to each other. In my problem the correlation between my two signals is changing with time. I've thought about dividing up the signal into small bins and computing the correlation of each bin, but I was hoping there is a better way.

gMCDu.png
 
Physics news on Phys.org
  • #2
They look pretty correlated to me. Note that correlation does not mean identical. From the graphs it appears that you could model the relationship perfectly well with a constant correlation and a noise term.

If you want a model with a time-varying correlation you could use a system of three stochastic DEs, one for the first time series, one for the second, which contains a correlation term to the first, and one for the randomly time-varying correlation which could for instance be an Ito process with mean-reversion to an equilibrium of zero (Ornstein-Uhlenbeck process). But it would be complicated to calibrate, and not necessarily stable.
 
  • #3
andrewkirk said:
They look pretty correlated to me. Note that correlation does not mean identical. From the graphs it appears that you could model the relationship perfectly well with a constant correlation and a noise term.

If you want a model with a time-varying correlation you could use a system of three stochastic DEs, one for the first time series, one for the second, which contains a correlation term to the first, and one for the randomly time-varying correlation which could for instance be an Ito process with mean-reversion to an equilibrium of zero (Ornstein-Uhlenbeck process). But it would be complicated to calibrate, and not necessarily stable.

Yes that is a nice example which has a good correlation. However, I have lots of examples where there is no corresponding peak in the red curve. Or sometimes there is 2 peaks in the blue curve but only 1 peak in the red curve. This is why I need a time-varying correlation.

My current thinking is to use a peak-finding algorithm to find the 2 peaks in the blue curve. Then isolate the same time intervals in the red curve and use a normal correlation on just the region near the peak. This way I can detect if both peaks are correlated, or just 1 peak, or 0 peaks
 
  • #4
It sounds like you are trying to change the model completely from on time to another, not just get a "time changing correlation". That is fine if you have a logical reason to propose different models at different times. Otherwise, you may not have a valid basis for your conclusions.
 

1. How do I measure the time dependent correlation of two signals?

The time dependent correlation of two signals can be measured by calculating the cross-correlation function between the two signals. This involves multiplying one signal by the time-reversed version of the other signal, and then integrating over all time. The resulting value will indicate the degree of correlation between the two signals at different time lags.

2. What is the significance of measuring the time dependent correlation of two signals?

Measuring the time dependent correlation of two signals can provide valuable information about the relationship between the two signals. It can reveal any patterns or trends in the data, as well as indicate the strength and direction of the correlation. This can be useful in various fields such as signal processing, neuroscience, and economics.

3. What is the difference between cross-correlation and autocorrelation?

Cross-correlation measures the correlation between two different signals, while autocorrelation measures the correlation of a signal with itself at different time lags. In other words, cross-correlation compares two signals, while autocorrelation compares one signal to a delayed version of itself.

4. Can I use any type of signal to measure time dependent correlation?

Yes, you can use any type of signal to measure time dependent correlation, as long as it is a continuous signal. This can include physical measurements such as temperature or pressure, or digital signals such as audio or video data.

5. Are there any limitations to measuring time dependent correlation?

One limitation is that the signals must be synchronized in time in order for the cross-correlation function to accurately measure the correlation between them. Additionally, the cross-correlation function may not be able to capture non-linear relationships between the two signals.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
885
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
958
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
5K
Replies
9
Views
942
  • Atomic and Condensed Matter
Replies
1
Views
828
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
719
Back
Top