Discretization of measures: an IRT approach