Real-time calculation of egr rate and intake charge oxygen concentration for misfire detection in diesel engines