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
StudentT Class Reference

A class used to generate a Student's t distribution. More...

#include <StudentT.h>

Inheritance diagram for StudentT:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 StudentT (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 unsigned int &dof)
 
static Real cdf (const Real &x, const unsigned int &dof)
 
static Real quantile (const Real &p, const unsigned int &dof)
 
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 unsigned int_dof
 Degrees of freedom.
 
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 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 class used to generate a Student's t distribution.

Definition at line 17 of file StudentT.h.

Constructor & Destructor Documentation

◆ StudentT()

StudentT::StudentT ( const InputParameters parameters)

Definition at line 24 of file StudentT.C.

25 : Distribution(parameters), _dof(getParam<unsigned int>("dof"))
26{
27}
const InputParameters & parameters() const
const unsigned int & _dof
Degrees of freedom.
Definition StudentT.h:34

Member Function Documentation

◆ cdf() [1/2]

Real StudentT::cdf ( const Real &  x) const
overridevirtual

Implements Distribution.

Definition at line 60 of file StudentT.C.

61{
62 return cdf(x, _dof);
63}
const std::vector< double > x
virtual Real cdf(const Real &x) const override
Definition StudentT.C:60

Referenced by cdf().

◆ cdf() [2/2]

Real StudentT::cdf ( const Real &  x,
const unsigned int dof 
)
static

Definition at line 38 of file StudentT.C.

39{
40 Real v = dof;
41 Real z = Beta::incompleteBeta(v / 2.0, 0.5, v / (v + x * x)) / 2.0;
42 return x > 0 ? 1.0 - z : z;
43}
const double v
static Real incompleteBeta(const Real &a, const Real &b, const Real &x)
Lower incomplete beta function.
Definition Beta.C:82
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ pdf() [1/2]

Real StudentT::pdf ( const Real &  x) const
overridevirtual

Implements Distribution.

Definition at line 54 of file StudentT.C.

55{
56 return pdf(x, _dof);
57}
virtual Real pdf(const Real &x) const override
Definition StudentT.C:54

Referenced by pdf().

◆ pdf() [2/2]

Real StudentT::pdf ( const Real &  x,
const unsigned int dof 
)
static

Definition at line 30 of file StudentT.C.

31{
32 Real v = dof;
33 return std::pow((v / (v + x * x)), (1.0 + v) / 2.0) /
34 (std::sqrt(v) * Beta::betaFunction(v / 2.0, 0.5));
35}
static Real betaFunction(const Real &a, const Real &b)
Beta function: B(a,b) = Gamma(a)Gamma(b)/Gamma(a+b)
Definition Beta.C:76

◆ quantile() [1/2]

Real StudentT::quantile ( const Real &  p) const
overridevirtual

Implements Distribution.

Definition at line 66 of file StudentT.C.

67{
68 return quantile(p, _dof);
69}
const Real p
virtual Real quantile(const Real &p) const override
Definition StudentT.C:66

Referenced by quantile().

◆ quantile() [2/2]

Real StudentT::quantile ( const Real &  p,
const unsigned int dof 
)
static

Definition at line 46 of file StudentT.C.

47{
48 Real v = dof;
49 Real x = Beta::incompleteBetaInv(v / 2.0, 0.5, 2.0 * (p <= 0.5 ? p : 1.0 - p));
50 return (p <= 0.5 ? -1.0 : 1.0) * std::sqrt(v * (1 - x) / x);
51}
static Real incompleteBetaInv(const Real &a, const Real &b, const Real &p)
Inverse of lower incomplete beta function.
Definition Beta.C:124
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh

◆ validParams()

InputParameters StudentT::validParams ( )
static

Definition at line 16 of file StudentT.C.

17{
19 params.addClassDescription("Student t-distribution");
20 params.addRequiredRangeCheckedParam<unsigned int>("dof", "dof > 0", "Degrees of freedom.");
21 return params;
22}
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _dof

const unsigned int& StudentT::_dof
protected

Degrees of freedom.

Definition at line 34 of file StudentT.h.

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


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