Standard deviations and confidence intervals (weighted) running average My question is related to this one. I am calculating averages, actually as many as I have samples because I calculate a running average, and for equal weighting I know how to calculate the $95\%$ CI, with $\mu\pm1.96*\sigma_{original}$. However there are two things that I dont know how to do. Can I get the $\sigma_{original}$ from the same method (convolution through Fourier transform)? How do I calculate the $95\%$ CI if the weighting is not equal (so if I convolute with a window that is not flat)?
 A: Im quite happy I found something of an answer. Its relatively straightforward and not very different from calculating your running average in the first place. However I only figured out the running part, not the weighted part. Although the following equation (found here) is not always the best way to get your standard deviation, in this case it helped me. This Matlab function helped me find it. That function assumes that your signal is not periodic however so I still needed to make my own.

The first term inside the brackets ($ \sum x_i^2 $) you get with the convolution $f^{2}\ast g$, the second part ($ [\sum x_i]^2 $) by the convolution $(f \ast g)^{2}$. Where $f$ is the signal and $g$ is the window. The squares are pointwise. Then apply the rest of the formula and youre golden. Note that $f \ast g$ is your running average which you already computed. 
This straightforward implementation is only valid for periodic signals and I think it is also only valid for non-weighted averages / flat windows. For non periodic signals you need padding and for weighted averages you need to change the formula for $s$. How to change this I still dont know. If I ever figure it out Ill add it here.
