I have a dataset of points in space, sampled at a specified time. Now i want to obtain a 'spatial correlation plot, only between points close in time'. What i did is creating a dataframe of pairs of observations that are within a specified time-gap (for example 6 months). The columns of my dataframe are the following
- Source_x Source_y Source_val Target_x Target_y Target_val spaceDistance
Where
- Source indicates the starting point and Target the other point of each pair
- x and y are spatial coordinates
- val is the value associated with each point
- spaceDistance is the spatial distance between points
I want to obtain some sort of correlation between the distance and how much values differ for each pair.
I thought i could do this simply by calculating the Manhattan distance of values and correlating those to the distance but this seems biased and difficult to interpret.
What do you think is the smartest way to analyze this type of data?
Note:
- I don't want to transform the dataset in a long format and calculate all possible correlations between points because if i would do that i lose the information of 'time-adjacent' measurements
EDIT Here's more information:
- The biggest dataset I have is around 3 millions pairs of measurements (within 6 months). Not all datasets are this big and i think i might need to subsample in those cases.
- I have no clue of what pattern there might be between points, my hypothesis is that there should be inhomogeneity. That is: there is an underlying clustering of points that affects the actual difference in values.
- The original data is always available.
- Source_val and Target_val are floats (numbers). The theoretical range is infinite but the measured values range from 0 to 5 millions (maybe is should log the values?).