Suppose that we have the following time series:
X1 = {(0, 3), (1, 4), (3, 5)}
X2 = {(0, 3), (1, 4), (2, 6) (3, 5), (4, 8)}
X3 = {(0, 3), (1, 4), (2, 6) (3, 5), (4, 8), (5, 9)}
where the first element of the tuple represents the time, and the second element represents the value taken at that time (e.g. temperature measured at certain point in time).
What would be an efficient way of finding out the missing timestamps of X1
comparing to X2
and X3
(e.g. the missing timestamps of X1
compared to X2
and X3
are: (2,_)
, (4,_)
, (5,_)
), and then using linear interpolation to put some values for the timestamps that were missing in X1
? What kind of data structure would you use, and how would you look for the missing values knowing the timestamp and then apply linear interpolation between two points (as output, I am supposed to see X1 with all values)?