compute histogram mean