forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-create tests from VPP Statistics using ReporterStatistics
(refs idaholab#16584)
- Loading branch information
1 parent
8da09ac
commit 5edb540
Showing
31 changed files
with
855 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/bca.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[StochasticTools] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
# Table 14.1 in Efron and Tibshirani, 1993 | ||
[A] | ||
type = ConstantVectorPostprocessor | ||
value = '48 36 20 29 42 42 20 42 22 41 45 14 6 0 33 28 34 4 32 24 47 41 24 26 30 41' | ||
outputs = none | ||
[] | ||
[B] | ||
type = ConstantVectorPostprocessor | ||
value = '42 33 16 39 38 36 15 33 20 43 34 22 7 15 34 29 41 13 38 25 27 41 28 14 28 40' | ||
outputs = none | ||
[] | ||
[] | ||
|
||
[Reporters] | ||
# Reproduce Table 13.1 in Efron and Tibshirani, 1993 | ||
[stats] | ||
type = StatisticsReporter | ||
vectorpostprocessors = 'A B' | ||
compute = 'mean' | ||
ci_method = 'bca' | ||
ci_levels = '0.025 0.05 0.1 0.16 0.5 0.84 0.9 0.95 0.975' | ||
ci_replicates = 1000 | ||
ci_seed = 1980 | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
execute_on = FINAL | ||
[out] | ||
type = JSON | ||
execute_system_information_on = NONE | ||
[] | ||
[] |
29 changes: 29 additions & 0 deletions
29
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/bca_distributed.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[StochasticTools] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[data] | ||
type = TestDistributedVectorPostprocessor | ||
parallel_type = distributed | ||
outputs = none | ||
[] | ||
[] | ||
|
||
[Reporters] | ||
[stats] | ||
type = StatisticsReporter | ||
vectorpostprocessors = 'data' | ||
compute = 'mean' | ||
ci_method = 'bca' | ||
ci_levels = '0.025 0.05 0.1 0.16 0.5 0.84 0.9 0.95 0.99' | ||
ci_replicates = 10 | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
execute_on = FINAL | ||
[out] | ||
type = JSON | ||
execute_system_information_on = NONE | ||
[] | ||
[] |
53 changes: 53 additions & 0 deletions
53
...chastic_tools/test/tests/reporters/bootstrap_statistics/bca/gold/bca_distributed_out.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"time_steps": [ | ||
{ | ||
"reporters": { | ||
"stats": { | ||
"info": { | ||
"confidence_intervals": { | ||
"levels": [ | ||
0.025, | ||
0.05, | ||
0.1, | ||
0.16, | ||
0.5, | ||
0.84, | ||
0.9, | ||
0.95, | ||
0.99 | ||
], | ||
"method": "bca", | ||
"replicates": 10, | ||
"seed": 1 | ||
}, | ||
"name": "stats", | ||
"type": "StatisticsReporter" | ||
}, | ||
"values": [ | ||
{ | ||
"name": "data_data_MEAN", | ||
"stat": "MEAN", | ||
"type": "std::pair<double, std::vector<double> >", | ||
"value": [ | ||
204.5, | ||
[ | ||
180.5, | ||
180.5, | ||
180.5, | ||
180.5, | ||
195.0, | ||
214.53333333333333, | ||
217.83333333333334, | ||
218.9, | ||
221.13333333333333 | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"time": 2.0, | ||
"time_step": 2 | ||
} | ||
] | ||
} |
72 changes: 72 additions & 0 deletions
72
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/gold/bca_out.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"time_steps": [ | ||
{ | ||
"reporters": { | ||
"stats": { | ||
"info": { | ||
"confidence_intervals": { | ||
"levels": [ | ||
0.025, | ||
0.05, | ||
0.1, | ||
0.16, | ||
0.5, | ||
0.84, | ||
0.9, | ||
0.95, | ||
0.975 | ||
], | ||
"method": "bca", | ||
"replicates": 1000, | ||
"seed": 1980 | ||
}, | ||
"name": "stats", | ||
"type": "StatisticsReporter" | ||
}, | ||
"values": [ | ||
{ | ||
"name": "A_value_MEAN", | ||
"stat": "MEAN", | ||
"type": "std::pair<double, std::vector<double> >", | ||
"value": [ | ||
29.653846153846153, | ||
[ | ||
24.153846153846153, | ||
25.076923076923077, | ||
25.846153846153847, | ||
26.576923076923077, | ||
29.423076923076923, | ||
31.884615384615383, | ||
32.5, | ||
33.23076923076923, | ||
34.07692307692308 | ||
] | ||
] | ||
}, | ||
{ | ||
"name": "B_value_MEAN", | ||
"stat": "MEAN", | ||
"type": "std::pair<double, std::vector<double> >", | ||
"value": [ | ||
28.884615384615383, | ||
[ | ||
24.423076923076923, | ||
25.192307692307693, | ||
26.0, | ||
26.615384615384617, | ||
28.692307692307693, | ||
30.692307692307693, | ||
31.26923076923077, | ||
31.923076923076923, | ||
32.38461538461539 | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"time": 2.0, | ||
"time_step": 2 | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[Tests] | ||
design = StatisticsReporter.md | ||
issues = '#14409 #16584' | ||
|
||
[bca] | ||
requirement = "The system shall support computing bias corrected and accelerated confidence level intervals of statics" | ||
|
||
[basic] | ||
type = JSONDiff | ||
input = bca.i | ||
jsondiff = bca_out.json | ||
|
||
detail = "of a vector of data" | ||
[] | ||
|
||
[replicated] | ||
type = JSONDiff | ||
input = bca_distributed.i | ||
jsondiff = bca_distributed_out.json | ||
cli_args = "VectorPostprocessors/data/parallel_type=replicated" | ||
min_parallel = 3 | ||
max_parallel = 3 | ||
allow_test_objects = true | ||
|
||
detail = "using data that is replicated and" | ||
[] | ||
|
||
[distributed] | ||
type = RunException | ||
input = bca_distributed.i | ||
expect_err = "Due to the computational demands, the BiasCorrectedAccelerated does not work with distributed data" | ||
min_parallel = 3 | ||
max_parallel = 3 | ||
allow_test_objects = true | ||
|
||
detail = "errors when data distributed across processors." | ||
[] | ||
[] | ||
[] |
29 changes: 29 additions & 0 deletions
29
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/errors/error.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[StochasticTools] | ||
[] | ||
|
||
[VectorPostprocessors] | ||
[treatment] | ||
type = ConstantVectorPostprocessor | ||
value = '94 197 16 38 99 141 23' | ||
outputs = none | ||
[] | ||
[control] | ||
type = ConstantVectorPostprocessor | ||
value = '52 104 146 10 51 30 40 27 46' | ||
outputs = none | ||
[] | ||
[] | ||
|
||
[Reporters] | ||
[stats] | ||
type = StatisticsReporter | ||
compute = 'mean stderr' | ||
ci_method = 'percentile' | ||
ci_levels = '0.025 0.05 0.1 0.16 0.5' | ||
ci_replicates = 1000 | ||
ci_seed = 1980 | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
[] |
11 changes: 11 additions & 0 deletions
11
...ests/reporters/bootstrap_statistics/errors/gold/percentile_distributed_out_stats_0001.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
stat_type,data_data | ||
3,204.5 | ||
3.025,180.5 | ||
3.05,180.5 | ||
3.1,193.63333333333 | ||
3.16,193.63333333333 | ||
3.5,204.56666666667 | ||
3.84,221.13333333333 | ||
3.9,221.13333333333 | ||
3.95,227.93333333333 | ||
3.975,227.93333333333 |
21 changes: 21 additions & 0 deletions
21
...tools/test/tests/reporters/bootstrap_statistics/errors/gold/percentile_out_stats_0001.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
stat_type,treatment_value,control_value | ||
3,86.857142857143,56.222222222222 | ||
3.025,42.428571428571,33.111111111111 | ||
3.05,48.285714285714,36.222222222222 | ||
3.1,55.714285714286,40.555555555556 | ||
3.16,62.714285714286,43.555555555556 | ||
3.5,85.571428571429,55.444444444444 | ||
3.84,109.71428571429,68.777777777778 | ||
3.9,116.57142857143,72.444444444444 | ||
3.95,125.42857142857,78.222222222222 | ||
3.975,132.42857142857,82.555555555556 | ||
7,25.235489533052,14.158603369779 | ||
7.025,11.389217958854,4.2233185711105 | ||
7.05,13.197093062721,4.801941479788 | ||
7.1,14.377088727281,6.780281868936 | ||
7.16,16.512415448552,8.6449157255137 | ||
7.5,23.595658542215,13.498399539333 | ||
7.84,27.979462827868,16.66814808231 | ||
7.9,29.364470178151,17.411770532787 | ||
7.95,30.838067296084,18.320786952746 | ||
7.975,31.892997120154,18.990819744495 |
44 changes: 44 additions & 0 deletions
44
modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/errors/tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[Tests] | ||
design = StatisticsReporter.md | ||
issues = '#14409 #16584' | ||
|
||
[errors] | ||
requirement = "The system shall error when computing confidence level intervals when" | ||
|
||
[no_ci_levels] | ||
type = RunException | ||
input = error.i | ||
cli_args = "Reporters/stats/ci_levels=''" | ||
expect_err = "If the 'ci_method' parameter is supplied then the 'ci_levels' must also be supplied with values in \(0, 1\)" | ||
|
||
detail = "the confidence level intervals are omitted;" | ||
[] | ||
|
||
[ci_levels_zero] | ||
type = RunException | ||
input = error.i | ||
cli_args = "Reporters/stats/ci_levels='0'" | ||
expect_err = "The supplied levels must be greater than zero" | ||
|
||
detail = "the confidence level intervals are omitted;" | ||
[] | ||
|
||
[ci_levels_one] | ||
type = RunException | ||
input = error.i | ||
cli_args = "Reporters/stats/ci_levels='1'" | ||
expect_err = "The supplied levels must be less than 1\.0" | ||
|
||
detail = "the confidence level intervals are out of range;" | ||
[] | ||
|
||
[no_input] | ||
type = RunException | ||
input = error.i | ||
cli_args = "Reporters/stats/vectorpostprocessors=''" | ||
expect_err = "The 'vectorpostprocessors' and/or 'reporters' parameters must be defined and non-empty" | ||
|
||
detail = "input is not provided." | ||
[] | ||
[] | ||
[] |
Oops, something went wrong.