# dynamic mean: measurement of randomly distributed events

Aim is to estimate an error on a stochastic event rate. I read out the event counter second-wise, every black $1$ is a counted event (new events over time, see the plot below).

During the measurement I am estimating the event rate, so as more statistics is accumulated, mean event rate (red) should asymptotically become more accurate.

as one can see, the mean value oscillates around true value of 0.5

even after one order of magnitude more events collected.

Practical question: How can one calculate the number of events needed to estimate the mean value to a maximum error ($0.5\pm \sigma$)? - error should fall by $\sqrt{N}$

Theoretically: Can this oscillation be described analytically? Can you suggest further reading?

The events are radiation counts, so they are uncorrelated, may by Poisson-distribution applied?

addendum: idealized first approximation - every 10th event is non-zero:

may be this curve is superimposed with the realer-life example above, is here any techniques of partitioning in arbitrary functions applicable?

-
I think you need to describe your sampling/measurement process more clearly. But, it is not typical to get any hard bounds on sample size (number of events) to achieve a guaranteed maximal error. Some probabilistic statement is usually involved. – cardinal Aug 17 '11 at 0:57
experimental-mathematics sorta kinda means something else... :) – J. M. Aug 17 '11 at 6:19
better understandable? – IljaBek Aug 17 '11 at 8:43

If I understood you correctly, this can be done by applying Chebyshev confidence interval or by confidence interval based on Central Limit Theorem (CLT estimate is better, if your stochastic event rate has finite variance). Let $M$ be number of events (samples). For Chebyshev bound with $\delta$ confidence level (e.g. 0.05):
\begin{array}{l} P(|{\overline X _M} - \mu | < a{M^{( - 1/2)}}\sigma ) \ge 1 - \delta \ \end{array} \begin{array}{l} e = a{M^{( - 1/2)}}\sigma \ \end{array} \begin{array}{l} M = {(a\sigma \frac{1}{e})^2} \ \end{array} where $\ a = \sqrt 2 erfinv(1 - \delta )$