I cannot figure out how to set an estimated maximum price for a collection of records.
What I want to avoid is to simply use SQL MAX, because maybe there are records with exorbitant prices.
For example, in the “computers-hardware” category of OLX (http://www.olx.com/computers-hardware-cat-240) the filter for maximum price is estimately set to $1400, but sorting by price, the first items are above $10000
Maybe they calculated the average and then estimated some maximum price… what do you think?
If you assumed normal (gaussian) distribution on the prices you could estimate the maximum using this formula
If the distribiution is indeed gaussian about 95% of the samples should be contained within [avg – 3*stddev ; avg + 3*stddev]