:
http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
"" "" , , " ".
:
=
. , 1927 . . : , , 95% "" - ? . (.. 5- ), -: 
( , /, .) p̂ - , zα/2 - (1-α/2) , n - . , Ruby:
require 'statistics2'
def ci_lower_bound(pos, n, confidence)
if n == 0
return 0
end
z = Statistics2.pnormaldist(1-(1-confidence)/2)
phat = 1.0*pos/n
(phat + z*z/(2*n) - z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n)
end
pos - , n - : 0.95, 95% , , 0.975 97,5% .. Z- , , , - , z. ( 1.96 0,95.)
, SQL:
SELECT widget_id, ((positive + 1.9208) / (positive + negative) -
1.96 * SQRT((positive * negative) / (positive + negative) + 0.9604) /
(positive + negative)) / (1 + 3.8416 / (positive + negative))
AS ci_lower_bound FROM widgets WHERE positive + negative > 0
ORDER BY ci_lower_bound DESC;