www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
NormalDistribution Class Reference

A deprecated wrapper class used to generate a normal distribution. More...

#include <NormalDistribution.h>

Inheritance diagram for NormalDistribution:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 NormalDistribution (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
 
virtual Real median () const
 
virtual bool enabled () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &name, const std::string *param=nullptr) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static Real pdf (const Real &x, const Real &mean, const Real &std_dev)
 
static Real cdf (const Real &x, const Real &mean, const Real &std_dev)
 
static Real quantile (const Real &p, const Real &mean, const Real &std_dev)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

const Real_mean
 The mean (or expectation) of the distribution (mu) More...
 
const Real_standard_deviation
 The standard deviation of the distribution (sigma) More...
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Static Protected Attributes

static const std::array< Real, 6 > _a
 
static const std::array< Real, 6 > _b
 

Detailed Description

A deprecated wrapper class used to generate a normal distribution.

Definition at line 17 of file NormalDistribution.h.

Constructor & Destructor Documentation

◆ NormalDistribution()

NormalDistribution::NormalDistribution ( const InputParameters parameters)

Definition at line 20 of file NormalDistribution.C.

20 : Normal(parameters) {}
Normal(const InputParameters &parameters)
Definition: Normal.C:33
const InputParameters & parameters() const

Member Function Documentation

◆ cdf() [1/2]

Real Normal::cdf ( const Real x) const
overridevirtualinherited

Implements Distribution.

Reimplemented in JohnsonSB, and TruncatedNormal.

Definition at line 74 of file Normal.C.

Referenced by JohnsonSB::cdf(), KernelDensity1D::cdf(), TruncatedNormal::cdf(), StochasticTools::BiasCorrectedAccelerated< std::vector< InType >, std::vector< OutType > >::compute(), StochasticTools::BiasCorrectedAccelerated< InType, OutType >::compute(), ParallelSubsetSimulation::computeSample(), AdaptiveImportanceSampler::computeSample(), TestDistributionDirectPostprocessor::getValue(), TruncatedNormal::pdf(), and TruncatedNormal::quantile().

75 {
76  return cdf(x, _mean, _standard_deviation);
77 }
const Real & _standard_deviation
The standard deviation of the distribution (sigma)
Definition: Normal.h:43
virtual Real cdf(const Real &x) const override
Definition: Normal.C:74
const std::vector< double > x
const Real & _mean
The mean (or expectation) of the distribution (mu)
Definition: Normal.h:40

◆ cdf() [2/2]

Real Normal::cdf ( const Real x,
const Real mean,
const Real std_dev 
)
staticinherited

Definition at line 48 of file Normal.C.

49 {
50  return 0.5 * (1.0 + std::erf((x - mean) / (std_dev * std::sqrt(2.0))));
51 }
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
const std::vector< double > x

◆ pdf() [1/2]

Real Normal::pdf ( const Real x) const
overridevirtualinherited

Implements Distribution.

Reimplemented in JohnsonSB, and TruncatedNormal.

Definition at line 68 of file Normal.C.

Referenced by ParallelSubsetSimulation::computeSample(), AdaptiveImportanceSampler::computeSample(), AdaptiveImportanceStats::execute(), Gaussian::function(), TestDistributionDirectPostprocessor::getValue(), TruncatedNormal::pdf(), and KernelDensity1D::pdf().

69 {
70  return pdf(x, _mean, _standard_deviation);
71 }
const Real & _standard_deviation
The standard deviation of the distribution (sigma)
Definition: Normal.h:43
virtual Real pdf(const Real &x) const override
Definition: Normal.C:68
const std::vector< double > x
const Real & _mean
The mean (or expectation) of the distribution (mu)
Definition: Normal.h:40

◆ pdf() [2/2]

Real Normal::pdf ( const Real x,
const Real mean,
const Real std_dev 
)
staticinherited

Definition at line 41 of file Normal.C.

42 {
43  return 1.0 / (std_dev * std::sqrt(2.0 * M_PI)) *
44  std::exp(-0.5 * Utility::pow<2>((x - mean) / std_dev));
45 }
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
const std::vector< double > x

◆ quantile() [1/2]

Real Normal::quantile ( const Real p) const
overridevirtualinherited

◆ quantile() [2/2]

Real Normal::quantile ( const Real p,
const Real mean,
const Real std_dev 
)
staticinherited

Definition at line 54 of file Normal.C.

55 {
56  const Real x = (p < 0.5 ? p : 1.0 - p);
57  const Real y = std::sqrt(-2.0 * std::log(x));
58  const Real y2 = y * y;
59  const Real y3 = y2 * y;
60  const Real y4 = y3 * y;
61  const Real sgn = (p - 0.5 < 0.0 ? -1.0 : 1.0);
62  const Real Zp = sgn * (y + (_a[0] + _a[1] * y + _a[2] * y2 + _a[3] * y3 + _a[4] * y4) /
63  (_b[0] + _b[1] * y + _b[2] * y2 + _b[3] * y3 + _b[4] * y4));
64  return Zp * std_dev + mean;
65 }
int sgn(T val)
The sign function.
Definition: Numerics.h:39
const std::vector< double > y
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
const std::vector< double > x
static const std::array< Real, 6 > _a
Definition: Normal.h:35
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::array< Real, 6 > _b
Definition: Normal.h:36

◆ validParams()

InputParameters NormalDistribution::validParams ( )
static

Definition at line 15 of file NormalDistribution.C.

16 {
17  return Normal::validParams();
18 }
static InputParameters validParams()
Definition: Normal.C:23

Member Data Documentation

◆ _a

const std::array< Real, 6 > Normal::_a
staticprotectedinherited
Initial value:
= {
{-0.322232431088, -1.0, -0.342242088547, -0.0204231210245, -0.0000453642210148}}

Coefficients for the rational function used to approximate the quantile

Definition at line 35 of file Normal.h.

Referenced by Normal::quantile().

◆ _b

const std::array< Real, 6 > Normal::_b
staticprotectedinherited
Initial value:
= {
{0.099348462606, 0.588581570495, 0.531103462366, 0.10353775285, 0.0038560700634}}

Definition at line 36 of file Normal.h.

Referenced by Normal::quantile().

◆ _mean

const Real& Normal::_mean
protectedinherited

The mean (or expectation) of the distribution (mu)

Definition at line 40 of file Normal.h.

Referenced by Normal::cdf(), TruncatedNormal::cdf(), TruncatedNormal::pdf(), Normal::pdf(), TruncatedNormal::quantile(), and Normal::quantile().

◆ _standard_deviation

const Real& Normal::_standard_deviation
protectedinherited

The standard deviation of the distribution (sigma)

Definition at line 43 of file Normal.h.

Referenced by Normal::cdf(), TruncatedNormal::cdf(), TruncatedNormal::pdf(), Normal::pdf(), TruncatedNormal::quantile(), and Normal::quantile().


The documentation for this class was generated from the following files: