I am trying to monitor the relationship between two variables over time and detect when a statistically significant change in the relationship between them occurs. This process should occur online, so the analysis takes place whilst the variables are being received.
I have only a low level of statistically knowledge, however from what I have read I have come up with the following and I would appreciate it if somebody could let me know if it makes sense, is legitimate or if I am completely off track. If the latter, a point in the correct direction would be great.
The two variables, A and B, are sensed data each recorded at every time step. My approach is to record 30 values for each variable. Once the initial 30 have been gathered, future values are only added after the oldest value is deleted. In this way, a sliding window, the number of readings for each remains at 30 for every time step.
To measure the relationship between the two variables I periodically compute the Pearson Correlation Coefficient. This gives me a measure of their relationship in terms of how much they correlate together. After every Pearson calculation, I record the result, C, in a time-series and as above, use a sliding window technique.
By analysing this time-series I can detect significant changes in the relationship when they occur using an algorithm such as anomaly detection using CUSUM or Shiryayev Sequential Probability Ratio. So if the variables are always strongly correlated that is not what I am looking for. I am looking for when the variables have been strongly correlated and then stop being correlated, or vice-versa.
Is the process described above valid from a statistical point of view?
All feedback is greatly appreciated.