# Global Sensitivity Analysis in a subset of model parameters

**URL:** https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666
**Category:** Modelling & Simulations
**Created:** [June 21, 2023, 4:30pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666 "2023-06-21T16:30:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@Nick1](https://discourse.julialang.org/u/Nick1)
#### Post date: [June 21, 2023, 4:30pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666/1 "2023-06-21T16:30:09Z")

</div>

Hi everyone. I was wondering if there is a way to perform Global Sensitivity Analysis in a subset of model parameters, because some of them are physically constant. The most naive approach would be to set the lower and upper bounds for these parameters equal, however in Sobol method, the total number of evaluations for ST and S1 will still be N\*(p+2), where p is the total number of parameters, so even though the parameters that are constant will not contribute to the output (ST=S1=0), the computational cost will be the same.

Also, regarding Morris method, when I set the lower and upper bounds equal I get the following error message:

```julia
BoundsError: attempt to access 0-element Vector{Vector{Float64}} at index [1]

```

Thank you everyone in advance!

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 21, 2023, 5:47pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666/2 "2023-06-21T17:47:29Z")

</div>

Make an outer function that takes the sensitivity functions and appends them:

```julia
function outer_function(p)
  inner_function([p;p_fixed])
end

```

and then running the global sensitivity on `p` with `outer_function`

---

<div class="post-metadata">

### Author: ![Nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@Nick1](https://discourse.julialang.org/u/Nick1)
#### Post date: [June 21, 2023, 6:41pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666/3 "2023-06-21T18:41:42Z")

</div>

Thanks Chris. Regarding the error in Morris method, do you have an idea why it happens?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 21, 2023, 7:16pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666/4 "2023-06-21T19:16:50Z")

</div>

I’d need an MWE.

---

<div class="post-metadata">

### Author: ![Nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@Nick1](https://discourse.julialang.org/u/Nick1)
#### Post date: [July 12, 2023, 4:45pm UTC](https://discourse.julialang.org/t/global-sensitivity-analysis-in-a-subset-of-model-parameters/100666/5 "2023-07-12T16:45:41Z")

</div>

Thanks Chris. I actually resolved the issue by using ComponentArrays.jl
