Analyzing the effect of business cycle on rating transitions has been a subject of great interest these last 15 years, particularly due to the increasing pressure coming from regulators for stress testing. In this paper, we consider that the dynamics of rating migrations, in a pool of credit references, is governed by a common unobserved latent Markov chain. We explain how the current state of the hidden factor, can be efficiently inferred from observations of rating histories. We then adapt the classical Baum–Welch algorithm to our setting and show how to estimate the latent factor parameters. Once calibrated, we may reveal and detect economic changes affecting the dynamics of rating migration, in real time. The filtering formula is then used to predict future transition probabilities according to the economic cycle without using any external covariates. We propose two filtering frameworks: a discrete and a continuous version. We demonstrate and compare the efficiency of both approaches on fictive data and on a corporate credit rating database. The methods could also be applied to retail credit loans. Finally, under a point process filtering framework, we extend the standard discrete-time filtering formula to a more general setting, where the hidden process does not need to be a Markov chain.