diff --git a/Project.toml b/Project.toml index f51a3f89..23b533c9 100644 --- a/Project.toml +++ b/Project.toml @@ -31,7 +31,7 @@ KernelDensity = "0.6.4" LinearAlgebra = "1.10" OrdinaryDiffEq = "6.62" Parameters = "0.12" -QuasiMonteCarlo = "0.3" +QuasiMonteCarlo = "0.3.0" Random = "1.10" RecursiveArrayTools = "3.2" SafeTestsets = "0.1" diff --git a/docs/src/tutorials/shapley.md b/docs/src/tutorials/shapley.md index d793d10a..d0afa958 100644 --- a/docs/src/tutorials/shapley.md +++ b/docs/src/tutorials/shapley.md @@ -128,8 +128,8 @@ barplot( xticklabelrotation = 1, xticks = (1:54, ["θ$i" for i in 1:54]), ylabel = "Shapley Indices", - limits = (nothing, (0.0, 0.2)), - ), + limits = (nothing, (0.0, 0.2)) + ) ) ``` @@ -160,7 +160,7 @@ barplot( xticklabelrotation = 1, xticks = (1:54, ["θ$i" for i in 1:54]), ylabel = "Shapley Indices", - limits = (nothing, (0.0, 0.2)), - ), + limits = (nothing, (0.0, 0.2)) + ) ) ``` diff --git a/src/shapley_sensitivity.jl b/src/shapley_sensitivity.jl index df1ad2a8..a7a59ba3 100644 --- a/src/shapley_sensitivity.jl +++ b/src/shapley_sensitivity.jl @@ -204,7 +204,8 @@ function gsa(f, method::Shapley, input_distribution::SklarDist; batch = false) Copulas.subsetdims(input_distribution, idx_minus), n_outer) if size(sample_complement, 2) == 1 - sample_complement = reshape(sample_complement, (1, length(sample_complement))) + sample_complement = reshape( + sample_complement, (1, length(sample_complement))) end for l in 1:n_outer diff --git a/src/sobol_sensitivity.jl b/src/sobol_sensitivity.jl index d4ca6b54..f22107b1 100644 --- a/src/sobol_sensitivity.jl +++ b/src/sobol_sensitivity.jl @@ -342,7 +342,8 @@ 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, rng::AbstractRNG = Random.default_rng(), kwargs...) +function gsa(f, method::Sobol, p_range::AbstractVector; samples, + rng::AbstractRNG = Random.default_rng(), kwargs...) log2num = ceil(Int, log2(samples)) samples2n = 2^log2num if samples2n != samples @@ -351,7 +352,8 @@ function gsa(f, method::Sobol, p_range::AbstractVector; samples, rng::AbstractRN end AB = QuasiMonteCarlo.generate_design_matrices(samples, [i[1] for i in p_range], [i[2] for i in p_range], - QuasiMonteCarlo.SobolSample(; R=QuasiMonteCarlo.OwenScramble(; base=2, pad=log2num, rng)), + QuasiMonteCarlo.SobolSample(; + R = QuasiMonteCarlo.OwenScramble(; base = 2, pad = log2num, rng)), 2 * method.nboot) A = reduce(hcat, @view(AB[1:(method.nboot)])) B = reduce(hcat, @view(AB[(method.nboot + 1):end]))