We present a methodology for estimating up-jump and down-jump intensities in a continuous-time portfolio credit rating migration model. These intensities are interpreted as systematic factors and can be correlated with economic variables to perform portfolio stress testing. Our approach involves constructing an inhomogeneous Markov chain from a sequence of piecewise homogeneous chains. Factors are then extracted using an estimator for discretely observed, continuous Markov chains. Our methodology lends itself well to practical applications; in particular, it is flexible and computationally fast and can accommodate features observed in practice, such as heterogeneity in observation intervals and missing data.The model is tested against synthetic data and fitted to a portfolio of Standard&Poor's rated corporates.