1
$\begingroup$

I have a set $S$ of $N$ real numbers. I wanna calculate the mean $m$ variance $v$ of $S$. But since $N$ is too large, I do not want to use all of the numbers. Instead, I would like to sample $n$ numbers uniformly randomly from the $N$-number set $S$, such that mean and variance of the sampled set does not deviate too much from the original set. Say, the error I can tolerate is $e_m$, and $e_v$ respectively (which means that the mean of the sample set should fall in $(1 \pm e_m)m$, and the sample variance should fall in $(1\pm e_v)v$). How large should $n$ be?

$\endgroup$
  • 1
    $\begingroup$ Can you say anything about the distribution of the numbers in $S$? One worry is that $S$ could contain, say, $N-1$ values in the interval $[0,1]$ and another value near $N^2$. Unless the sample is large enough to contain that last value with high probability, neither the sample mean nor the sample variance will be anywhere near the mean and variance of $S$ itself. $\endgroup$ – whuber Mar 24 '12 at 19:05
  • 1
    $\begingroup$ Hi @whuber, thank you very much for your reply. I am trying to consider the generalized case without assumptions on the distribution. With your explanation, I understand that it is kind of impossible. $\endgroup$ – Geni Mar 24 '12 at 19:18
2
$\begingroup$

Statistics doesn't allow for absolute certainty in estimating moments (like the mean and variance). What you can do is set a confidence level (say, 95%) and determine the sample size n necessary to be 95% certain that the mean is within your tolerance. You'll need to know something about the variance of the distribution to use the equations here: Wikipedia's Sample Size.

Depending on how rigorous you need to be about this, you can probably start by using a similar approach to estimate the variance, and then use the estimated variance in calculating n for the mean. Obviously, you could do this iteratively, getting better results with each iteration. Generally, straight-forward and and informationally efficient estimates require you to know (or assume) some things about your set S, like how it is distributed.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.