calculating prediction