12 #include "libmesh/utility.h" 17 {-0.322232431088, -1.0, -0.342242088547, -0.0204231210245, -0.0000453642210148}};
20 {0.099348462606, 0.588581570495, 0.531103462366, 0.10353775285, 0.0038560700634}};
29 "standard_deviation",
"standard_deviation > 0",
"Standard deviation of the distribution ");
35 _mean(getParam<
Real>(
"mean")),
36 _standard_deviation(getParam<
Real>(
"standard_deviation"))
41 Normal::pdf(
const Real &
x,
const Real & mean,
const Real & std_dev)
43 return 1.0 / (std_dev * std::sqrt(2.0 * M_PI)) *
44 std::exp(-0.5 * Utility::pow<2>((
x - mean) / std_dev));
48 Normal::cdf(
const Real &
x,
const Real & mean,
const Real & std_dev)
50 return 0.5 * (1.0 + std::erf((
x - mean) / (std_dev * std::sqrt(2.0))));
56 const Real x = (p < 0.5 ? p : 1.0 - p);
57 const Real y = std::sqrt(-2.0 * std::log(
x));
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);
63 (
_b[0] +
_b[1] *
y +
_b[2] * y2 +
_b[3] * y3 +
_b[4] * y4));
64 return Zp * std_dev + mean;
const Real & _standard_deviation
The standard deviation of the distribution (sigma)
virtual Real cdf(const Real &x) const override
A class used to generate a normal distribution.
static InputParameters validParams()
int sgn(T val)
The sign function.
const std::vector< double > y
Normal(const InputParameters ¶meters)
virtual Real pdf(const Real &x) const override
const std::vector< double > x
static const std::array< Real, 6 > _a
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real & _mean
The mean (or expectation) of the distribution (mu)
static const std::array< Real, 6 > _b
static InputParameters validParams()
registerMooseObject("StochasticToolsApp", Normal)
virtual Real quantile(const Real &p) const override