Added for-loop to get latents as the mean of manifest variables