Error rate estimation on the basis of posterior probabilities