State Space Methods for Latent Trajectory and Parameter Estimation by Maximum Likelihood