Fast algorithm for uniformity test
I have zero to many bookings per day, and I nee开发者_如何转开发d some measure of how uniformly these bookings are distributed throughout my time period. Bookings can be half day or full day bookings.
The time period I am considering in this case is one month.
My data has lots of gaps: in a month I may only have up to 25-50% of days booked.
I need an algorithm which will give me a number (arbitrary units, I don't care: I will just be comparing many permutations and picking the most uniform) which represents the uniformity of the bookings.
Most importantly, I need it to be quite fast as I will be running it many hundreds of times.
I have looked at Anderson-Darling tests, Cramer-con-Mises, and Kolmogorov-Smirnov tests, but these all check whether data fits any distribution. I'm sure there is a faster algorithm to determine if data is purely uniform.
I'm coding in C#
I hope I am not grossly oversimplifying your question but I believe all you really want to know is the variance of your gaps. There are a set of algorithms for calculating variance, each with their own properties and all of which are pretty fast.
精彩评论