Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I took some measurements of some data (code run time measurements, for those curious) of which I have no idea what the expected value is.

The data is discrete, and I have no idea what type of properties it has or distribution it follows.

The only thing that is known is that the values are more or less independent of each other. I say more or less, because there are some cache effects that can cause correlate one measurement with another, but I don't know how it may affect the measurements.

In addition, I do know that each measurement has a certain amount of granularity, since I can only measure to something like $\frac{1}{Frequency}$ accuracy, limited by the speed of my processor.

Given that I have $N$ total samples of data, what sorts of things can I do to say, for example, "I have $X$% confidence that the expected run time of this code should be $Y$ "?

I essentially want to determine how accurate my measurements are and to what degree I'm confident they are. I have no idea how to do this, as I've never had a chance to take a proper statistics class.

share|improve this question
4  
When it comes to knowing whether measurement is valid, there is a lot to be said for domain specific experience. This allows you to form expectations about what the data should look like, and thus, you become more attuned to knowing when the data is deviating from your expectations. You may wish to elaborate more on the details of your specific measurement domain as I imagine most answers regarding assessing validity of data would be contingent on the domain. – Jeromy Anglim Jun 5 '11 at 7:20
1  
You may also find Zed Shaw's introduction to basic statistics for programmers helpful: zedshaw.com/essays/programmer_stats.html – scw Jun 5 '11 at 23:46
@scw Good link but definitely NSFW – Bob Durrant Jun 6 '11 at 6:34
@Bob right, I should've mentioned that -- hopefully one of the moderators can include (NSFW) in my comment. – scw Jun 6 '11 at 7:14

1 Answer

I'm focussing on your second last para and the fact that you haven't taken a stats class, and assuming you're mainly interested in saying something about the average runtime of your code?

The following is the simplest possible approach - I suspect that this is something you already know but it's not entirely clear to me from your post whether that's the case or not:

Run the code $N$ times and average the runtimes over those $N$ runs.

The Central Limit Theorem then implies that the sample mean you calculated came from a normal distribution (that is, unless the distribution of runtimes is rather strange then the sample means of collections of runtimes will be approximately normally distributed). From there you can use standard confidence bounds on normally distributed data to say the sort of things you'd like to about the runtime (example).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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