# Stochastic Tools

The stochastic tools module is a toolbox designed for performing stochastic analysis for MOOSE-based applications. The following sections detail the various aspects of this module that can be used independently or in combination to meet the needs of the application developer.

## Examples

### Parameter Studies, Statistics, and Sensitivity Analysis

Example 1: Monte Carlo Example

Example 2: Parameter Study

Example 4: SOBOL Sensitivity Analysis

### Surrogate Models

Example 5: Creating a Surrogate Model

Example 6: Training a Surrogate Model

Example 7: Evaluating a Surrogate Model

Example 8: Polynomial Chaos Surrogate

Example 9: Polynomial Regression Surrogate

## Performance

The stochastic tools module is optimized in two ways for memory use. First, sub-applications can be executed in batches and all objects utilizing sample data do so using a distributed sample matrix. For further details refer to the following:

## Objects, Actions, and Syntax

The following is a complete list of all objects available in the stochastic tools module.

## Controls

- Stochastic Tools App
- MultiAppCommandLineControlControl for modifying the command line arguments of MultiApps.
- SamplerReceiverControl for receiving data from a Sampler via SamplerParameterTransfer.

## Covariance

- Stochastic Tools App
- AddCovarianceActionAdds Covariance objects contained within the
`[Trainers]`

and`[Surrogates]`

input blocks. - ExponentialCovarianceExponential covariance function.
- MaternHalfIntCovarianceMatern half-integer covariance function.
- SquaredExponentialCovarianceSquared Exponential covariance function.

## Distributions

- Stochastic Tools App
- BoostLognormalBoost Lognormal distribution.
- BoostNormalBoost Normal distribution.
- BoostWeibullBoost Weibull distribution.
- JohnsonSBJohnson Special Bounded (SB) distribution.
- LogisticLogistic distribution.
- LognormalLognormal distribution
- NormalNormal distribution
- TruncatedNormalTruncated normal distribution
- UniformContinuous uniform distribution.
- WeibullThree-parameter Weibull distribution.

## MultiApps

- Stochastic Tools App
- SamplerFullSolveMultiAppCreates a full-solve type sub-application for each row of each Sampler matrix.
- SamplerTransientMultiAppCreates a sub-application for each row of each Sampler matrix.

## Outputs

- Stochastic Tools App
- SurrogateTrainerOutputOutput for trained surrogate model data.

## Samplers

- Stochastic Tools App
- CartesianProductProvides complete Cartesian product for the supplied variables.
- CartesianProductSamplerProvides complete Cartesian product for the supplied variables.
- LatinHypercubeLatin Hypercube Sampler.
- MonteCarloMonte Carlo Sampler.
- MonteCarloSamplerMonte Carlo Sampler.
- QuadratureQuadrature sampler for Polynomial Chaos.
- QuadratureSamplerQuadrature sampler for Polynomial Chaos.
- SobolSobol variance-based sensitivity analysis Sampler.
- SobolSamplerSobol variance-based sensitivity analysis Sampler.

## StochasticTools

- Stochastic Tools App
- StochasticToolsActionAction for performing some common functions for running stochastic simulations.

## Surrogates

- Stochastic Tools App
- AddSurrogateActionAdds SurrogateTrainer and SurrogateModel objects contained within the
`[Trainers]`

and`[Surrogates]`

input blocks. - GaussianProcessComputes and evaluates Gaussian Process surrogate model.
- NearestPointSurrogateSurrogate that evaluates the value from the nearest point from data in NearestPointTrainer
- PolynomialChaosComputes and evaluates polynomial chaos surrogate model.
- PolynomialRegressionSurrogateEvaluates polynomial regression model with coefficients computed from PolynomialRegressionTrainer.

## Trainers

- Stochastic Tools App
- AddSurrogateActionAdds SurrogateTrainer and SurrogateModel objects contained within the
`[Trainers]`

and`[Surrogates]`

input blocks. - GaussianProcessTrainerProvides data preperation and training for a Gaussian Process surrogate model.
- NearestPointTrainerLoops over and saves sample values for NearestPointSurrogate.
- PolynomialChaosTrainerComputes and evaluates polynomial chaos surrogate model.
- PolynomialRegressionTrainerComputes coefficients for polynomial regession model.

## Transfers

- Stochastic Tools App
- SamplerParameterTransferCopies Sampler data to a SamplerReceiver object.
- SamplerPostprocessorTransferTransfers data from Postprocessors on the sub-application to a VectorPostprocessor on the master application.
- SamplerTransferCopies Sampler data to a SamplerReceiver object.

## VectorPostprocessors

- Stochastic Tools App
- EvaluateSurrogateTool for sampling surrogate models.
- PolynomialChaosDataTool for extracting data from polynomial chaos user object and storing in VectorPostprocessor vectors.
- PolynomialChaosLocalSensitivityTool for calculating local sensitivity with polynomial chaos expansion.
- PolynomialChaosSobolStatisticsCompute SOBOL statistics values of a trained PolynomialChaos surrogate.
- PolynomialChaosStatisticsTool for calculating statistics with polynomial chaos expansion.
- SamplerDataTool for extracting Sampler object data and storing in VectorPostprocessor vectors.
- SobolStatisticsCompute SOBOL statistics values of a given VectorPostprocessor objects and vectors.
- StatisticsCompute statistical values of a given VectorPostprocessor objects and vectors.
- StochasticResultsStorage container for stochastic simulation results coming from a Postprocessor.