From 64707dd31d0c4d8b52b2d7fe019820d812e5d04b Mon Sep 17 00:00:00 2001 From: lrennels Date: Wed, 23 Oct 2019 21:51:17 -1000 Subject: [PATCH 1/9] Add args to sobol analyze --- src/mcs/sobol.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mcs/sobol.jl b/src/mcs/sobol.jl index f722f3569..dab31108c 100644 --- a/src/mcs/sobol.jl +++ b/src/mcs/sobol.jl @@ -50,14 +50,15 @@ function sample!(sim_inst::SobolSimulationInstance, samplesize::Int) end end -function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}) where N +function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 100, conf_level::Number = 0.95) where N if sim_inst.trials == 0 error("Cannot analyze simulation with 0 trials.") end payload = create_GSA_payload(sim_inst) - return GlobalSensitivityAnalysis.analyze(payload, model_output) + + return GlobalSensitivityAnalysis.analyze(payload, model_output; num_resamples = num_resamples, conf_level = conf_level) end function create_GSA_payload(sim_inst::SobolSimulationInstance) From 33a23908211171fa4d5434141f64185ae945dd06 Mon Sep 17 00:00:00 2001 From: lrennels Date: Mon, 4 Nov 2019 18:47:53 -0800 Subject: [PATCH 2/9] Change default CI num_resamples --- src/mcs/sobol.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcs/sobol.jl b/src/mcs/sobol.jl index dab31108c..684df2e00 100644 --- a/src/mcs/sobol.jl +++ b/src/mcs/sobol.jl @@ -50,7 +50,7 @@ function sample!(sim_inst::SobolSimulationInstance, samplesize::Int) end end -function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 100, conf_level::Number = 0.95) where N +function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 10_000, conf_level::Number = 0.95) where N if sim_inst.trials == 0 error("Cannot analyze simulation with 0 trials.") From 656a968afaee9018207da6ea03288407c485a19b Mon Sep 17 00:00:00 2001 From: lrennels Date: Mon, 4 Nov 2019 19:05:42 -0800 Subject: [PATCH 3/9] Add kwargs to Sobol CI --- test/mcs/test_defmcs_sobol.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mcs/test_defmcs_sobol.jl b/test/mcs/test_defmcs_sobol.jl index a76355caf..1267f371a 100644 --- a/test/mcs/test_defmcs_sobol.jl +++ b/test/mcs/test_defmcs_sobol.jl @@ -68,7 +68,7 @@ results_disk[!,2] = Symbol.(results_disk[!,2]) # do some analysis E = CSVFiles.load(joinpath(output_dir, "emissions_E.csv")) |> DataFrame -results = analyze(si, E[1:60:end, 3]) +results = analyze(si, E[1:60:end, 3]; num_resamples = 10_000, conf_level = 0.95) function show_E_Region(year::Int; region = "Region1", bins=40) df = @from i in E begin From 2390480fc47c09d5d7e626a48a790052ea6a4204 Mon Sep 17 00:00:00 2001 From: Lisa Rennels <31779240+lrennels@users.noreply.github.com> Date: Mon, 2 Mar 2020 12:21:22 -0800 Subject: [PATCH 4/9] Update type specs for analyze function --- src/mcs/sobol.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcs/sobol.jl b/src/mcs/sobol.jl index 684df2e00..2d7982712 100644 --- a/src/mcs/sobol.jl +++ b/src/mcs/sobol.jl @@ -50,7 +50,7 @@ function sample!(sim_inst::SobolSimulationInstance, samplesize::Int) end end -function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 10_000, conf_level::Number = 0.95) where N +function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Union{Nothing, Int} = 10_000, conf_level::Union{Number, Nothing} = 0.95) where N if sim_inst.trials == 0 error("Cannot analyze simulation with 0 trials.") From 9ad3b5dfd8d9d733eaafb41a7234044d2261509c Mon Sep 17 00:00:00 2001 From: Lisa Rennels <31779240+lrennels@users.noreply.github.com> Date: Mon, 2 Mar 2020 12:33:31 -0800 Subject: [PATCH 5/9] Remove Nothing option for ci --- src/mcs/sobol.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcs/sobol.jl b/src/mcs/sobol.jl index 2d7982712..684df2e00 100644 --- a/src/mcs/sobol.jl +++ b/src/mcs/sobol.jl @@ -50,7 +50,7 @@ function sample!(sim_inst::SobolSimulationInstance, samplesize::Int) end end -function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Union{Nothing, Int} = 10_000, conf_level::Union{Number, Nothing} = 0.95) where N +function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 10_000, conf_level::Number = 0.95) where N if sim_inst.trials == 0 error("Cannot analyze simulation with 0 trials.") From e46943a72ff84a81ff2a4a9f1436df30cf648c42 Mon Sep 17 00:00:00 2001 From: lrennels Date: Mon, 2 Mar 2020 14:44:08 -0800 Subject: [PATCH 6/9] Update GlobalSensitivityAnalysis compat entry --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5004449b9..68fe1ac77 100644 --- a/Project.toml +++ b/Project.toml @@ -45,7 +45,7 @@ Distributions = "0.21, 0.22" Electron = "1.1, 2.0" FileIO = "1" FilePaths = "0.8" -GlobalSensitivityAnalysis = "0.0.6" +GlobalSensitivityAnalysis = "0.0.7" GraphPlot = "0.3, 0.4" IterTools = "1.3" IteratorInterfaceExtensions = "0.1.1, 1" From 2eb7690e8660fcd230ebc4680ff3332543844e84 Mon Sep 17 00:00:00 2001 From: lrennels Date: Mon, 2 Mar 2020 15:08:26 -0800 Subject: [PATCH 7/9] Add nothing option for ci; update compat --- Project.toml | 2 +- src/mcs/sobol.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 68fe1ac77..a52032732 100644 --- a/Project.toml +++ b/Project.toml @@ -45,7 +45,7 @@ Distributions = "0.21, 0.22" Electron = "1.1, 2.0" FileIO = "1" FilePaths = "0.8" -GlobalSensitivityAnalysis = "0.0.7" +GlobalSensitivityAnalysis = "0.0.8" GraphPlot = "0.3, 0.4" IterTools = "1.3" IteratorInterfaceExtensions = "0.1.1, 1" diff --git a/src/mcs/sobol.jl b/src/mcs/sobol.jl index 684df2e00..e0664cd84 100644 --- a/src/mcs/sobol.jl +++ b/src/mcs/sobol.jl @@ -50,7 +50,7 @@ function sample!(sim_inst::SobolSimulationInstance, samplesize::Int) end end -function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Int = 10_000, conf_level::Number = 0.95) where N +function analyze(sim_inst::SobolSimulationInstance, model_output::AbstractArray{<:Number, N}; num_resamples::Union{Nothing, Int} = 10_000, conf_level::Union{Nothing, Number} = 0.95) where N if sim_inst.trials == 0 error("Cannot analyze simulation with 0 trials.") From a73e1574053012ca92da4dc7aeed312eefe2ec98 Mon Sep 17 00:00:00 2001 From: Lisa Rennels <31779240+lrennels@users.noreply.github.com> Date: Mon, 2 Mar 2020 22:55:49 -0800 Subject: [PATCH 8/9] Update GlobalSensitivityAnalysis compat version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a52032732..b4856d56b 100644 --- a/Project.toml +++ b/Project.toml @@ -45,7 +45,7 @@ Distributions = "0.21, 0.22" Electron = "1.1, 2.0" FileIO = "1" FilePaths = "0.8" -GlobalSensitivityAnalysis = "0.0.8" +GlobalSensitivityAnalysis = "0.0.9" GraphPlot = "0.3, 0.4" IterTools = "1.3" IteratorInterfaceExtensions = "0.1.1, 1" From b5dc0c3aab7969f25d7f4c098b57fd64b968f66d Mon Sep 17 00:00:00 2001 From: Lisa Rennels <31779240+lrennels@users.noreply.github.com> Date: Mon, 23 Mar 2020 15:32:41 -0700 Subject: [PATCH 9/9] Update GlobalSensitivityAnalysis version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 44591d813..65924a862 100644 --- a/Project.toml +++ b/Project.toml @@ -45,7 +45,7 @@ Distributions = "0.21, 0.22, 0.23" Electron = "1.1, 2.0" FileIO = "1" FilePaths = "0.8" -GlobalSensitivityAnalysis = "0.0.8" +GlobalSensitivityAnalysis = "0.0.9" GraphPlot = "0.3, 0.4" IterTools = "1.3" IteratorInterfaceExtensions = "0.1.1, 1"