Bayesian Inference on Dynamic Models with Latent Factors