Combining multiple time series with unknown start dates I have a small database of voltage information from multiple batteries (of the same type), with each measurement being a tuple of (battery id, battery voltage (as a percent) and measurement time). I can also view this as distinct time series for each battery.
My goal is to build a model of the battery voltage in order to predict the amount of time the battery has left before it goes 'flat'. I would like to combine the distinct battery time series to build this model. My issue is that the battery measurements were sporadic, so none of time series begin at 100% and end at 0% voltage (although some do start at 100%, and others end at 0%).
I have looked into this issue and tried a couple of things:

*

*Using the battery voltage as the index instead of the time, this failed because the battery voltage can go up slightly (it is not monotonically decreasing), so the resultant time series doubles back on itself.

*Trying to estimate the start index by finding when a given voltage occurs in the other time series, this achieved the best result so far, but the voltage can be unchanged for long periods of time, so this solution has a huge amount of variability depending on if I pick the first time the voltage is at a given value or the last.

As the data set is small, I would like to include all of my data if possible. Is there another way for me to combine these time series together, and if not, is there a consensus on how I should perform option 2?
Example:
Series_1 = [100%, 99%, 98%, 97%, 95%, 94%, 93%, 91%, 93%, 93%, 91%, 91%, 90%,...]
Series_2 = [93%, 91%, 92%, 92%, 92%, 92%, 92%, 92%, 92%, 92%, 91%, 90%,....]

Currently, my models are assuming that Series_1[0] and Series_2[0] are equivalent as they are both the 0th index, whereas it would be better if Series_1[6] and Series_2[0] were compared (or Series_1[9] and Series_2[0].

For option 2, here are a couple of methods you could try, based on time series distance measurements, to find the best index position ($i$) in Series_1 $S1$ to match to Series_2[0] ($S2$). The idea behind them is that if we can find the best alignment between the two series, then the offset between the start of $S1$ and $S2$ is your appropriate index value. For ease of explanation, I'll assume your time series are the same length ($N$), but it shouldn't be too difficult to adapt these methods if they are different lengths. I'll also assume that $S1$ starts at a higher voltage than $S2$ (as in your example). I'll use the notation $S_{(j,k)}$ to indicate the sub-series of $S$ $S_{(j,k)}=[S[j], S[j+1], ..., S[k]]$:

*

*For each $j<N$, calculate $D_j=E(S1_{(j,N-1)},S2_{(0,N-j-1)})/(N-j)$, where $E$ is the Euclidean distance between $S1_{(j,N-1)}$ and $S2_{(0,N-j)}$, then set $i$ to the $j$ with the minimum value for $D_j$.

*Use dynamic time warping (DTW) to find the best alignment between $S1$ and $S2$), then set $i$ to be the maximum $j\backepsilon S2[0]\rightarrow S1[j]$ (in other words, the index $i$ is the index of the last point in $S1$ that maps to $S2[0]$).

If you are not familiar with DTW, it's a way of calculating the distance between two time series by "warping" one or both time series to find the best alignment - it allows a many:many mapping between the time points in the two series (while preserving the ordering), and is often a better way of calculating the distance between two time series than the Euclidean distance if the time series are misaligned. A couple of references for DTW are:

*

*Berndt and Clifford, 1994,Using dynamic time warping to find patterns in time series

*Keogh and Ratanamahatana, 2005, Exact indexing of dynamic time warping. Section 2.1 provides a nice description of DTW.

