# Sensitivity analysis for multi outputs, if the output is calculated by simulations

**URL:** <https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322>\
**Category:** Community Q&A and How To\
**Created:** [December 3, 2019, 9:55pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322 "2019-12-03T21:55:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gull\_Rana](https://uqworld.org/user_avatar/uqworld.org/gull_rana/32/337_2.png) [@Gull\_Rana](https://uqworld.org/u/Gull_Rana)\
**Post date:** [December 3, 2019, 9:55pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/1 "2019-12-03T21:55:31Z")

</div>

Hi,  
I am very new to UQlab, I installed it and try to apply the sensitivity analysis for multi outputs, I am using polynomial regression as a model since my outputs are in table form. I am trying to apply for my problem same by following the given example for multi outputs but all in vain. Can anyone of you give me an idea that how to use UQlab for non analytical functions.

---

<div class="post-metadata">

**Author:** ![paulremo](https://uqworld.org/user_avatar/uqworld.org/paulremo/32/192_2.png) [@paulremo](https://uqworld.org/u/paulremo)\
**Post date:** [December 4, 2019, 10:59am UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/2 "2019-12-04T10:59:29Z")

</div>

Hi Gull Rana and welcome to UQWorld 😃

It is not clear to me what you are trying to do. Could you possibly share a bit more information to make your problem easier to reproduce? For example:

- What sensitivity analysis are trying to conduct?
- What do you mean by:

> [@Gull\_Rana](#):
>
> I am using polynomial regression as a model since my outputs are in table form.

Could you possibly also share a _minimal working example_? This would make it much easier to help!

---

<div class="post-metadata">

**Author:** ![Gull\_Rana](https://uqworld.org/user_avatar/uqworld.org/gull_rana/32/337_2.png) [@Gull\_Rana](https://uqworld.org/u/Gull_Rana)\
**Post date:** [December 5, 2019, 3:36pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/4 "2019-12-05T15:36:15Z")

</div>

thank you for a quick response, Basically I have a data of sample size 1080. Five independent variables and the solutions are simulated through a finite element based software. So I have 1080 by 5 (input data), for each input sample I have 32 outputs, i-e (1080 by 32) output data. I want to apply sobol senstivity analysis for my problem. Since I don’t have any handle function to compute outputs, that’s why I generated regression model by using the above data and tried to use it as UQ model in the example of multi output. I hope you understand my question. I am confused that how to call the model and use the Uqanalyse for the sample size.

---

<div class="post-metadata">

**Author:** ![paulremo](https://uqworld.org/user_avatar/uqworld.org/paulremo/32/192_2.png) [@paulremo](https://uqworld.org/u/paulremo)\
**Post date:** [December 5, 2019, 5:09pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/5 "2019-12-05T17:09:07Z")

</div>

Hi - to help you I need a bit more information:

- What sensitivity analysis are you trying to conduct (Sample-based, linearization or global)? You can have a look at the [manual](https://www.uqlab.com/sensitivity-user-manual) to clarify.
- Do you have access to the computational model in `Matlab` or do you just have an input/output sample?
- Do you know the distribution of your input (i.e. Gaussian, Uniform, etc.)?

Let me know!

---

<div class="post-metadata">

**Author:** ![Gull\_Rana](https://uqworld.org/user_avatar/uqworld.org/gull_rana/32/337_2.png) [@Gull\_Rana](https://uqworld.org/u/Gull_Rana)\
**Post date:** [December 5, 2019, 5:31pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/6 "2019-12-05T17:31:42Z")

</div>

hi,

1. I am looking for global sensitivity for my input parameters ( 5 parameters)
2. I only have data (set of inputs and corresponding outputs)
3. Distribution of my inputs is uniform (sobol sampling)

---

<div class="post-metadata">

**Author:** ![paulremo](https://uqworld.org/user_avatar/uqworld.org/paulremo/32/192_2.png) [@paulremo](https://uqworld.org/u/paulremo)\
**Post date:** [December 6, 2019, 8:37am UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/7 "2019-12-06T08:37:03Z")

</div>

Thanks! So in this case I recommend you do a Sobol’ sensitivity analysis based on a PCE surrogate model. You will need to do three things:

1. Define your input distribution as a `uq_input` object ([manual](https://www.uqlab.com/input-user-manual))
2. Use this distribution and your available experimental design `X` and corresponding model evaluations `Y` to construct a PCE ([manual](https://www.uqlab.com/pce-user-manual)). You can also have a look at example `uq_Example_PCE_04_MultipleOutputs` to see how this can be done in your case with an existing experimental design (_i.e._, `MetaOpts.ExpDesign.Sampling = 'User'`)
3. Utilize this PCE to compute the Sobol’ indices as detailed in `uq_Example_Sensitivity_02_SobolIndices` Section 4.2

I hope this helps 😃 - let me know if something is not clear.

---

<div class="post-metadata">

**Author:** ![damarginal](https://uqworld.org/user_avatar/uqworld.org/damarginal/32/73_2.png) [@damarginal](https://uqworld.org/u/damarginal)\
**Post date:** [December 9, 2019, 3:29pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/8 "2019-12-09T15:29:54Z")

</div>

Hi @Gull_Rana,

Hopefully, you can solve your problem with the answers above and the one provided by @bsudret below

> [@Computing Sobol sensitivity indices using existing input/output data](https://uqworld.org/t/computing-sobol-sensitivity-indices-using-existing-input-output-data/327/2):
>
> Dear Gullnaz You have to construct a surrogate model of your finite element model from your runs first. In order to do sensitivity analysis afterwards, a good choice is to use polynomial chaos expansions (PCE). The [Polynomial chaos expansion from existing data](https://www.uqlab.com/pce-truss-data-set) example is a good starting point. Polynomial chaos expansion Following this example, you start by defining the distribution of the input parameters of the FE model (the distributions you used to sample the inputs). If you did this step w…

If you still run into problem, be sure to post a reproducible example of your problem up to the point things don’t work. If you need to attach some data, you can also do it here given it’s not too large (\<3MB).

---

<div class="post-metadata">

**Author:** ![Gull\_Rana](https://uqworld.org/user_avatar/uqworld.org/gull_rana/32/337_2.png) [@Gull\_Rana](https://uqworld.org/u/Gull_Rana)\
**Post date:** [December 9, 2019, 4:04pm UTC](https://uqworld.org/t/sensitivity-analysis-for-multi-outputs-if-the-output-is-calculated-by-simulations/322/9 "2019-12-09T16:04:00Z")

</div>

Hi Damarginal,  
Yes, the aforementioned suggestions for my problem are very helpful for me. Thanks to all of you who guided me properly.
