- meanMean (or expectation) of the distribution.
C++ Type:double
Controllable:No
Description:Mean (or expectation) of the distribution.
- standard_deviationStandard deviation of the distribution
C++ Type:double
Controllable:No
Description:Standard deviation of the distribution
Normal
Normal distribution
Description
The normal (or Gaussian) distribution object defines a normal distribution function with the provided mean
and standard_deviation
parameters. The probability density function (PDF) of the normal distribution is given by the Eq. (1).
where is the mean and is the standard deviation () of the distribution.
This implementation of a normal distribution uses a numerical approximation described in Kennedy and Gentle (2018).
Example Input Syntax
The following input file defines a normal distribution with a mean of 0 and a standard deviation of 1.
[Distributions]
[normal_test]
type = Normal
mean = 0
standard_deviation = 1
[]
[]
(modules/stochastic_tools/test/tests/distributions/normal.i)Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad.i)
- (modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_master_normal.i)
- (modules/stochastic_tools/examples/surrogates/poly_chaos_normal.i)
- (modules/stochastic_tools/examples/surrogates/poly_chaos_normal_quad.i)
- (modules/stochastic_tools/examples/surrogates/nearest_point_normal.i)
- (modules/stochastic_tools/test/tests/surrogates/polynomial_regression/poly_reg_vec.i)
- (modules/stochastic_tools/examples/sobol/main.i)
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad_moment.i)
- (modules/stochastic_tools/test/tests/samplers/ParallelSubsetSimulation/pss.i)
- (modules/stochastic_tools/test/tests/samplers/ParallelSubsetSimulation/pss_error1.i)
- (modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/percentile/percentile_main.i)
- (modules/stochastic_tools/test/tests/distributions/normal.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_train.i)
- (modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/bca_main.i)
- (modules/stochastic_tools/examples/parameter_study/main_vector.i)
- (modules/stochastic_tools/examples/surrogates/poly_chaos_normal_mc.i)
- (modules/stochastic_tools/test/tests/distributions/normal_direct.i)
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad_locs.i)
- (modules/stochastic_tools/examples/parameter_study/main_time.i)
- (modules/stochastic_tools/examples/parameter_study/main.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_surr.i)
- (modules/stochastic_tools/test/tests/samplers/AdaptiveImportanceSampler/ais.i)
Child Objects
References
- William J Kennedy and James E Gentle.
Statistical computing.
Routledge, 2018.[BibTeX]
@book{kennedy2018statistical, author = "Kennedy, William J and Gentle, James E", title = "Statistical computing", year = "2018", publisher = "Routledge" }
(modules/stochastic_tools/test/tests/distributions/normal.i)
[StochasticTools]
[]
[Distributions]
[normal_test]
type = Normal
mean = 0
standard_deviation = 1
[]
[]
[Postprocessors]
[cdf]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0
method = cdf
execute_on = initial
[]
[pdf]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0
method = pdf
execute_on = initial
[]
[quantile]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0.5
method = quantile
execute_on = initial
[]
[]
[Outputs]
execute_on = 'INITIAL'
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad.i)
[StochasticTools]
[]
[Distributions]
[D_dist]
type = Normal
mean = 5
standard_deviation = 0.5
[]
[S_dist]
type = Normal
mean = 8
standard_deviation = 0.7
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 100
distributions = 'D_dist S_dist'
execute_on = timestep_end
[]
[quadrature]
type = Quadrature
distributions = 'D_dist S_dist'
execute_on = INITIAL
order = 5
[]
[]
[MultiApps]
[quad_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = quadrature
mode = batch-restore
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerReporterTransfer
from_multi_app = quad_sub
sampler = quadrature
stochastic_reporter = storage
from_reporter = avg/value
[]
[]
[Reporters]
[storage]
type = StochasticReporter
outputs = none
[]
[pc_samp]
type = EvaluateSurrogate
model = poly_chaos
sampler = sample
parallel_type = ROOT
execute_on = final
[]
[]
[Surrogates]
[poly_chaos]
type = PolynomialChaos
trainer = poly_chaos
[]
[]
[Trainers]
[poly_chaos]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 5
distributions = 'D_dist S_dist'
sampler = quadrature
response = storage/data:avg:value
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_master_normal.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.3
standard_deviation = 0.045
[]
[mu2]
type = Normal
mean = 9
standard_deviation = 1.35
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'mu1 mu2'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'nonlin_diff_react_sub.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Kernels/nonlin_function/mu1 Kernels/nonlin_function/mu2'
to_control = 'stochastic'
[]
[results]
type = SamplerPostprocessorTransfer
from_multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'max min average'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[]
[Reporters]
[stats]
type = StatisticsReporter
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
[]
(modules/stochastic_tools/examples/surrogates/poly_chaos_normal.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 100000
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = initial
[]
[]
[Surrogates]
[poly_chaos_avg]
type = PolynomialChaos
filename = 'poly_chaos_training_poly_chaos_avg.rd'
[]
[poly_chaos_max]
type = PolynomialChaos
filename = 'poly_chaos_training_poly_chaos_max.rd'
[]
[]
[Reporters]
[samp]
type = EvaluateSurrogate
model = 'poly_chaos_avg poly_chaos_max'
sampler = sample
parallel_type = ROOT
[]
[stats]
type = PolynomialChaosReporter
pc_name = 'poly_chaos_avg poly_chaos_max'
statistics = 'mean stddev'
local_sensitivity_points = '5 10000 0.03 300; 5 10000 0.03 300'
include_sobol = true
[]
[]
[Outputs]
[out]
type = JSON
execute_on = final
[]
[]
(modules/stochastic_tools/examples/surrogates/poly_chaos_normal_quad.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = Quadrature
order = 10
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppCommandLineControl
multi_app = sub
sampler = sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = sample
stochastic_reporter = results
from_reporter = 'avg/value max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[poly_chaos_avg]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 10
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = sample
response = results/data:avg:value
[]
[poly_chaos_max]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 10
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = sample
response = results/data:max:value
[]
[]
[Outputs]
file_base = poly_chaos_training
[out]
type = SurrogateTrainerOutput
trainers = 'poly_chaos_avg poly_chaos_max'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/surrogates/nearest_point_normal.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 100000
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = initial
[]
[]
[Reporters]
# Sampling surrogate
[samp]
type = EvaluateSurrogate
model = 'nearest_point_avg nearest_point_max'
sampler = sample
parallel_type = ROOT
[]
# Computing statistics
[stats]
type = StatisticsReporter
reporters = 'samp/nearest_point_avg samp/nearest_point_max'
compute = 'mean stddev'
[]
[]
[Surrogates]
[nearest_point_avg]
type = NearestPointSurrogate
filename = 'nearest_point_training_out_nearest_point_avg.rd'
[]
[nearest_point_max]
type = NearestPointSurrogate
filename = 'nearest_point_training_out_nearest_point_max.rd'
[]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/polynomial_regression/poly_reg_vec.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 10
distributions = 'k_dist L_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[GlobalParams]
sampler = sample
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub_vector.i
mode = batch-reset
execute_on = initial
[]
[]
[Controls]
[cmdline]
type = MultiAppCommandLineControl
multi_app = sub
param_names = 'Materials/conductivity/prop_values L'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
stochastic_reporter = results
from_reporter = 'T_vec/T T_vec/x'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[eval]
type = EvaluateSurrogate
model = pr_surrogate
response_type = vector_real
parallel_type = ROOT
execute_on = timestep_end
[]
[]
[Trainers]
[pr]
type = PolynomialRegressionTrainer
regression_type = ols
max_degree = 2
response = results/data:T_vec:T
response_type = vector_real
execute_on = initial
[]
[]
[Surrogates]
[pr_surrogate]
type = PolynomialRegressionSurrogate
trainer = pr
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/examples/sobol/main.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube_a]
type = LatinHypercube
num_rows = 10000
distributions = 'gamma q_0 T_0 s'
seed = 2011
[]
[hypercube_b]
type = LatinHypercube
num_rows = 10000
distributions = 'gamma q_0 T_0 s'
seed = 2013
[]
[sobol]
type = Sobol
sampler_a = hypercube_a
sampler_b = hypercube_b
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = sobol
input_files = 'diffusion.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = sobol
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = sobol
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value'
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[sobol]
type = SobolReporter
sampler = sobol
reporters = 'results/results:T_avg:value results/results:q_left:value'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad_moment.i)
[StochasticTools]
[]
[Distributions]
[D_dist]
type = Normal
mean = 5
standard_deviation = 0.5
[]
[S_dist]
type = Normal
mean = 8
standard_deviation = 0.7
[]
[]
[Samplers]
[quadrature]
type = Quadrature
distributions = 'D_dist S_dist'
execute_on = INITIAL
order = 5
[]
[]
[MultiApps]
[quad_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = quadrature
mode = batch-restore
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerReporterTransfer
from_multi_app = quad_sub
sampler = quadrature
stochastic_reporter = storage
from_reporter = avg/value
[]
[]
[Reporters]
[storage]
type = StochasticReporter
outputs = none
[]
[pc_moments]
type = PolynomialChaosReporter
pc_name = poly_chaos
statistics = 'mean stddev skewness kurtosis'
execute_on = final
[]
[]
[Surrogates]
[poly_chaos]
type = PolynomialChaos
trainer = poly_chaos
[]
[]
[Trainers]
[poly_chaos]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 5
distributions = 'D_dist S_dist'
sampler = quadrature
response = storage/data:avg:value
[]
[]
[Outputs]
[out]
type = JSON
execute_on = FINAL
execute_system_information_on = none
[]
[]
(modules/stochastic_tools/test/tests/samplers/ParallelSubsetSimulation/pss.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.0
standard_deviation = 0.5
[]
[mu2]
type = Normal
mean = 1
standard_deviation = 0.5
[]
[]
[Samplers]
[sample]
type = ParallelSubsetSimulation
distributions = 'mu1 mu2'
output_reporter = 'constant/reporter_transfer:average:value'
inputs_reporter = 'adaptive_MC/inputs'
num_samplessub = 20
use_absolute_value = true
num_parallel_chains = 2
seed = 1012
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'BCs/left/value BCs/right/value'
to_control = 'stochastic'
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Reporters]
[constant]
type = StochasticReporter
outputs = none
[]
[adaptive_MC]
type = AdaptiveMonteCarloDecision
output_value = constant/reporter_transfer:average:value
inputs = 'inputs'
sampler = sample
[]
[]
[Executioner]
type = Transient
num_steps = 20
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/samplers/ParallelSubsetSimulation/pss_error1.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.0
standard_deviation = 0.5
[]
[mu2]
type = Normal
mean = 1
standard_deviation = 0.5
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 1
distributions = 'mu1 mu2'
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'BCs/left/value BCs/right/value'
to_control = 'stochastic'
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Reporters]
[constant]
type = StochasticReporter
outputs = none
[]
[adaptive_MC]
type = AdaptiveMonteCarloDecision
output_value = constant/reporter_transfer:average:value
inputs = 'inputs'
sampler = sample
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/percentile/percentile_main.i)
[StochasticTools]
[]
[Distributions]
[n0]
type = Normal
mean = 0
standard_deviation = 1
[]
[n1]
type = Normal
mean = 1
standard_deviation = 1
[]
[n2]
type = Normal
mean = 2
standard_deviation = 0.5
[]
[n3]
type = Normal
mean = 3
standard_deviation = 0.33333333333
[]
[n4]
type = Normal
mean = 4
standard_deviation = 0.25
[]
[]
[Samplers/sample]
type = MonteCarlo
distributions = 'n0 n1 n2 n3 n4'
num_rows = 100
execute_on = PRE_MULTIAPP_SETUP
[]
[GlobalParams]
sampler = sample
[]
[MultiApps/sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
mode = batch-reset
[]
[Controls/param]
type = MultiAppCommandLineControl
multi_app = sub
param_names = 'Reporters/const/real_vector_values[0,1,2,3,4]'
[]
[Transfers/data]
type = SamplerReporterTransfer
from_multi_app = sub
from_reporter = 'const/num_vec'
stochastic_reporter = storage
[]
[Reporters]
[storage]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = storage/data:const:num_vec
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.025 0.05 0.1 0.16 0.5 0.84 0.9 0.95 0.975'
ci_replicates = 10000
ci_seed = 1945
execute_on = FINAL
[]
[]
[Outputs]
execute_on = FINAL
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/test/tests/distributions/normal.i)
[StochasticTools]
[]
[Distributions]
[normal_test]
type = Normal
mean = 0
standard_deviation = 1
[]
[]
[Postprocessors]
[cdf]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0
method = cdf
execute_on = initial
[]
[pdf]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0
method = pdf
execute_on = initial
[]
[quantile]
type = TestDistributionPostprocessor
distribution = normal_test
value = 0.5
method = quantile
execute_on = initial
[]
[]
[Outputs]
execute_on = 'INITIAL'
csv = true
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_train.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[pc_sampler]
type = Quadrature
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[pr_sampler]
type = LatinHypercube
distributions = 'k_dist q_dist L_dist Tinf_dist'
num_rows = 6560
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[pc_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pc_sampler
[]
[pr_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = pr_sampler
[]
[]
[Controls]
[pc_cmdline]
type = MultiAppCommandLineControl
multi_app = pc_sub
sampler = pc_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[pr_cmdline]
type = MultiAppCommandLineControl
multi_app = pr_sub
sampler = pr_sampler
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[pc_data]
type = SamplerReporterTransfer
from_multi_app = pc_sub
sampler = pc_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[pr_data]
type = SamplerReporterTransfer
from_multi_app = pr_sub
sampler = pr_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[pc_max]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 8
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = pc_sampler
response = results/pc_data:max:value
[]
[pr_max]
type = PolynomialRegressionTrainer
execute_on = timestep_end
regression_type = "ols"
max_degree = 4
sampler = pr_sampler
response = results/pr_data:max:value
[]
[]
[Outputs]
[pc_out]
type = SurrogateTrainerOutput
trainers = 'pc_max'
execute_on = FINAL
[]
[pr_out]
type = SurrogateTrainerOutput
trainers = 'pr_max'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/reporters/bootstrap_statistics/bca/bca_main.i)
[StochasticTools]
[]
[Distributions]
[n0]
type = Normal
mean = 0
standard_deviation = 1
[]
[n1]
type = Normal
mean = 1
standard_deviation = 1
[]
[n2]
type = Normal
mean = 2
standard_deviation = 0.5
[]
[n3]
type = Normal
mean = 3
standard_deviation = 0.33333333333
[]
[n4]
type = Normal
mean = 4
standard_deviation = 0.25
[]
[]
[Samplers/sample]
type = MonteCarlo
distributions = 'n0 n1 n2 n3 n4'
num_rows = 100
execute_on = PRE_MULTIAPP_SETUP
[]
[GlobalParams]
sampler = sample
[]
[MultiApps/sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
mode = batch-reset
[]
[Controls/param]
type = MultiAppCommandLineControl
multi_app = sub
param_names = 'Reporters/const/real_vector_values[0,1,2,3,4]'
[]
[Transfers/data]
type = SamplerReporterTransfer
from_multi_app = sub
from_reporter = 'const/num_vec'
stochastic_reporter = storage
[]
[Reporters]
[storage]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = storage/data:const:num_vec
compute = 'mean stddev'
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 = 10000
ci_seed = 1945
execute_on = FINAL
[]
[]
[Outputs]
execute_on = FINAL
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/examples/parameter_study/main_vector.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'diffusion_vector.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'acc/T_avg:value acc/q_left:value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:acc:T_avg:value results/results:acc:q_left:value'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/surrogates/poly_chaos_normal_mc.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = MonteCarlo
num_rows = 10000
distributions = 'k_dist q_dist L_dist Tinf_dist'
execute_on = PRE_MULTIAPP_SETUP
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Controls]
[cmdline]
type = MultiAppCommandLineControl
multi_app = sub
sampler = sample
param_names = 'Materials/conductivity/prop_values Kernels/source/value Mesh/xmax BCs/right/value'
[]
[]
[Transfers]
[data]
type = SamplerReporterTransfer
from_multi_app = sub
sampler = sample
stochastic_reporter = results
from_reporter = 'avg/value max/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[]
[Trainers]
[poly_chaos_avg]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 10
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = sample
response = results/data:avg:value
[]
[poly_chaos_max]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 10
distributions = 'k_dist q_dist L_dist Tinf_dist'
sampler = sample
response = results/data:max:value
[]
[]
[Outputs]
file_base = poly_chaos_training
[out]
type = SurrogateTrainerOutput
trainers = 'poly_chaos_avg poly_chaos_max'
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/distributions/normal_direct.i)
[StochasticTools]
[]
[Distributions]
[normal_test]
type = Normal
mean = 0
standard_deviation = 1
[]
[]
[Postprocessors]
[cdf]
type = TestDistributionDirectPostprocessor
distribution = normal_test
value = 0
method = cdf
execute_on = initial
[]
[pdf]
type = TestDistributionDirectPostprocessor
distribution = normal_test
value = 0
method = pdf
execute_on = initial
[]
[quantile]
type = TestDistributionDirectPostprocessor
distribution = normal_test
value = 0.5
method = quantile
execute_on = initial
[]
[]
[Outputs]
execute_on = 'INITIAL'
csv = true
[]
(modules/stochastic_tools/test/tests/surrogates/poly_chaos/main_2dnorm_quad_locs.i)
[StochasticTools]
[]
[Distributions]
[D_dist]
type = Normal
mean = 5
standard_deviation = 0.5
[]
[S_dist]
type = Normal
mean = 8
standard_deviation = 0.7
[]
[]
[Samplers]
[grid]
type = CartesianProduct
linear_space_items = '2.5 0.5 10 3 1 10'
[]
[quadrature]
type = Quadrature
distributions = 'D_dist S_dist'
execute_on = INITIAL
order = 5
[]
[]
[MultiApps]
[quad_sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = quadrature
mode = batch-restore
[]
[]
[Transfers]
[quad]
type = SamplerParameterTransfer
to_multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerReporterTransfer
from_multi_app = quad_sub
sampler = quadrature
stochastic_reporter = storage
from_reporter = avg/value
[]
[]
[Reporters]
[storage]
type = StochasticReporter
outputs = none
[]
[local_sense]
type = PolynomialChaosReporter
pc_name = poly_chaos
local_sensitivity_sampler = grid
local_sensitivity_points = '3.14159 3.14159 2.7182 3.14159 3.14159 2.7182 2.7182 2.7182'
execute_on = final
[]
[]
[Surrogates]
[poly_chaos]
type = PolynomialChaos
trainer = poly_chaos
[]
[]
[Trainers]
[poly_chaos]
type = PolynomialChaosTrainer
execute_on = timestep_end
order = 5
distributions = 'D_dist S_dist'
sampler = quadrature
response = storage/data:avg:value
[]
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = none
execute_on = FINAL
[]
[]
(modules/stochastic_tools/examples/parameter_study/main_time.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerTransientMultiApp
sampler = hypercube
input_files = 'diffusion_time.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value T_vec/T'
[]
[x_transfer]
type = MultiAppReporterTransfer
from_multi_app = runner
subapp_index = 0
from_reporters = T_vec/x
to_reporters = const/x
[]
[]
[Reporters]
[results]
type = StochasticReporter
outputs = none
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value results/results:T_vec:T'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[const]
type = ConstantReporter
real_vector_names = 'x'
real_vector_values = '0'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 4
dt = 0.25
[]
[Outputs]
execute_on = timestep_end
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/parameter_study/main.i)
[StochasticTools]
[]
[Distributions]
[gamma]
type = Uniform
lower_bound = 0.5
upper_bound = 2.5
[]
[q_0]
type = Weibull
location = -110
scale = 20
shape = 1
[]
[T_0]
type = Normal
mean = 300
standard_deviation = 45
[]
[s]
type = Normal
mean = 100
standard_deviation = 25
[]
[]
[Samplers]
[hypercube]
type = LatinHypercube
num_rows = 5000
distributions = 'gamma q_0 T_0 s'
[]
[]
[MultiApps]
[runner]
type = SamplerFullSolveMultiApp
sampler = hypercube
input_files = 'diffusion.i'
mode = batch-restore
[]
[]
[Transfers]
[parameters]
type = SamplerParameterTransfer
to_multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerReporterTransfer
from_multi_app = runner
sampler = hypercube
stochastic_reporter = results
from_reporter = 'T_avg/value q_left/value'
[]
[]
[Reporters]
[results]
type = StochasticReporter
[]
[stats]
type = StatisticsReporter
reporters = 'results/results:T_avg:value results/results:q_left:value'
compute = 'mean stddev'
ci_method = 'percentile'
ci_levels = '0.05 0.95'
[]
[]
[Outputs]
execute_on = 'FINAL'
[out]
type = JSON
[]
[]
(modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_surr.i)
[StochasticTools]
[]
[Distributions]
[k_dist]
type = Normal
mean = 5
standard_deviation = 2
[]
[q_dist]
type = Normal
mean = 10000
standard_deviation = 500
[]
[L_dist]
type = Normal
mean = 0.03
standard_deviation = 0.01
[]
[Tinf_dist]
type = Normal
mean = 300
standard_deviation = 10
[]
[]
[Samplers]
[sample]
type = LatinHypercube
num_rows = 100000
distributions = 'k_dist q_dist L_dist Tinf_dist'
[]
[]
[Surrogates]
[pc_max]
type = PolynomialChaos
filename = 'normal_train_pc_out_pc_max.rd'
[]
[pr_max]
type = PolynomialRegressionSurrogate
filename = 'normal_train_pr_out_pr_max.rd'
[]
[]
[Reporters]
[pc_max_res]
type = EvaluateSurrogate
model = pc_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_res]
type = EvaluateSurrogate
model = pr_max
sampler = sample
parallel_type = ROOT
[]
[pr_max_stats]
type = StatisticsReporter
reporters = 'pr_max_res/pr_max'
compute = 'mean stddev'
[]
[pc_max_stats]
type = PolynomialChaosReporter
pc_name = 'pc_max'
statistics = 'mean stddev'
[]
[]
[Outputs]
[out]
type = JSON
execute_on = timestep_end
[]
[]
(modules/stochastic_tools/test/tests/samplers/AdaptiveImportanceSampler/ais.i)
[StochasticTools]
[]
[Distributions]
[mu1]
type = Normal
mean = 0.0
standard_deviation = 0.5
[]
[mu2]
type = Normal
mean = 1
standard_deviation = 0.5
[]
[]
[Samplers]
[sample]
type = AdaptiveImportance
distributions = 'mu1 mu2'
proposal_std = '0.15 0.15'
output_limit = 0.45
num_samples_train = 5
std_factor = 0.8
use_absolute_value = true
seed = 1012
initial_values = '-0.10329808102501603 1.2396280668056123'
inputs_reporter = 'adaptive_MC/inputs'
[]
[]
[MultiApps]
[sub]
type = SamplerFullSolveMultiApp
input_files = sub.i
sampler = sample
[]
[]
[Transfers]
[param]
type = SamplerParameterTransfer
to_multi_app = sub
sampler = sample
parameters = 'BCs/left/value BCs/right/value'
to_control = 'stochastic'
[]
[reporter_transfer]
type = SamplerReporterTransfer
from_reporter = 'average/value'
stochastic_reporter = 'constant'
from_multi_app = sub
sampler = sample
[]
[]
[Reporters]
[constant]
type = StochasticReporter
[]
[adaptive_MC]
type = AdaptiveMonteCarloDecision
output_value = constant/reporter_transfer:average:value
inputs = 'inputs'
sampler = sample
[]
[]
[Executioner]
type = Transient
num_steps = 10
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = NONE
[]
[]
(modules/stochastic_tools/include/distributions/JohnsonSB.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Normal.h"
/**
* A class used to generate a Johnson SB distribution
*/
class JohnsonSB : public Normal
{
public:
static InputParameters validParams();
JohnsonSB(const InputParameters & parameters);
virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;
static Real
pdf(const Real & x, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
static Real
cdf(const Real & x, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
static Real quantile(
const Real & p, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
protected:
/// The lower location parameter, a
const Real & _lower;
/// The upper location parameter, b
const Real & _upper;
/// The first shape parameter, alpha_1
const Real & _alpha_1;
/// The second shape parameter, alpha_2
const Real & _alpha_2;
};
(modules/stochastic_tools/include/distributions/TruncatedNormal.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Normal.h"
/**
* A class used to generate a truncated normal distribution
*/
class TruncatedNormal : public Normal
{
public:
static InputParameters validParams();
TruncatedNormal(const InputParameters & parameters);
virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;
static Real pdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
static Real cdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
static Real quantile(const Real & p,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
protected:
/// The lower bound for the distribution
const Real & _lower_bound;
/// The upper bound for the distribution
const Real & _upper_bound;
};
(modules/stochastic_tools/include/distributions/NormalDistribution.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Normal.h"
/**
* A deprecated wrapper class used to generate a normal distribution
*/
class NormalDistribution : public Normal
{
public:
static InputParameters validParams();
NormalDistribution(const InputParameters & parameters);
};