First step in merging sample_latent_vars with update_pi_for_node