https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Private Member Functions | Private Attributes | List of all members
JohnsonSBDistribution Class Reference

A deprecated wrapper class used to generate a Johnson SB distribution. More...

#include <JohnsonSBDistribution.h>

Inheritance diagram for JohnsonSBDistribution:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 JohnsonSBDistribution (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
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) 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 &a, const Real &b, const Real &alpha_1, const Real &alpha_2)
 
static Real pdf (const Real &x, const Real &mean, const Real &std_dev)
 
static Real cdf (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 &mean, const Real &std_dev)
 
static Real quantile (const Real &p, const Real &a, const Real &b, const Real &alpha_1, const Real &alpha_2)
 
static Real quantile (const Real &p, const Real &mean, const Real &std_dev)
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 

Protected Member Functions

void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
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 & _lower
 The lower location parameter, a.
 
const Real & _upper
 The upper location parameter, b.
 
const Real & _alpha_1
 The first shape parameter, alpha_1.
 
const Real & _alpha_2
 The second shape parameter, alpha_2.
 
const Real & _mean
 The mean (or expectation) of the distribution (mu)
 
const Real & _standard_deviation
 The standard deviation of the distribution (sigma)
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
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
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 

Detailed Description

A deprecated wrapper class used to generate a Johnson SB distribution.

Definition at line 17 of file JohnsonSBDistribution.h.

Constructor & Destructor Documentation

◆ JohnsonSBDistribution()

JohnsonSBDistribution::JohnsonSBDistribution ( const InputParameters parameters)

Definition at line 23 of file JohnsonSBDistribution.C.

25{
26}
A class used to generate a Johnson SB distribution.
Definition JohnsonSB.h:18
const InputParameters & parameters() const

Member Function Documentation

◆ cdf() [1/3]

Real JohnsonSB::cdf ( const Real &  x) const
overridevirtualinherited

Reimplemented from Normal.

Definition at line 88 of file JohnsonSB.C.

89{
90 return cdf(x, _lower, _upper, _alpha_1, _alpha_2);
91}
const std::vector< double > x
const Real & _upper
The upper location parameter, b.
Definition JohnsonSB.h:40
const Real & _alpha_2
The second shape parameter, alpha_2.
Definition JohnsonSB.h:46
const Real & _lower
The lower location parameter, a.
Definition JohnsonSB.h:37
const Real & _alpha_1
The first shape parameter, alpha_1.
Definition JohnsonSB.h:43
virtual Real cdf(const Real &x) const override
Definition JohnsonSB.C:88

Referenced by JohnsonSB::cdf().

◆ cdf() [2/3]

Real JohnsonSB::cdf ( const Real &  x,
const Real &  a,
const Real &  b,
const Real &  alpha_1,
const Real &  alpha_2 
)
staticinherited

Definition at line 60 of file JohnsonSB.C.

62{
63 if (x <= a)
64 return 0.0;
65 else if (x < b)
66 {
67 return Normal::cdf(alpha_1 + alpha_2 * std::log((x - a) / (b - x)), 0.0, 1.0);
68 }
69 else
70 return 0.0;
71}
virtual Real cdf(const Real &x) const override
Definition Normal.C:74

◆ cdf() [3/3]

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}

◆ pdf() [1/3]

Real JohnsonSB::pdf ( const Real &  x) const
overridevirtualinherited

Reimplemented from Normal.

Definition at line 82 of file JohnsonSB.C.

83{
84 return pdf(x, _lower, _upper, _alpha_1, _alpha_2);
85}
virtual Real pdf(const Real &x) const override
Definition JohnsonSB.C:82

Referenced by JohnsonSB::pdf().

◆ pdf() [2/3]

Real JohnsonSB::pdf ( const Real &  x,
const Real &  a,
const Real &  b,
const Real &  alpha_1,
const Real &  alpha_2 
)
staticinherited

Definition at line 45 of file JohnsonSB.C.

47{
48 if (x <= a)
49 return 0.0;
50 else if (x < b)
51 {
52 return (alpha_2 * (b - a)) / ((x - a) * (b - x) * std::sqrt(2.0 * M_PI)) *
53 std::exp(-0.5 * Utility::pow<2>(alpha_1 + alpha_2 * std::log((x - a) / (b - x))));
54 }
55 else
56 return 0.0;
57}

◆ pdf() [3/3]

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}

◆ quantile() [1/3]

Real JohnsonSB::quantile ( const Real &  p) const
overridevirtualinherited

Reimplemented from Normal.

Definition at line 94 of file JohnsonSB.C.

95{
97}
const Real p
virtual Real quantile(const Real &p) const override
Definition JohnsonSB.C:94

Referenced by JohnsonSB::quantile().

◆ quantile() [2/3]

Real JohnsonSB::quantile ( const Real &  p,
const Real &  a,
const Real &  b,
const Real &  alpha_1,
const Real &  alpha_2 
)
staticinherited

Definition at line 74 of file JohnsonSB.C.

76{
77 const Real Z = Normal::quantile(p, 0.0, 1.0);
78 return (a + b * std::exp((Z - alpha_1) / alpha_2)) / (1.0 + std::exp((Z - alpha_1) / alpha_2));
79}
virtual Real quantile(const Real &p) const override
Definition Normal.C:80
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ quantile() [3/3]

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}
const std::vector< double > y
static const std::array< Real, 6 > _a
Definition Normal.h:16
static const std::array< Real, 6 > _b
Definition Normal.h:19
int sgn(T val)
The sign function.
Definition Numerics.h:41

◆ validParams()

InputParameters JohnsonSBDistribution::validParams ( )
static

Definition at line 18 of file JohnsonSBDistribution.C.

19{
21}
static InputParameters validParams()
Definition JohnsonSB.C:17

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 16 of file Normal.h.

Referenced by Normal::quantile().

◆ _alpha_1

const Real& JohnsonSB::_alpha_1
protectedinherited

The first shape parameter, alpha_1.

Definition at line 43 of file JohnsonSB.h.

Referenced by JohnsonSB::cdf(), JohnsonSB::pdf(), and JohnsonSB::quantile().

◆ _alpha_2

const Real& JohnsonSB::_alpha_2
protectedinherited

The second shape parameter, alpha_2.

Definition at line 46 of file JohnsonSB.h.

Referenced by JohnsonSB::cdf(), JohnsonSB::pdf(), and JohnsonSB::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 19 of file Normal.h.

19 :
static InputParameters validParams()
Definition Normal.C:23

Referenced by Normal::quantile().

◆ _lower

const Real& JohnsonSB::_lower
protectedinherited

The lower location parameter, a.

Definition at line 37 of file JohnsonSB.h.

Referenced by JohnsonSB::cdf(), JohnsonSB::pdf(), and JohnsonSB::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(), Normal::pdf(), TruncatedNormal::pdf(), Normal::quantile(), and TruncatedNormal::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(), Normal::pdf(), TruncatedNormal::pdf(), Normal::quantile(), and TruncatedNormal::quantile().

◆ _upper

const Real& JohnsonSB::_upper
protectedinherited

The upper location parameter, b.

Definition at line 40 of file JohnsonSB.h.

Referenced by JohnsonSB::cdf(), JohnsonSB::pdf(), and JohnsonSB::quantile().


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