Method and system for controlling cylinder to cylinder variations of undesirable emissions in exhaust gas of engines with exhaust gas recirculation. An engine model is used to predict the intake composition of the next cylinder firing based on the composition of the exhaust, as a function of time and applicable engine conditions. At least one engine parameter is adjusted to compensate for the predicted intake composition in order to minimize cylinder to cylinder variations.