# How can I maintain a streaming value and be 95% confident that the measure for the population dropped below some value?

I weigh hail stones one at a time, producing a sequence of weights.

I want to tell the weatherman when I'm 95% confident that hail stones are less than 50g in weight based on the previous $K$ hail stones I caught.

Is there an efficient way to maintain a streaming value for this? I was thinking about maintaining a streaming median, but I'm not sure how to gauge the confidence for that.

• What do you mean by streaming value? what information is available about each hail stone? Do you end up with a sequence $h_1,\ldots,h_n$ of stone weights? – Xi'an Jan 28 '15 at 7:04
• Exactly. I get a sequence of stone weights. I was wondering if I could use the previous $K$ stone weights to determine whether stone weights in general are under 50g. – David Faux Jan 28 '15 at 8:56
• I still do not get it: what is so special about $K$? Is it a random variable? a stopping rule? Else you can definitely use your $K$ observations to test whether the average weight is less than $50$g. To test that all of them are less than $50$g does not require statistics or confidence. – Xi'an Jan 28 '15 at 10:51
• I interpret the question like this: you sample hailstone weights sequentially. How can you determine when to stop sampling them and report that the median of the entire population is less than 50g with 95% confidence? (Obviously you cannot apply a standard test of median at each step, because the tests are highly correlated and their p-values are subject to large multiple comparisons errors.) Is this interpretation correct? Instead of "median" should I perhaps understand some upper quantile (so that you are asserting nearly all the hailstones are less than 50g)? (cc @Xi'an) – whuber Jan 28 '15 at 15:46
• @whuber, exactly! Thanks for clarifying. Interesting you mention that I can't apply a standard test of median at each step ... I was thinking about doing something similar - a hypothesis test for each window of hail stones I receive at the 95% confidence level. – David Faux Jan 29 '15 at 22:56