title: Calculating weighted mean and standard deviation
body: <p>I have a time series <code>x_0 ... x_t</code>. I would like to compute the exponentially weighted variance of the data. That is:</p>
  
  <pre><code>V = SUM{w_i*(x_i - x_bar)^2, i=1 to T} where SUM{w_i} = 1 and x_bar=SUM{w_i*x_i}
  </code></pre>
  
  <p>ref: <a href="http://en.wikipedia.org/wiki/Weighted_mean#Weighted_sample_variance">http://en.wikipedia.org/wiki/Weighted_mean#Weighted_sample_variance</a></p>
  
  <p>The goal is to basically weight observations that are further back in time less.  This is very simple to implement but I would like to use as much built in funcitonality as possible.  Does anyone know what this corresponds to in R?</p>
  
  <p>Thanks</p>