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

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

#include <JohnsonSBDistribution.h>

Inheritance diagram for JohnsonSBDistribution:
[legend]

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
 
Real pdf (const Real &x, const Real &a, const Real &b, const Real &alpha_1, const Real &alpha_2) const
 
Real cdf (const Real &x, const Real &a, const Real &b, const Real &alpha_1, const Real &alpha_2) const
 
Real quantile (const Real &p, const Real &a, const Real &b, const Real &alpha_1, const Real &alpha_2) const
 
Real pdf (const Real &x, const Real &mean, const Real &std_dev) const
 
Real cdf (const Real &x, const Real &mean, const Real &std_dev) const
 
Real quantile (const Real &p, const Real &mean, const Real &std_dev) const
 

Protected Attributes

const Real & _lower
 The lower location parameter, a. More...
 
const Real & _upper
 The upper location parameter, b. More...
 
const Real & _alpha_1
 The first shape parameter, alpha_1. More...
 
const Real & _alpha_2
 The second shape parameter, alpha_2. More...
 
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 std::vector< Real > _a
 
const std::vector< Real > _b
 

Detailed Description

A class used to generate a Johnson SB distribution.

Definition at line 23 of file JohnsonSBDistribution.h.

Constructor & Destructor Documentation

◆ JohnsonSBDistribution()

JohnsonSBDistribution::JohnsonSBDistribution ( const InputParameters &  parameters)

Definition at line 36 of file JohnsonSBDistribution.C.

37  : NormalDistribution(parameters),
38  _lower(getParam<Real>("a")),
39  _upper(getParam<Real>("b")),
40  _alpha_1(getParam<Real>("alpha_1")),
41  _alpha_2(getParam<Real>("alpha_2"))
42 {
43 }
const Real & _alpha_1
The first shape parameter, alpha_1.
const Real & _upper
The upper location parameter, b.
NormalDistribution(const InputParameters &parameters)
const Real & _alpha_2
The second shape parameter, alpha_2.
const Real & _lower
The lower location parameter, a.

Member Function Documentation

◆ cdf() [1/3]

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

Reimplemented from NormalDistribution.

Definition at line 98 of file JohnsonSBDistribution.C.

99 {
100  return cdf(x, _lower, _upper, _alpha_1, _alpha_2);
101 }
const Real & _alpha_1
The first shape parameter, alpha_1.
const Real & _upper
The upper location parameter, b.
const Real & _alpha_2
The second shape parameter, alpha_2.
virtual Real cdf(const Real &x) const override
const Real & _lower
The lower location parameter, a.

◆ cdf() [2/3]

Real NormalDistribution::cdf ( const Real &  x,
const Real &  mean,
const Real &  std_dev 
) const
inherited

Definition at line 42 of file NormalDistribution.C.

43 {
44  return 0.5 * (1.0 + std::erf((x - mean) / (std_dev * std::sqrt(2.0))));
45 }

◆ cdf() [3/3]

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

Definition at line 64 of file JohnsonSBDistribution.C.

69 {
70  if (x <= a)
71  return 0.0;
72  else if (x < b)
73  {
74  return NormalDistribution::cdf(alpha_1 + alpha_2 * std::log((x - a) / (b - x)));
75  }
76  else
77  return 0.0;
78 }
virtual Real cdf(const Real &x) const override

◆ pdf() [1/3]

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

Reimplemented from NormalDistribution.

Definition at line 92 of file JohnsonSBDistribution.C.

93 {
94  return pdf(x, _lower, _upper, _alpha_1, _alpha_2);
95 }
virtual Real pdf(const Real &x) const override
const Real & _alpha_1
The first shape parameter, alpha_1.
const Real & _upper
The upper location parameter, b.
const Real & _alpha_2
The second shape parameter, alpha_2.
const Real & _lower
The lower location parameter, a.

◆ pdf() [2/3]

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

Definition at line 46 of file JohnsonSBDistribution.C.

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

◆ pdf() [3/3]

Real NormalDistribution::pdf ( const Real &  x,
const Real &  mean,
const Real &  std_dev 
) const
inherited

Definition at line 35 of file NormalDistribution.C.

36 {
37  return 1.0 / (std_dev * std::sqrt(2.0 * M_PI)) *
38  std::exp(-0.5 * Utility::pow<2>((x - mean) / std_dev));
39 }

◆ quantile() [1/3]

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

Reimplemented from NormalDistribution.

Definition at line 104 of file JohnsonSBDistribution.C.

105 {
106  return quantile(p, _lower, _upper, _alpha_1, _alpha_2);
107 }
const Real & _alpha_1
The first shape parameter, alpha_1.
const Real & _upper
The upper location parameter, b.
virtual Real quantile(const Real &p) const override
const Real & _alpha_2
The second shape parameter, alpha_2.
const Real & _lower
The lower location parameter, a.

◆ quantile() [2/3]

Real NormalDistribution::quantile ( const Real &  p,
const Real &  mean,
const Real &  std_dev 
) const
inherited

Definition at line 48 of file NormalDistribution.C.

49 {
50  Real x = (p < 0.5 ? p : 1.0 - p);
51  Real y = std::sqrt(-2.0 * std::log(x));
52  Real sgn = (p - 0.5 < 0.0 ? -1.0 : 1.0);
53  Real Zp = sgn * (y + (_a[0] + _a[1] * y + _a[2] * Utility::pow<2>(y) +
54  _a[3] * Utility::pow<3>(y) + _a[4] * Utility::pow<4>(y)) /
55  (_b[0] + _b[1] * y + _b[2] * Utility::pow<2>(y) +
56  _b[3] * Utility::pow<3>(y) + _b[4] * Utility::pow<4>(y)));
57  return Zp * std_dev + mean;
58 }
const std::vector< Real > _a
const std::vector< Real > _b

◆ quantile() [3/3]

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

Definition at line 81 of file JohnsonSBDistribution.C.

86 {
87  const Real Z = NormalDistribution::quantile(p);
88  return (a + b * std::exp((Z - alpha_1) / alpha_2)) / (1.0 + std::exp((Z - alpha_1) / alpha_2));
89 }
virtual Real quantile(const Real &p) const override

Member Data Documentation

◆ _a

const std::vector<Real> NormalDistribution::_a
protectedinherited
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 39 of file NormalDistribution.h.

Referenced by NormalDistribution::quantile().

◆ _alpha_1

const Real& JohnsonSBDistribution::_alpha_1
protected

The first shape parameter, alpha_1.

Definition at line 56 of file JohnsonSBDistribution.h.

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

◆ _alpha_2

const Real& JohnsonSBDistribution::_alpha_2
protected

The second shape parameter, alpha_2.

Definition at line 59 of file JohnsonSBDistribution.h.

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

◆ _b

const std::vector<Real> NormalDistribution::_b
protectedinherited
Initial value:
= {
0.099348462606, 0.588581570495, 0.531103462366, 0.10353775285, 0.0038560700634}

Definition at line 42 of file NormalDistribution.h.

Referenced by NormalDistribution::quantile().

◆ _lower

const Real& JohnsonSBDistribution::_lower
protected

The lower location parameter, a.

Definition at line 50 of file JohnsonSBDistribution.h.

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

◆ _mean

const Real& NormalDistribution::_mean
protectedinherited

◆ _standard_deviation

const Real& NormalDistribution::_standard_deviation
protectedinherited

◆ _upper

const Real& JohnsonSBDistribution::_upper
protected

The upper location parameter, b.

Definition at line 53 of file JohnsonSBDistribution.h.

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


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