# Module: tf.contrib.bayesflow.monte_carlo

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/bayesflow/python/ops/monte_carlo.py) |

Monte Carlo integration and helpers.

Use [tfp.monte_carlo](https://www.tensorflow.org/probability/api_docs/python/tfp/monte_carlo) instead.

## Functions

[`expectation(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/bayesflow/monte_carlo/expectation): Computes the Monte-Carlo approximation of \\(E_p\[f(X)\]\\). (deprecated)

[`expectation_importance_sampler(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/bayesflow/monte_carlo/expectation_importance_sampler): Monte Carlo estimate of \\(E_p\[f(Z)\] = E_q\[f(Z) p(Z) / q(Z)\]\\).

[`expectation_importance_sampler_logspace(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib/bayesflow/monte_carlo/expectation_importance_sampler_logspace): Importance sampling with a positive function, in log-space.