Is there a better way to calculate time-shifted correlation matrices?

  • Context: Undergrad 
  • Thread starter Thread starter Frank Einstein
  • Start date Start date
  • Tags Tags
    Matrix Python
Click For Summary
SUMMARY

The discussion focuses on calculating time-shifted correlation matrices using temperature data from four thermometers. Frank initially considers removing rows from the data matrix to analyze changes in correlation but seeks more efficient methods. He employs Python's NumPy library, specifically the functions np.cov(Tdata_shifted2) and np.cov(Tdata), to compute both shifted and non-shifted correlation matrices. The conversation highlights the need for cross-sensor delayed correlations rather than just autocorrelations.

PREREQUISITES
  • Understanding of correlation matrices and their significance in data analysis.
  • Familiarity with Python programming, particularly the NumPy library.
  • Knowledge of time series data and its manipulation.
  • Experience with matrix operations and statistical analysis.
NEXT STEPS
  • Research advanced techniques for calculating time-shifted correlation matrices in Python.
  • Explore the use of the pandas library for time series data manipulation.
  • Learn about cross-correlation functions and their applications in sensor data analysis.
  • Investigate the Stack Exchange answer by jboi for additional insights on delayed correlations.
USEFUL FOR

Data scientists, statisticians, and researchers analyzing time series data from multiple sensors, particularly those interested in advanced correlation techniques and Python programming.

Frank Einstein
Messages
166
Reaction score
1
TL;DR
I want to know if there is a better way to obtain the correlation matrix of time-shifted series than just removing observations.
Hello everyone.

I have four thermometers which measure the temperature in four different positions. The data is distributed as a matrix, where each column is a sensor, and each row is a measurement. All measurements are made at exactly the same times, one measurement each hour. I have calculated the correlation matrix between all four positions.

Now I am interested in the calculation of the time-shifted correlation matrix. The only method I can think of is to remove the first n rows of the sensors 1 and 2 and the last n rows of the sensors 3 and 4 to see how the correlation changes.

I was wondering if there is a better way to do this than just removing rows.

Any help is appreciated.

Best regards.
Frank.

PS. I am using Python, so I have just used the function np.cov(Tdata_shifted2) and np.cov(Tdata) to obtain the shifted an non-shifted matrices.
 
Physics news on Phys.org
This stackexchange problem seems to match yours.
Most answers seem to only address calculating autocorrelations of each sensor with itself, not cross-sensor delayed correlations. It looks like you do want those latter. The answer by jboi (Feb 17, 2018 at 22:38) seems to provide those.
 
  • Like
Likes   Reactions: WWGD and Frank Einstein
Thanks for the answer
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K