# Bayesian inference: Prediction?

**URL:** <https://uqworld.org/t/bayesian-inference-prediction/1831>\
**Category:** Community Q&A and How To\
**Tags:** inversion\
**Created:** [March 19, 2023, 2:28pm UTC](https://uqworld.org/t/bayesian-inference-prediction/1831 "2023-03-19T14:28:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![olaf.klein](https://uqworld.org/user_avatar/uqworld.org/olaf.klein/32/468_2.png) [@olaf.klein](https://uqworld.org/u/olaf.klein)\
**Post date:** [April 12, 2023, 3:01pm UTC](https://uqworld.org/t/bayesian-inference-prediction/1831/4 "2023-04-12T15:01:50Z")

</div>

Dear @Mr121Tony ,

if you are interested in making predictions in a “real case”, you have to generate a `BayesOpts` object as described in Section 3.1 of the manual describing the “real case” and use this as input for `uq_createAnalysis`. Using the `.Results.PostProc.PostSample`-component of the struct resulting from this this function call one can compute predictions, which I prefer to denote as performing forward UQ.

Following the suggestion by Paul-Remo in [https://uqworld.org/t/looking-for-documentation-example-of-using-uqlab-results-of-bayesian-inference-for-forward-uq-or-further-bayesian-inference/690/2?u=olaf.klein](https://uqworld.org/t/looking-for-documentation-example-of-using-uqlab-results-of-bayesian-inference-for-forward-uq-or-further-bayesian-inference/690/2) I extract 2D-arrays containing sample-vectors of  
the values of the different parameters combined with a value for the computed discrepancy. Afterwards I use these sample-vectors to perform Forward UQ  
similar to the method the posterior predictive samples are computed in UQLab:  
for each sample-vector I computed the value for my model for the given set of  
parameter values and afterwards noise was added by computing a noise sample  
for a normal distributed error according to the corresponding discrepancy value to  
get a sample for the posterior predictive density.

Greetings  
Olaf

---

_[View the full topic](https://uqworld.org/t/bayesian-inference-prediction/1831)._
