Calculates pred