# Beam problem:PCE surrogate model based calibration, how to give reasonable predictive posterior on multiple points?

**URL:** <https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960>\
**Category:** Community Q&A and How To\
**Tags:** pce, inversion, metamodeling\
**Created:** [August 3, 2023, 3:53pm UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960 "2023-08-03T15:53:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ny123](https://uqworld.org/letter_avatar_proxy/v4/letter/n/8baadc/32.png) [@ny123](https://uqworld.org/u/ny123)\
**Post date:** [August 3, 2023, 3:53pm UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960/1 "2023-08-03T15:53:26Z")

</div>

Hi! Everyone. I am doing a classic simply-support-beam question.

![image](https://uqworld.org/uploads/default/original/2X/1/18290544fd5f5fb91521f5b0f29c2585ca9f04a4.png)

The input variables are Elastic modulus E and loading position \delta. I need to create my PCE surrogate model and doing Bayesian inference based on the 29 monitored data points along the beam.

This is my procedure:  
Step 1: Refer to [PCE - Calculation strategies | Examples | UQLab](https://www.uqlab.com/pce-calculation-strategies), create my PCE  
Step 2: [Bayesian inversion - MAP estimation | Examples | UQLab](https://www.uqlab.com/inversion-surrogate), doing my Bayesian inference to get E and \delta

The code works well and it converges very well for the simple beam problem. But I have a question for the result I get.

![image](https://uqworld.org/uploads/default/original/2X/0/079f026125e7fcb0504ba1e744d6ef1ca49da111.png)  
(please ignore the big range of predictive distribution. It should be very small. I make it very large on purpose to make it obvious)

Anyway, in the PCE that I create, based on the 29 output points along the beam, I get a 29 independent sub-PCE model in the PCE model, right? Because it mentioned “_UQLAB performs an independent PCE for each output component on the shared experimental design_” in the [UQLab - Polynomial chaos expansions (PCE) user manuals](https://www.uqlab.com/pce-user-manual).

So, my question is : Since the 29 sub-PCE (though combined in one PCE structure) for each point along the beam is independent, how can we make reasonable predictive posterior? for example, as shown the red line in the picture, it is reasonable in probabilistic theory but unrealistic in life. Or in another way, can we consider the relationship between 29 sub-PCEs ? or how we avoid this unrealistic predictive outcome?

 ![image](https://uqworld.org/uploads/default/original/2X/2/2ed9444ea2b730ab5418071ec9c1ef8e2a06819c.jpeg)

I personally think the problem comes from the fact "every PCE model is independent ", they each have no connections. Can someone help me this question? thanks in advance!!!  
code is attached  
[PCE\_multiple.zip](https://uqworld.org/uploads/short-url/80v4Ksrpn8VO7A3y6BU9wsfKyU7.zip) (265.8 KB)

---

<div class="post-metadata">

**Author:** ![bsudret](https://uqworld.org/user_avatar/uqworld.org/bsudret/32/224_2.png) [@bsudret](https://uqworld.org/u/bsudret)\
**Post date:** [August 21, 2023, 12:02pm UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960/2 "2023-08-21T12:02:56Z")

</div>

Dear @ny123

Thanks for your question. This is very relevant, but there is some misunderstanding in the way PCEs are constructed and used in the Bayesian framework.

When the manual says “every PCE is built independently”, it simply means that the input data \mathcal{X} and the output \mathcal{Y}\_i is used separately for each output i (in other words, there is a loop on the components of the output for the construction). However, from the physics, the output samples (\mathcal{Y}\_i, \mathcal{Y}\_j) are correlated (even strongly correlated if you look at two neighbor points). The resulting PCEs will show the same correlation. In fact, the covariance between two PCE outputs can be computed analytically. If:

Y\_i = \sum\_{\alpha \in \mathcal{A}} a\_{\alpha} \, \Psi\_{\alpha}(\mathbf{x}) \quad ; \quad Y\_j = \sum\_{\alpha \in \mathcal{A}} b\_{\alpha} \, \Psi\_{\alpha}(\mathbf{x})

then the covariance read:

\text{Cov}\left[{Y\_i, Y\_j}\right] = \sum\_{\alpha \in \mathcal{A} \backslash 0} a\_{\alpha}b\_{\alpha}

and their linear correlation coefficient is obtained by normalizing with their respective variances. As a conclusion, “built independently” does not mean that the resulting PCEs are statistically independent.

**Now** , if we come back to the Bayesian inversion problem, you should pay attention to two points:

- the _discrepancy model_ between model prediction and measurement data: it could be set independent for the 29 measurement points, but it could also be a joint Gaussian vector with nondiagonal covariance matrix.  
If this discrepancy only represents _measurement error_ (typically, very small), then it makes sense that the sensors are independent. If, however, it also represents a systematic model error (maybe not relevant for your example here, but rather common in realistic applications), then typically a correlation structure of the mismatch should be assumed and fitted altogether within the Bayesian inversion [1,2].
- This possibly correlated Gaussian mismatch model should be properly propagated when you sample the predictive distributions.

Also note that the _posterior_ distributions of the X’s are often correlated, which has to be taken into account when sampling the predictive distributions of the Y’s.

I hope it clarifies your problem! Best regards

Bruno

**References**  
[1] Wagner, P.-R., Fahrni, R., Klippel, M., Frangi, A., Sudret, B., 2020. [Bayesian calibration and sensitivity analysis of heat transfer models for fire insulation panels](https://doi.org/10.1016/j.engstruct.2019.110063). Engineering Structures 205.  
[2] Wagner, P. R., 2021. [Stochastic spectral embedding in forward and inverse uncertainty quantification](https://doi.org/10.3929/ethz-b-000513631), PhD thesis, ETH Zurich.

---

<div class="post-metadata">

**Author:** ![ste](https://uqworld.org/user_avatar/uqworld.org/ste/32/122_2.png) [@ste](https://uqworld.org/u/ste)\
**Post date:** [August 24, 2023, 11:41am UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960/3 "2023-08-24T11:41:04Z")

</div>

Hi @ny123 and @bsudret, some more discussion on the roles of modelling error from PCE in the context of Bayesian inversion and high dimensional output models, you can have a look at: [Bayesian tomography with prior-knowledge-based parametrization and surrogate modelling | Geophysical Journal International | Oxford Academic](https://doi.org/10.1093/gji/ggac214)

Cheers,  
Stefano

---

<div class="post-metadata">

**Author:** ![ny123](https://uqworld.org/letter_avatar_proxy/v4/letter/n/8baadc/32.png) [@ny123](https://uqworld.org/u/ny123)\
**Post date:** [September 23, 2023, 9:17pm UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960/4 "2023-09-23T21:17:09Z")

</div>

Dear @bsudret ,

Thanks very much for your detailed explanations for PCE constructions and how it works in the Bayesian inference. And I think your answer totally solved my misunderstandings for the PCE covariance.

As you said, “the output samples (\mathcal{Y}\_i, \mathcal{Y}\_j) are correlated and the covariance can be computed analytically”, it is true and I compared with the FE output covariance and PCE output covariance.  
With more and more realizations, the covariances becomes more and more similar and finally identical.

 ![5](https://uqworld.org/uploads/default/original/2X/3/3a39104f78a672d58d58cd83fc54c8fc410cf2a1.jpeg)  
 ![50](https://uqworld.org/uploads/default/original/2X/1/1aae49884ef3d67052db4812622ee68bb0ff3c78.jpeg)  
 ![500](https://uqworld.org/uploads/default/original/2X/d/d34f046bf7752a98861a2afcc977608259b3a22d.jpeg)

And also, your suggestions on the Bayesian inference are very helpful and I have read Wagner’s paper you recommended. Those are very helpful and good references to PCA-PCE models. I will deal with the discrepancy model covariance (non-diagonal) carefully in the bayesian inversion.

Best,  
ningxin

---

<div class="post-metadata">

**Author:** ![ny123](https://uqworld.org/letter_avatar_proxy/v4/letter/n/8baadc/32.png) [@ny123](https://uqworld.org/u/ny123)\
**Post date:** [September 23, 2023, 9:32pm UTC](https://uqworld.org/t/beam-problem-pce-surrogate-model-based-calibration-how-to-give-reasonable-predictive-posterior-on-multiple-points/1960/5 "2023-09-23T21:32:06Z")

</div>

Dear @ste ,

Thanks for recommending this paper and this is a very good implementation for the high dimension surrogating problem. It seems in this paper that the covariance matrix for the modelling error can be handled in a relative smooth way. Thanks for your paper. I will read it very carefully and I think it will give me a lot of help!

Best  
ningxin
