# Sobol with UQLink

**URL:** <https://uqworld.org/t/sobol-with-uqlink/299>\
**Category:** Community Q&A and How To\
**Tags:** sensitivity, uqlink\
**Created:** [November 14, 2019, 1:28am UTC](https://uqworld.org/t/sobol-with-uqlink/299 "2019-11-14T01:28:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 14, 2019, 9:08am UTC](https://uqworld.org/t/sobol-with-uqlink/299/2 "2019-11-14T09:08:48Z")

</div>

Hi @Anarionz, welcome to UQWorld!

Are you using a Monte Carlo simulation to estimate the Sobol’ indices? (this is the default)

If you are, then the total number of actual model runs is not the number of samples you specified (that refers to the number of independent MC sample points); it also depends on the number of input parameters. The total number of model runs to estimate the first-order and total Sobol’ indices is N \times (M+2) where N and M are the numbers of MC sample points and input parameters, respectively.

There’s a bit more explanation here on what kind of sample is generated for that estimation:

> [@Redefine the size of the sampling vector obtained by the uq\_getSample function](https://uqworld.org/t/redefine-the-size-of-the-sampling-vector-obtained-by-the-uq-getsample-function/256/3):
>
> Hi @Imfett , welcome to UQWorld! To add to @bsudret’s answer, there is an additional UQLab-related problem with your posted solution. Estimating Sobol’ indices by Monte Carlo (MC) simulation requires a specific set of sample points generated from your input. The scheme to generate this sample is similar to the one illustrated in this [Wikipedia entry.](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis#Calculation_of_indices) In UQLab, you cannot generate your sample in advance and use it compute the Sobol’ indices; that is, your precomputed X and Y cannot be used. A…

BTW, are you monitoring the number of model runs by looking at the files created by UQLink?

Hope this answers your question.

---

_[View the full topic](https://uqworld.org/t/sobol-with-uqlink/299)._
