Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use randomized sobol sampling #167

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion src/sobol_sensitivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,11 @@ function gsa_sobol_all_y_analysis(method, all_y::AbstractArray{T}, d, n, Ei_esti
nboot > 1 ? reshape(ST_CI, size_...) : nothing)
end

function gsa(f, method::Sobol, p_range::AbstractVector; samples, kwargs...)
function gsa(f, method::Sobol, p_range::AbstractVector; samples, rng::AbstractRNG = Random.default_rng(), kwargs...)
AB = QuasiMonteCarlo.generate_design_matrices(samples, [i[1] for i in p_range],
[i[2] for i in p_range],
QuasiMonteCarlo.SobolSample(),
QuasiMonteCarlo.OwenScramble(; base=2, pad=ceil(Int, log2(samples)), rng),
Vaibhavdixit02 marked this conversation as resolved.
Show resolved Hide resolved
2 * method.nboot)
A = reduce(hcat, @view(AB[1:(method.nboot)]))
B = reduce(hcat, @view(AB[(method.nboot + 1):end]))
Expand Down
Loading