examples with latent variables and documentation