# Control lines that converge?

I'd like to have some control lines that converge, if the random variable observed becomes stable.

For example, as the chart below, the variable starts at around 3.0, the upper control line is around 6.0, and lower control line is about 2.0.

At the beginning there's less data so the uncertainty is high. As time grows there are more data and the band's width converges.

The control lines work fine, notice the trend between [0, 21], the variable climbs up, but the control lines still hold it.

I assume a similiar effect could be achieved using EWMA method to measure the standard error, plus an empirical upper/lower limit parameter, similiar to the L in EWMA chart (http://en.wikipedia.org/wiki/EWMA_chart).

Just wonder, are there some industry practices already, for such purpose? I just don't want to reinvent the wheel.

Bollinger Bands.

I like to think of the EWMA as follows:

given:

$\mu_n = \frac {1} {n} \sum _{i=1}^{n} x_i$

so:

$\mu_{n-1} = \frac {1} {n-1} \sum _{i=1}^{n-1} x_i$

popping the last value of of the given yields:

$\mu_n = \frac {1} {n} \sum _{i=1}^{n-1} x_i + \frac {1} {n} x_n$

substituting the reduced mean gives

$\mu_n = \frac {n-1} {n} \frac {1} {n-1} \sum _{i=1}^{n-1} x_i + \frac {1} {n} x_n$

or

$\mu_n = \frac {n-1} {n} \mu_{n-1} + \frac {1} {n} x_n$

or

$\mu_n = \left ( 1 - \nu\right ) \cdot \mu_{n-1} + \nu \cdot x_n$

the same general derivation, with a different initial definition, leads to an exponentially weighted standard deviation.