# Correlation between the PCE coefficients and the indices of the PCE basis

**URL:** <https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514>\
**Category:** UQ Software\
**Tags:** pce, metamodeling\
**Created:** [March 3, 2022, 4:05pm UTC](https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514 "2022-03-03T16:05:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jocelyn.Minini](https://uqworld.org/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@Jocelyn.Minini](https://uqworld.org/u/Jocelyn.Minini)\
**Post date:** [March 3, 2022, 4:05pm UTC](https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514/1 "2022-03-03T16:05:46Z")

</div>

Hi !

I have a not so simple question to ask…

I would like to know how uqlab associates the PCE coefficients with the indices in its basis.

Formulate it differently, I would like if UqLab follows the order that is presented in the book “RISK AND RELIABILITY IN GEOTECHNICAL ENGINEERING”, chapter 6, Tab.6.2, (written by M. Sudret) for the storing of the coefficients.

![image](https://uqworld.org/uploads/default/original/2X/b/b643d9cd96a329f377c18fd245e7eb079511bc9b.png)

I built a polynomial basis on another software and I try to use the coefficients calculated by UqLab and I have difficulties to match the coefficients with the right indices of my basis.

I know that my question is a bit out of the scope of other questions asked on the forum but I hope you can answer me anyway.

Best regards

---

<div class="post-metadata">

**Author:** ![giansteve](https://uqworld.org/user_avatar/uqworld.org/giansteve/32/973_2.png) [@giansteve](https://uqworld.org/u/giansteve)\
**Post date:** [March 4, 2022, 6:30am UTC](https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514/2 "2022-03-04T06:30:34Z")

</div>

Hi @Jocelyn.Minini,

I am just a UQlab user, so I do not know all the coding structure of the toolbox. However, I have been working with PCE and UQlab for a while now, so I try to give you an answer. 🙂

You can check the degree of each univariate polynomial with the command

```matlab
full(<yourPCEstruct>.PCE.Basis.Indices)

```

As an example, you have a PCE computed for a model of dimensionality M=2 (as in the picture you just added). The indices will look like as

```matlab
0 0 % average coefficient
0 1 % x_2
1 0 % x_1
0 2 % x_2^2
2 0 % ...
1 1
0 3
3 0
1 2
2 1
...

```

If you want to recreate the same order of the Table you pasted, a simple permutation will do the job. 😁

---

<div class="post-metadata">

**Author:** ![Jocelyn.Minini](https://uqworld.org/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@Jocelyn.Minini](https://uqworld.org/u/Jocelyn.Minini)\
**Post date:** [March 4, 2022, 7:56am UTC](https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514/3 "2022-03-04T07:56:05Z")

</div>

Hi !

I didn’t know about full(). Really helpfull !

I found an another command in the UQLab lib :

uq\_PCE\_prettyprint\_coefficients(Coefficients, Indices)

Which is exactly what I needed =)

Best regards

---

<div class="post-metadata">

**Author:** ![Aayush\_Aayush](https://uqworld.org/user_avatar/uqworld.org/aayush_aayush/32/1707_2.png) [@Aayush\_Aayush](https://uqworld.org/u/Aayush_Aayush)\
**Post date:** [May 25, 2024, 4:45pm UTC](https://uqworld.org/t/correlation-between-the-pce-coefficients-and-the-indices-of-the-pce-basis/1514/4 "2024-05-25T16:45:12Z")

</div>

Hi , i m working on a problem where we have 3 independent variables and 1 dependent variable on that and i want to fit a curve into that , but the coefficients which it displays even by using the uq\_PCE\_prettyprint\_coefficients don’t make any sense , when the input values are manually inserted into the polynomial. There are some predicted values which the code is giving me using evaluate function , but they are different from the ones which i manually get. Could you help me out.
