def sample_posterior_predictive(rng_key, model, model_args, guide, guide_args, params, with_intermediates=False, **kwargs):
    ' Samples once from the posterior predictive distribution.\n\n    Note that if the model function is written in such a way that it returns, e.g.,\n    multiple observations from a single posterior draw, the same is true for the\n    values returned by this function.\n\n    :param rng_key: Jax PRNG key\n    :param model: Function representing the model using numpyro distributions\n        and the `sample` primitive\n    :param model_args: Arguments to the model function\n    :param guide: Function representing the variational distribution (the guide)\n        using numpyro distributions as well as the `sample` and `param` primitives\n    :param guide_args: Arguments to the guide function\n    :param params: A dictionary providing values for the parameters\n        designated by call to `param` in the guide\n    :param with_intermediates: If True, intermediate(/latent) samples from\n        sample site distributions are included in the result.\n    :param **kwargs: Keyword arguments passed to the model and guide functions.\n    :return: Dictionary of sampled values associated with the names given\n        via `sample()` in the model. If with_intermediates is True,\n        dictionary values are tuples where the first element is the final\n        sample values and the second element is a list of intermediate values.\n    '
    (model_rng_key, guide_rng_key) = jax.random.split(rng_key)
    guide = seed(substitute(guide, data=params), guide_rng_key)
    guide_samples = get_samples_from_trace(trace(guide).get_trace(*guide_args, **kwargs), with_intermediates)
    model_params = dict(**params)
    if with_intermediates:
        model_params.update({k: v[0] for (k, v) in guide_samples.items()})
    else:
        model_params.update({k: v for (k, v) in guide_samples.items()})
    model = seed(substitute(model, data=model_params), model_rng_key)
    model_samples = get_samples_from_trace(trace(model).get_trace(*model_args, **kwargs), with_intermediates)
    guide_samples.update(model_samples)
    return guide_samples
Samples once from the posterior predictive distribution.

Note that if the model function is written in such a way that it returns, e.g.,
multiple observations from a single posterior draw, the same is true for the
values returned by this function.

:param rng_key: Jax PRNG key
:param model: Function representing the model using numpyro distributions
    and the `sample` primitive
:param model_args: Arguments to the model function
:param guide: Function representing the variational distribution (the guide)
    using numpyro distributions as well as the `sample` and `param` primitives
:param guide_args: Arguments to the guide function
:param params: A dictionary providing values for the parameters
    designated by call to `param` in the guide
:param with_intermediates: If True, intermediate(/latent) samples from
    sample site distributions are included in the result.
:param **kwargs: Keyword arguments passed to the model and guide functions.
:return: Dictionary of sampled values associated with the names given
    via `sample()` in the model. If with_intermediates is True,
    dictionary values are tuples where the first element is the final
    sample values and the second element is a list of intermediate values.
def sample_posterior_predictive(rng_key, model, model_args, guide, guide_args, params, with_intermediates=False, **kwargs):
    ' Samples once from the posterior predictive distribution.\n\n    Note that if the model function is written in such a way that it returns, e.g.,\n    multiple observations from a single posterior draw, the same is true for the\n    values returned by this function.\n\n    :param rng_key: Jax PRNG key\n    :param model: Function representing the model using numpyro distributions\n        and the `sample` primitive\n    :param model_args: Arguments to the model function\n    :param guide: Function representing the variational distribution (the guide)\n        using numpyro distributions as well as the `sample` and `param` primitives\n    :param guide_args: Arguments to the guide function\n    :param params: A dictionary providing values for the parameters\n        designated by call to `param` in the guide\n    :param with_intermediates: If True, intermediate(/latent) samples from\n        sample site distributions are included in the result.\n    :param **kwargs: Keyword arguments passed to the model and guide functions.\n    :return: Dictionary of sampled values associated with the names given\n        via `sample()` in the model. If with_intermediates is True,\n        dictionary values are tuples where the first element is the final\n        sample values and the second element is a list of intermediate values.\n    '
    (model_rng_key, guide_rng_key) = jax.random.split(rng_key)
    guide = seed(substitute(guide, data=params), guide_rng_key)
    guide_samples = get_samples_from_trace(trace(guide).get_trace(*guide_args, **kwargs), with_intermediates)
    model_params = dict(**params)
    if with_intermediates:
        model_params.update({k: v[0] for (k, v) in guide_samples.items()})
    else:
        model_params.update({k: v for (k, v) in guide_samples.items()})
    model = seed(substitute(model, data=model_params), model_rng_key)
    model_samples = get_samples_from_trace(trace(model).get_trace(*model_args, **kwargs), with_intermediates)
    guide_samples.update(model_samples)
    return guide_samples