#2925: added expressions for latent variables and allow parameterization of the number of integration steps