title: Compute EWMA over sparse/irregular TimeSeries in Pandas
body: <p>Given the following high-frequency but sparse time series: </p>
  
  <pre><code>#Sparse Timeseries
  dti1 = pd.date_range(start=datetime(2015,8,1,9,0,0),periods=10,freq='ms')
  dti2 = pd.date_range(start=datetime(2015,8,1,9,0,10),periods=10,freq='ms')
  dti = dti1 + dti2
  
  ts = pd.Series(index=dti, data=range(20))
  </code></pre>
  
  <p>I can compute an exponentially weighted moving average with a halflife of 5ms using a pandas function as follows:</p>
  
  <pre><code>ema = pd.ewma(ts, halflife=5, freq='ms')
  </code></pre>
  
  <p>However, under the hood, the function is resampling my timeseries with an interval of 1 ms (which is the 'freq' that I supplied). This causes thousands of additional datapoints to be included in the output.</p>
  
  <pre><code>In [118]: len(ts)
  Out[118]: 20
  In [119]: len(ema)
  Out[119]: 10010
  </code></pre>
  
  <p>This is not scalable, as my real Timeseries contains hundreds of thousands of high-frequency observations that are minutes or hours apart.</p>
  
  <p>Is there a Pandas/numpy way of computing an EMA for a sparse timeseries without resampling? Something similar to this: <a href="http://oroboro.com/irregular-ema/" rel="nofollow">http://oroboro.com/irregular-ema/</a></p>
  
  <p>Or, do i have to write my own? Thanks!</p>