I have set of numbers and know it's size, mean, standard deviation, minimum and maximum. When I calculate regular confidence interval for mean I get something like this (-20;50). But the source value can only be positive, so it would look bad on a graph. I'd like to find confidence interval within given minimum and maximum values. It's just max values have random peaks and I want to smooth it with CI. Is there some way to do it?
Confidence Interval within min and max values
-
0There is almost certainly a better way to do what you're doing, but I would want to know more about what you're doing before trying to say what that is. In particular, how do you know that the values can only be positive? Could it be that you're finding a confidence interval appropriate to a sample from a normal distribution? Observations from a normal distribution will not always be positive, so that's not a good way to proceed unless you have a standard deviation that's so small compared to the sizes of the observations that a normal approximation is appropriate. – 2011-10-07
-
0Values are pings. They can't be negative. Standard deviation isn't small at all. Basically I need a good way to show statistics of pings on a graph for a period of time. So what's a better way you're thinking about? – 2011-10-07
-
0What do you mean by "pings"? (That the standard deviation is large could be deduced from what you told us initially.) – 2011-10-07
-
0Ping is the round-trip time for the signal sent from one computer to another. – 2011-10-07
-
0One might want to see the data before being sure how to proceed. You might consider whether the logarithms of the times [look like a sample from a normal distribution](http://en.wikipedia.org/wiki/Normal_probability_plot). If so, find a confidence interval by the usual methods you'd use for samples from a normal distribution, then take antilogarithms to get a confidence interval for what you started with. This would be for the median of the population, not for the mean, since lognormal distributions are like that. – 2011-10-08
2 Answers
As Michael Hardy noted in comments, the likely problem is that you are trying to model the process with inappropriate distribution. If a confidence interval is built using a distribution supported on positive numbers, it will consist of positive numbers. Given the context of "pings", it is reasonable to try the exponential distribution, which is often used to model the waiting time. Another possibility is log-normal distribution also mentioned by Michael Hardy.
Try resampling. Construct, say, 10,000 samples of the same size as what you have (with replacement). Compute the mean for each. Assume you want a 95% confidence interval. Throw out the lowest and highest 250 sample means. The range of your remaining 9500 values is your desired confidence interval.