Let’s say I have two tables of data, each giving a value for a point in time. The times and values given are not necessarily at regular intervals in each table.
I want to find how well the two graphs match up. I also want to see if there is a shift (in time in this case) I can apply to one of the graphs that will make the two graphs correlate more.
One way to do this might be to calculate the integral between each graph and find the difference. Then, continue to apply slight shifts in time until the time shift for the best correlation is determined. Although this seems a bit cumbersome to me.
Does anyone know if there is a better way to do this, or if there are any libraries that can help me out?
Sounds like you want to do a cross correlation. I would recommend using the great Pandas package if you are doing anything with time series data. Here’s a link to your specific question also:
How to get the correlation between two timeseries using Pandas