# What are the proper metrics to look at for checking discrepancies in these two time series

I am obtaining bid/ask price and volume market data from two different sources for the same ticker and for the same day and checking to see that at time intervals X they are "roughly the same". The timestamps from the two different sources are not exactly the same, though, and so what I am doing is dumping the price every time the timestamps span a different second of the day. Sometimes the price varies in between that second, sometimes it doesn't, but regardless I dump the way it looks at the beginning of that second (or millisecond). After doing this for both sources, I did a simple plot of the results and things are looking consistent graphically:

The time stamps do not always align, though when I intersect the time stamp columns and get a subset of the observations, and cross correlate them I get relatively poor values. Worse at higher granularities, probably due to time stamp lag-like discrepancies. I'm not sure if I should be looking at some other metric to convince myself that both sources are providing me with similar information about the ask/bid throughout the day, or what the appropiate methodology is to compare these two time series with each other. Is it cointegration between them that I am looking for? What I care to confirm is that, say, assuming the first source I know to be accurate data from which I build my view of the bid/ask throughout the day - that the second source is not too off.

-
mean absolute error is a start – pyCthon Oct 30 '12 at 20:26
It would be interesting to see a scatterplot of the data. Even though you have poor cross correlations, you might be able to detect some level shifts in the plot and formulate if there is an easy calibration for the shifts. – pat Oct 31 '12 at 0:25

To take into account lag-like discrepancies between two time series, DTW(Dynamic Time Warping) algorithm is generally used.

Quoting from wiki - "In general, DTW is a method that calculates an optimal match between two given sequences (e.g. time series) with certain restrictions. The sequences are "warped" non-linearly in the time dimension to determine a measure of their similarity independent of certain non-linear variations in the time dimension."

The catch here is that the algorithm can become intractable for a large input, so it is generally run on a distributed system.

-

It is not uncommon to find significant differences in historical price data from different sources & data vendors. For example, if you look at ETF ticker symbol "EEM" for the period from 2001 until now using free Yahoo data and free Google data from the Internet, you will see that for some of this period they agree and for some of the time they are quite different. When using historical data, the problem is: How do you actually "know" that one series is "accurate"?

From a practical trading perspective, some suggestions are:

1) Be wary of free data. If you are a serious trader, it is probably in your best interests to buy data from a reliable data vendor who has checked it for errors and cleaned it up properly at the original time. This is especially important if you are looking at continuous futures contract data.

2) Rather than trying to merge two different versions of the same data series when they disagree (and therefore AT LEAST one of them is probably wrong), you may be better off analyzing them separately and then see what are the resulting differences in your trading signals from the two sets.

3) There is no point contaminating good data with bad data. If you really do know that one data set is good, then use it as it is. "Less data but good data" is better than "More data including some bad data", especially if you are intending to use some form of predictive algorithm.

-