User:Caswick

Use exponentially weighted moving average to project file transfer in progress:
 * x is a duration of time for an event to occur (such as 100K data transfer)
 * y bounds the value of x to rational values
 * j is lower bound
 * k is upper bound
 * alpha is the degree of weighting from 0 to 1
 * s is the average duration for one event to occur
 * w is the number of events (if event is "1k has been transferred", then w=22 for a file transfer of size 22k)
 * p is the average period of time w events will consume

Algorithm:

\begin{align} y& = \min (\max (x, j), k)\\ s_1& = y_1\\ s_t& = \alpha y_t + (1-\alpha)s_{t-1} = s_{t-1} + \alpha (y_t - s_{t-1})\\ p& = s w\, \end{align} $$