# Bootstrap in Global Sensitivity Analysis (GSA)

Hi There,

Running the basic example below the bootstrapping just returns

``````nothing
``````

So no standard errors are returned at all. Playing with sobolsensitivity.jl package if I go in and hard code nboot I can return bootstrapped runs it appears the nboot keyword is not recognised in the package. I have tried my best at having a crack at this but I think I have become stuck in how to fix this.

I am sorry I could not help more, MWE is down below

Cheers,
Harry

``````using GlobalSensitivity, Statistics, OrdinaryDiffEq, QuasiMonteCarlo, Plots

function f(du,u,p,t)
du[1] = p[1]*u[1] - p[2]*u[1]*u[2] #prey
du[2] = -p[3]*u[2] + p[4]*u[1]*u[2] #predator
end

u0 = [1.0;1.0]
tspan = (0.0,10.0)
p = [1.5,1.0,3.0,1.0]
prob = ODEProblem(f,u0,tspan,p)
t = collect(range(0, stop=10, length=200))

f1 = function (p)
prob1 = remake(prob;p=p)
sol = solve(prob1,Tsit5();saveat=t)
[mean(sol[1,:]), maximum(sol[2,:])]
end

samples = 10000
lb = [1.0, 1.0, 1.0, 1.0]
ub = [5.0, 5.0, 5.0, 5.0]
sampler = SobolSample()
A,B = QuasiMonteCarlo.generate_design_matrices(samples,lb,ub,sampler)

sobol_result = gsa(f1,Sobol(),A,B, nboot = 1000)

sobol_result.S1
sobol_result.S1_Conf_Int
``````

`gsa` for `Sobol` (also) uses `nboot` set via `Sobol(...)` and the reason you get `nothing` is that the default of `Sobol`’s `nboot` is equal to `1`. You can still set a `nboot` for `gsa` which is independent of the `nboot` passed to `Sobol` constructor. However, if you only pass `nboot` via `Sobol`, then the `gsa`’s `nboot` will be set to the same value. I hope this makes sense to you.

Try alter the relevant line in the following way:

``````# your previous code here

# please note `nboot` keyword in `Sobol` constructor
sobol_result = gsa(f1, Sobol(nboot=1000), A, B)

# you'll get a Matrix{Float64} here
sobol_result.S1_Conf_Int
``````

Have fun.