title: compare two time series (simulation results)
body: <p>I want to do unit testing of simulation models and for that, I run a simulation once and store the results (a time series) as reference in a csv file (see an example <a href="https://gist.github.com/thorade/60fb0d9594750e3140bab9cd1237af84" rel="noreferrer">here</a>). Now when I change my model, I run the simulation again, store the new reults as a csv file as well and then I compare the results.</p>
  
  <p>The results are usually not 100% identical, an example plot is shown below:<br>
  The reference results are plotted in <strong>black</strong> and the new results are plotted in <strong>green</strong>.<br>
  The difference of the two is plotted in the second plot, in <strong>blue</strong>.<br>
  As can be seen, at a step the difference can become arbitrarily high, while everywhere else the difference is almost zero.</p>
  
  <p>Therefore, I would prefer to use a different algorithms for comparison than just subtracting the two, but I can only describe my idea graphically: 
  When plotting the reference line twice, first in a light color with a high line width and then again in a dark color and a small line width, then it will look like it has a <strong>pink tube</strong> around the centerline.  </p>
  
  <p>Note that during a step that tube will not only be in the direction of the ordinate axis, but also in the direction of the abscissa. 
  When doing my comparison, I want to know whether the green line stays within the pink tube.
  <a href="https://i.stack.imgur.com/Mp3rk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Mp3rk.png" alt="enter image description here"></a></p>
  
  <p>Now comes my question: I do not want to compare the two time series using a graph, but using a python script. There must be something like this already, but I cannot find it because I am missing the right vocabulary, I believe. Any ideas? Is something like that in numpy, scipy, or similar? Or would I have to write the comparison myself?</p>
  
  <p>Additional question: When the script says the two series are not sufficiently similar, I would like to plot it as described above (using matplotlib), but the line width has to be defined somehow in other units than what I usually use to define line width.  </p>