- meanMean (or expectation) of the distribution.
C++ Type:double
Description:Mean (or expectation) of the distribution.
- standard_deviationStandard deviation of the distribution
C++ Type:double
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>
Options:
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Options:
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/stochastic_tools/test/tests/distributions/normal_direct.i)
- (modules/stochastic_tools/examples/parameter_study/master.i)
- (modules/stochastic_tools/examples/parameter_study/nonlin_diff_react/nonlin_diff_react_master_normal.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_train.i)
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/master_2dnorm_quad_moment.i)
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/master_2dnorm_quad.i)
- (modules/stochastic_tools/examples/surrogates/poly_chaos_normal_mc.i)
- (modules/stochastic_tools/examples/sobol/master.i)
- (modules/stochastic_tools/test/tests/distributions/normal.i)
- (modules/stochastic_tools/test/tests/surrogates/poly_chaos/master_2dnorm_quad_locs.i)
- (modules/stochastic_tools/examples/surrogates/poly_chaos_normal.i)
- (modules/stochastic_tools/examples/surrogates/polynomial_regression/normal_surr.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)
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/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/examples/parameter_study/master.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 = -10
standard_deviation = 1.5
[]
[s]
type = Normal
mean = 1
standard_deviation = 0.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
multi_app = runner
sampler = hypercube
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerPostprocessorTransfer
multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'T_avg q_left'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[samples]
type = SamplerData
sampler = hypercube
[]
[stats]
type = Statistics
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
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
multi_app = runner
sampler = hypercube
parameters = 'Kernels/nonlin_function/mu1 Kernels/nonlin_function/mu2'
to_control = 'stochastic'
[]
[results]
type = SamplerPostprocessorTransfer
multi_app = runner
sampler = hypercube
to_vector_postprocessor = results
from_postprocessor = 'max min average'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[stats]
type = Statistics
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
[]
(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
multi_app = pc_sub
sampler = pc_sampler
stochastic_reporter = results
from_reporter = 'max/value'
[]
[pr_data]
type = SamplerReporterTransfer
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/surrogates/poly_chaos/master_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
multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerPostprocessorTransfer
multi_app = quad_sub
sampler = quadrature
to_vector_postprocessor = storage
from_postprocessor = avg
[]
[]
[VectorPostprocessors]
[storage]
type = StochasticResults
parallel_type = REPLICATED
[]
[pc_moments]
type = PolynomialChaosStatistics
pc_name = poly_chaos
compute = '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
[]
[]
[Outputs]
[out]
type = CSV
execute_on = FINAL
[]
[]
(modules/stochastic_tools/test/tests/surrogates/poly_chaos/master_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
multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerReporterTransfer
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/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
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/sobol/master.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 = -10
standard_deviation = 1.5
[]
[s]
type = Normal
mean = 1
standard_deviation = 0.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
multi_app = runner
sampler = sobol
parameters = 'Materials/constant/prop_values Kernels/source/value BCs/right/value BCs/left/value'
to_control = 'stochastic'
[]
[results]
type = SamplerPostprocessorTransfer
multi_app = runner
sampler = sobol
to_vector_postprocessor = results
from_postprocessor = 'T_avg q_left'
[]
[]
[VectorPostprocessors]
[results]
type = StochasticResults
[]
[samples]
type = SamplerData
sampler = sobol
[]
[stats]
type = Statistics
vectorpostprocessors = results
compute = 'mean'
ci_method = 'percentile'
ci_levels = '0.05'
[]
[sobol]
type = SobolStatistics
sampler = sobol
results = results
[]
[]
[Outputs]
csv = true
execute_on = 'FINAL'
[]
(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/master_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
multi_app = quad_sub
sampler = quadrature
parameters = 'Materials/diffusivity/prop_values Materials/xs/prop_values'
to_control = 'stochastic'
[]
[data]
type = SamplerPostprocessorTransfer
multi_app = quad_sub
sampler = quadrature
to_vector_postprocessor = storage
from_postprocessor = avg
[]
[]
[VectorPostprocessors]
[storage]
type = StochasticResults
parallel_type = REPLICATED
[]
[local_sense]
type = PolynomialChaosLocalSensitivity
pc_name = poly_chaos
local_points_sampler = grid
local_points = '3.14159 3.14159 2.7182 3.14159 3.14159 2.7182 2.7182 2.7182'
output_points = true
sensitivity_parameters = '0 1'
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
[]
[]
[Outputs]
[out]
type = CSV
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_avg]
type = EvaluateSurrogate
model = poly_chaos_avg
sampler = sample
parallel_type = ROOT
[]
[samp_max]
type = EvaluateSurrogate
model = poly_chaos_max
sampler = sample
parallel_type = ROOT
[]
[]
# Computing statistics
[VectorPostprocessors]
[stats_avg]
type = PolynomialChaosStatistics
pc_name = 'poly_chaos_avg'
compute = 'mean stddev'
[]
[stats_max]
type = PolynomialChaosStatistics
pc_name = 'poly_chaos_max'
compute = 'mean stddev'
[]
[sense_avg]
type = PolynomialChaosLocalSensitivity
pc_name = 'poly_chaos_avg'
local_points = '5 10000 0.03 300'
[]
[sense_max]
type = PolynomialChaosLocalSensitivity
pc_name = 'poly_chaos_max'
local_points = '5 10000 0.03 300'
[]
[sobol_avg]
type = PolynomialChaosSobolStatistics
pc_name = 'poly_chaos_avg'
sensitivity_order = 'first second'
[]
[sobol_max]
type = PolynomialChaosSobolStatistics
pc_name = 'poly_chaos_max'
sensitivity_order = 'first second'
[]
[]
[Outputs]
csv = true
[]
(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'
[]
[]
# Computing statistics
[VectorPostprocessors]
[pc_max_stats]
type = PolynomialChaosStatistics
pc_name = 'pc_max'
compute = 'mean stddev'
[]
[]
[Outputs]
[out]
type = JSON
[]
csv = true
[]
(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
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
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/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/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);
};
(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;
};